vranki / ExtPlane

Plugin for X-Plane flight simulator which allows reading and writing simulation properties

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash or no update when requesting array values

waynepiekarski opened this issue · comments

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!

Sounds valid, needs to be checked & fixed.

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.

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

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!