GNOME Bugzilla – Bug 729611
Segfault at exit when calling WebKit2.WebContext.register_uri_scheme
Last modified: 2017-03-15 22:18:49 UTC
This minimal program segfaults at exit: const WebKit = imports.gi.WebKit2; WebKit.WebContext.get_default().register_uri_scheme('image', function(request) {}); Looks to be something wrong in the GC, but I'm not familiar enough with that part of GJS to figure out what's going on. Backtrace below: Program received signal SIGSEGV, Segmentation fault. Gtk-Message: Failed to load module "canberra-gtk-module" GLib-GIO-Message: Using the 'memory' GSettings backend. Your settings will not be saved or shared with other applications. 0xb6e8f3c4 in ?? () from /usr/lib/i386-linux-gnu/libmozjs-24.so.0 (gdb) bt
+ Trace 233567
Stupid webkit registers at atexit handler and calls into JS code long after the runtime is gone...
I see... and use of atexit() is deprecated in GObject libraries. What's the usual pattern for replacing this?
(In reply to comment #2) > I see... and use of atexit() is deprecated in GObject libraries. What's the > usual pattern for replacing this? Do nothing and let the kernel take care of freeing the memory?
yeah, not our bug. webkit is dumb.
For the paper trail, here's the Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=116672