leecbaker / datareftool

DataRefTool for X-Plane plugin development
MIT License
127 stars 23 forks source link

Plugin incompatible with Bell 407 Plugin #33

Open KarlLeclerc opened 6 years ago

KarlLeclerc commented 6 years ago

Hi Lee,

The plugin is incompatible with the Dreamfoil Creations Bell 407 plugin. It is the only aircraft in my hangar that Dataref Tool does not work with. I have used it to develop checklists for most helicopters without problem. However, when using it with the Bell 407, upon requesting to show datarefs or commands, it crashes to desktop. Clicking on About DRT does display the github address link without crashing.

Many thanks for a great tool.

leecbaker commented 6 years ago

Hi @KarlLeclerc,

I suspect that what's going on here is that the Bell 407 plugin provides a dataref that crashes when it is read sometimes. This is somewhat common, and it's up to the plugin author to fix their plugin.

DRT has two different tools for working around this. If you can figure out which dataref it is, you can put it in a file called Resources/plugins/drt_blacklist.txt, and DRT will never read that dataref.

The second tool will be in a future release of DRT. On Mac and Linux, we're able to detect crashes in other plugins providing datarefs, and put a message in Log.txt so you know what the dataref causing the crash is. You can then add it to drt_blacklist.txt, and avoid the crash.

-Lee

KarlLeclerc commented 6 years ago

Thanks Lee. Looking forward to your next release.

Karl

On Sep 14, 2018, at 4:32 AM, Lee Baker notifications@github.com wrote:

Hi @KarlLeclerc https://github.com/KarlLeclerc,

I suspect that what's going on here is that the Bell 407 plugin provides a dataref that crashes when it is read sometimes. This is somewhat common, and it's up to the plugin author to fix their plugin.

DRT has two different tools for working around this. If you can figure out which dataref it is, you can put it in a file called Resources/plugins/drt_blacklist.txt, and DRT will never read that dataref.

The second tool will be in a future release of DRT. On Mac and Linux, we're able to detect crashes in other plugins providing datarefs, and put a message in Log.txt so you know what the dataref causing the crash is. You can then add it to drt_blacklist.txt, and avoid the crash.

-Lee

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/leecbaker/datareftool/issues/33#issuecomment-421273141, or mute the thread https://github.com/notifications/unsubscribe-auth/AcxQo9vMZVow9GDAgWGcM7FKulw4OXuxks5ua2mtgaJpZM4V9BSe.

jimkeir commented 5 years ago

FYI I had this with one of mine. It using the buffer length correctly but then not checking properly before doing some final null-termination stuff, if the buffer pointer was non-null. So, bug in my code. However, you might be able to reduce crashes if you don't pass a pointer to a zero-byte byte array; if you're trying to get the data size the docs say to pass a null pointer. HTH.

leecbaker commented 5 years ago

There's a thread related to this issue over at the X-Plane.org forums.

I also just emailed Dreamfoil to see if we can get them to fix the plugin.

@jimkeir Thanks for the suggestion. If I understand correctly, you're saying that we should not read an array dataref if the size is indicated to be zero, correct?

jimkeir commented 5 years ago

@jimkeir Thanks for the suggestion. If I understand correctly, you're saying that we should not read an array dataref if the size is indicated to be zero, correct?

I think it may help you to avoid other people's bugs. It's a minimal change and worth a try, at least.

leecbaker commented 5 years ago

@jimkeir good point.

By any chance do you have the Bell 407? Are you experiencing this crash?

jimkeir commented 5 years ago

By any chance do you have the Bell 407? Are you experiencing this crash?

No, I don't, sorry. My bugs are entirely home-grown :) I was seeing this crash though and while I've fixed the problem here I can recreate it if it helps you test.

KarlLeclerc commented 5 years ago

I have the Bell 407. I reported having this crash problem with versions 3 to 3.0.3 of Plane Command over a year ago. The problem went away with an update, not exactly sure which one. It could have been updating X-Plane to 11.35, an update of the 407 plugin, or the update to PlaneCommand 3.1. With the latest versions, it is not crashing anymore. The log.txt files are clean.

As additional feedback, the voice recognition in 3.1 is a lot better with my Mac’s built-in microphone, but still results in a lot of misunderstood commands (that I can also read in the log.txt file). I will have to test with a headset to see if my interest in this plugin will come back.

Karl

On Aug 7, 2019, at 9:31 AM, Lee Baker notifications@github.com wrote:

@jimkeir https://github.com/jimkeir good point.

By any chance do you have the Bell 407? Are you experiencing this crash?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/leecbaker/datareftool/issues/33?email_source=notifications&email_token=AHGFBIYYE4YKQ3GDYDRYI6DQDLFC3A5CNFSM4FPUCSPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3YM5HA#issuecomment-519098012, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGFBI7DMNOGCFZCCV6HPUTQDLFC3ANCNFSM4FPUCSPA.

RotationMatrix commented 3 years ago

It appears these datarefs are the ones crashing. So far the Bell 407 runs without crashing after adding them to my drt_ignore.txt.

B407/Lights/CL1
B407/Lights/CL2
B407/Lights/CL3
leecbaker commented 3 years ago

It appears these datarefs are the ones crashing. So far the Bell 407 runs without crashing after adding them to my drt_ignore.txt.

Thanks for figuring this out! I'll send a note to the developer, maybe we can get this fixed.

RotationMatrix commented 3 years ago

When querying B407/Lights/CL1, the array length being returned here seems inconsistent and too large. In three different sessions the length was: 1041955840, 1042089216, and 1042140160. Maybe this is not the array length, leading to an out-of-bounds read on the next call?

Edit: If I limit current_array_length to <100 on this dataref we do not get a SIGSEGV.

leecbaker commented 3 years ago

@RotationMatrix Thanks for the help debugging. I've sent a message to the developer, it's in their hands now.