-
-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Hi all,
I encountered SIGSEGV error in Gst.extractError function, here is full error report file:
hs_err_pid32632.log
When a JNA function is invoked with a Structure.ByReference
parameter, JNA automatically reads the contents of this structure upon completion of the native function call. This step is crucial for propagating any modifications made by the native function back to a corresponding Java class that mirrors the native structure. The implementation responsible for this process can be found here.
The seg fault happens when extractError
function calls g_error_free
function which releases memory used by GErrorStruct
structure.
Since g_error_free
function releases memory used by the passed structure and structure is passed by reference, JNA attempts to read from a memory that has been released. This leads to "use-after-free" bug.
I made a fix to prevent JNA from reading structure content after call to g_error_free
function: #279