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

Plugin incompatible with Bell 407 Plugin #33

Open
KarlLeclerc opened this issue Aug 14, 2018 · 12 comments
Open

Plugin incompatible with Bell 407 Plugin #33

KarlLeclerc opened this issue Aug 14, 2018 · 12 comments

Comments

@KarlLeclerc
Copy link

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
Copy link
Owner

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
Copy link
Author

KarlLeclerc commented Sep 14, 2018 via email

@jimkeir
Copy link

jimkeir commented Jul 23, 2019

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
Copy link
Owner

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
Copy link

jimkeir commented Aug 5, 2019

@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
Copy link
Owner

@jimkeir good point.

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

@jimkeir
Copy link

jimkeir commented Aug 7, 2019

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
Copy link
Author

KarlLeclerc commented Aug 10, 2019 via email

@RotationMatrix
Copy link

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
Copy link
Owner

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
Copy link

RotationMatrix commented Apr 24, 2021

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
Copy link
Owner

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

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

4 participants