-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Just coming back from hunting down a use-after-free bug in my code caused by UserEvents.
In summary: Some elements, i.e. notifiers, UserEvents, queues... allow the user to free the memory/reference in LabVIEW. At the same time these are things that one probably holds on for longer than just a single function call.
All I did in my code was release the UserEvent in LV right before the DLL call to my library. In the meantime my lib tried to send some UserEvents and crashed.
Idea:
- Test if the memory manager functions to check handles and ptrs (DSCheckHandle, DSCheckPtr) also work for the references of these elements.
- If that is possible we could implement a safe wrapper around the respective functionality. Maybe hidden behind a config option to disable this safety feature if the performance penalty may be unacceptable for some use cases.
JamesWiresmith
Metadata
Metadata
Assignees
Labels
No labels