-
Notifications
You must be signed in to change notification settings - Fork 10
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
Segfault in Cleaner #111
Comments
Thanks for reporting this, and for the VM logs. When a Java-GI proxy object for a native GObject instance is garbage-collected, a Cleaner is triggered to call g_return_if_fail (G_IS_OBJECT (object)); The This is a bug in Java-GI because
This is a known issue because it also occured in Gir.Core a while ago (link) and @badcel notified me about it. I know how to fix this; it just wasn't high on my todo list until now. As you said, this issue is hard to reproduce, so I'd appreciate if you can test the fix when it's ready (I will publish a preview release). |
@JFronny I published a 0.10.2-SNAPSHOT release that I hope will fix the issue. Can you please retest? For snapshot dependencies, add https://s01.oss.sonatype.org/content/repositories/snapshots to the repositories in your build script. |
I will retest it next weekend |
I have retested it using 0.10.2-SNAPSHOT, but still seem to be getting segfaults. |
Can you please run with environment variable |
The segfault happens when a I tried to debug the issue in Inceptum. It seems to be triggered for One thing that maybe will help, is to store your StringList instances somewhere in a field that you keep alive while the "create" dialog is open. The JVM doesn't know that the StringList model is used by native code, so you have to make sure it is "kept alive", otherwise the GC sometimes destroys it too soon. Still, that doesn't explain why the StringList instance seems to be cleaned twice... |
This should be fixed now. The problem was that the ownership of the StringList is transferred to the DropDown constructor, which means that it eventually will drop the reference, so java-gi must increase the ref count to avoid a double free like we were seeing. This didn't work for interface instances (a ListModel in this case) due to a bug. Furthermore, the ref count was increased after the function call (instead of before), but that's too late, so I moved the check. I've published a new 0.10.2-SNAPSHOT version. |
I have just tried it again and can no longer reproduce this with the latest build, so it seems like the fix worked. |
In my application, I have been encountering a segfault appearing seemingly at random.
After looking more closely at the JVM error that is generated, this seems to be coming from an invocation of
g_type_check_instance_is_fundamentally_a
happening somewhere in theCleaner-1
thread, which is why I am opening this here.Unfortunately, I have not been able to build a simple reproducer, but if you need more information, I'll try to help.
Some of the VM error logs:
The text was updated successfully, but these errors were encountered: