GNOME Bugzilla – Bug 744082
Dead lock when exiting gjs
Last modified: 2015-02-06 10:35:01 UTC
Here is gjs script : const Clutter = imports.gi.Clutter; const Mainloop = imports.mainloop; Clutter.init(null, null); let stage = new Clutter.Stage({}); stage.show(); Mainloop.timeout_add(50, function() { Clutter.main_quit(); }); Clutter.main(); This triggers a deadlock here : Program received signal SIGINT, Interrupt. syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 38 ../sysdeps/unix/sysv/linux/x86_64/syscall.S: No such file or directory. (gdb) bt
+ Trace 234626
This pretty much prevents a Clutter app from exiting if using gjs. The equivalent in written using Gtk works. What could be done about it? Removing the master clock's source? Release the global lock?
Apparently hiding the stage before returning back to the mainloop works around this problem.
there's bug 742065 already open about this. it's weird that this only happens with GJS: PyGI does not have any issue with it, so I guess it's just a threading/GC issue. we could conceivably use a destructor to unref the backend and context, which would also take care of the master clock; I'm not entirely sure this would work, though.
*** This bug has been marked as a duplicate of bug 742065 ***