Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash or no update when requesting array values #26

Closed
waynepiekarski opened this issue Mar 9, 2018 · 4 comments
Closed

Crash or no update when requesting array values #26

waynepiekarski opened this issue Mar 9, 2018 · 4 comments

Comments

@waynepiekarski
Copy link
Contributor

I am trying to get the value of the light switches in the cockpit for the Boeing 737.
sub sim/cockpit2/switches/generic_lights_switch[0]
sub sim/cockpit2/switches/generic_lights_switch[1]
sub sim/cockpit2/switches/landing_lights_switch[0]

When I make these requests, nothing happens, so its like they are not found. If I remove the array index, it crashes the whole sim.

I am able to get these values out via the X-Plane UDP RREF command, so it should be possible to do this. Also, a while ago you fixed up #22 which seemed to fix up anything without an array index, but that does not fix this problem.

Thanks!

@vranki
Copy link
Owner

vranki commented Mar 21, 2018

Sounds valid, needs to be checked & fixed.

@vranki
Copy link
Owner

vranki commented Mar 30, 2018

Ok, first the sub commands are wrong, you should subscribe to whole dataref, not just one index. So the correct would be:

sub sim/cockpit2/switches/generic_lights_switch
sub sim/cockpit2/switches/landing_lights_switch

I did manage to reproduce the crash. Looks like there is some memory allocation issue related to array datarefs. The sim crashes with a delay and stack trace looking:

#0 0x00007ffff35b3eaa in _int_malloc (av=av@entry=0x7ffff3902c20 <main_arena>, bytes=bytes@entry=24) at malloc.c:3677
#1 0x00007ffff35b6f3e in __GI___libc_malloc (bytes=24) at malloc.c:3086
#2 0x00000000013f227a in operator new(unsigned long) ()
#3 0x000000000089e59f in UTL_threadpool_swarm::add_task(UTL_pool_task*) ()
#4 0x0000000000bd6d6e in flit_per_frame(UTL_pool_task**, UTL_pool_task**, void ()(void), void*) ()
#5 0x00000000004e786f in APP_update() ()
#6 0x00000000008e63f8 in MACIBM_post_event_proc() ()
#7 0x00000000013b8ada in WIN_run_app ()
#8 0x00000000004e9b3f in main ()

I'll continue investigation.

@vranki
Copy link
Owner

vranki commented Mar 30, 2018

There was a bug in array dataref handling which has now been fixed.

@vranki vranki closed this as completed Mar 30, 2018
@waynepiekarski
Copy link
Contributor Author

I finally manage to find some time to test this out, and it looks like it fixes everything up. Sorry for the delayed response. I appreciate your fix for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants