GNOME Bugzilla – Bug 780216
Possible deadlock in GtkSourceFileSaver
Last modified: 2017-03-19 09:45:53 UTC
I frequently get stuck on this appearent deadlock. See the backtrace below: sys:1: Warning: g_object_new_valist: object class 'GtkSourceBufferInputStream' has no property named 'newline-type' [Thread 0x7fffcc9ea700 (LWP 23599) exited] [Thread 0x7fffb6df7700 (LWP 23541) exited] [Thread 0x7fffb7fff700 (LWP 23527) exited] ^C Thread 1 "lt-gnome-builde" received signal SIGINT, Interrupt. 0x00007fffeeb55889 in syscall () from /usr/lib/libc.so.6 (gdb) bt
+ Trace 237277
This is probably related to bug 674885. However, since GtkSourceBufferInputStream is a private type, I don't exactly have access to be able to pre-register the type at startup (which usually works around the deadlock type initialization issue). One other possible workaround could be to synchronously save something at startup to an ephemeral file to force the type initialization. Another possibility is that this is just a memory corruption issue.
I've added a patch ontop of gtksourceview in our Builder.flatpak and notified upstream of our interest to have that done. If it's a memory corruption issue causing GOnce to break, it wont help. But if it is indeed related to similar deadlock issues, it might.
Let's move this bug to GtkSourceView.
(In reply to Georges Basile Stavracas Neto from comment #0) > I frequently get stuck on this appearent deadlock. So the application freezes completely? I think it's fine to add: g_type_ensure (GTK_SOURCE_TYPE_BUFFER_INPUT_STREAM); in gtk_source_file_saver_class_init().
Created attachment 348218 [details] [review] workaround deadlock by preregistering types
(In reply to Georges Basile Stavracas Neto from comment #0) > sys:1: Warning: g_object_new_valist: object class > 'GtkSourceBufferInputStream' has no property named 'newline-type' This warning is strange because GtkSourceBufferInputStream *has* a property named 'newline-type'. If it deadlocks, why doesn't it deadlock *before* issuing that warning? Anyway, the g_type_ensure() would be harmless, and there are chances that it will solve the bug.
The problem from last time I looked into this was in getting the default value for it. I think it could find the pspec in the param spec pool, but something else (getting access to the default value via the enum vtable or something) was the issue.
Review of attachment 348218 [details] [review]: It needs comments with a link to this bug, and also a link to https://bugzilla.gnome.org/show_bug.cgi?id=674885, explaining that it's a workaround. The master branch is not frozen, but the gnome-3-24 branch is (hard code freeze). So on gnome-3-24 it'll need to be pushed after the freeze.
Created attachment 348219 [details] [review] workaround deadlocks in type initialization
Review of attachment 348219 [details] [review]: Thanks.
Comment on attachment 348219 [details] [review] workaround deadlocks in type initialization Attachment 348219 [details] pushed as 924fee3 - workaround deadlocks in type initialization
And now cherry-picked on gnome-3-24: commit fb70858b230ebc60595dca103823f8c772ea974b