Run cleanable immediately when calling yieldOwnership (fixes #222) #224

Merged
BwackNinja merged 1 commit from fix-222 into main 2025-05-09 22:45:35 +02:00
BwackNinja commented 2025-05-08 22:26:41 +02:00 (Migrated from github.com)

Avoids the potential memory corruption as described in #222

Avoids the potential memory corruption as described in #222
jwharm commented 2025-05-08 22:32:40 +02:00 (Migrated from github.com)

Thanks!
Do you have specific examples to test this with?

Thanks! Do you have specific examples to test this with?
BwackNinja commented 2025-05-09 01:00:00 +02:00 (Migrated from github.com)

I don't have a self-contained example to test with. I could try to write one. I found this when sending an event to a GstPipeline.

Event flushStop = Event.flushStop(true);
pipeline.sendEvent(flushStop);

I added a log statement to MemoryCleaner.getOrRegister to see the associated address

if (address != null) {
    System.err.println("Caching object " + address.address() + " - " + proxy.getClass());
}

and correlated that to the hs_err_pid*.log file where it failed calling gst_mini_object_unref on that address. I could get a crash to happen within 20 minutes, but not at all after these changes.

I don't have a self-contained example to test with. I could try to write one. I found this when sending an event to a GstPipeline. ``` Event flushStop = Event.flushStop(true); pipeline.sendEvent(flushStop); ``` I added a log statement to MemoryCleaner.getOrRegister to see the associated address ``` if (address != null) { System.err.println("Caching object " + address.address() + " - " + proxy.getClass()); } ``` and correlated that to the hs_err_pid*.log file where it failed calling gst_mini_object_unref on that address. I could get a crash to happen within 20 minutes, but not at all after these changes.
Sign in to join this conversation.
No description provided.