GNOME Bugzilla – Bug 332608
gimp-quit crashes Gimp when used through Script-Fu
Last modified: 2008-01-15 14:05:54 UTC
Steps to reproduce: 1. Start Script-Fu server 2. Open a session with the server (I use gimp-shell from emacs) 3. Send (gimp-quit 0) Stack trace: Received request #4 from IP address 127.0.0.1: (int--emacs-tostring (gimp-quit 0)) on Fri Feb 24 13:27:46 2006 ,[Request queue length: 1]Processing request #4 /var/preserve/newgimp/bindev/bin/gimp-2.3: fatal error: Segmentation Fault /var/preserve/newgimp/bindev/bin/gimp-2.3 (pid:11499): [E]xit, [H]alt, show [S]tack trace or [P]roceed: s #1: #2: #3: #4:
+ Trace 66520
Other information: The same operation do not crash gimp 2.2.7/Linux/x86 nor 2.2.10/Solaris/Sparc. Anyway, as GIMP_IS_GIMP(gimp) is defined as a glib function, and 2.2 and 2.3 do not use the same glib release, this could be related.
Using (gimp-quit) from the Script-Fu console triggers the crash as well.
Using pdb['gimp-quit'](0) from Python-Fu console triggers it too. Launching gimp-2.3 --verbose show that the segfault occurs after gimp_real_exit(). EXIT: gimp_real_exit Interruption du greffon : « /mnt/bindev/lib/gimp/2.0/plug-ins/script-fu » Interruption du greffon : « /mnt/bindev/lib/gimp/2.0/plug-ins/script-fu » Writing '/home/eric/.gimp-2.3/documents' Writing '/home/eric/.gimp-2.3/templaterc' Writing '/home/eric/.gimp-2.3/parasiterc' Writing '/home/eric/.gimp-2.3/unitrc' EXIT: gui_exit_after_callback EXIT: app_exit_after_callback /mnt/bindev/bin/gimp-2.3: fatal error: Segmentation Fault Gimp 2.2.10 ends after "EXIT: app_exit_after_callback". I'm pretty sure I got a different trace in 2.3.7 saying that "Assertion failed" in plugin_pop() but I cannot reproduce it. I use glib 2.8.6 for the 2.3.7 build. I also tried the batch version with or without the interface and gimp does not crash : gimp --verbose -i -b '(gimp-quit 0)' and gimp --verbose -b '(gimp-quit 0)'. In both case, the last trace are: EXIT: gui_exit_after_callback EXIT: batch.c:115
Hm... no (at least no obvious) signs of a crash with 2.3.7 on Win32.
It isn't surprising that 2.3 behaves differently from 2.2 here. In the unstable versions we do a clean shutdown, quit the main loop and release all resources. Since this takes a while we simply call exit() in the stable production releases. See app_exit_after_callback() in app/app_procs.c.
If I do the same thing in Gimp-2.3.5, the segfault does not occur. But there's a lot of Critical assertion which fails (gimp-2.3:26246): Gimp-Plug-In-CRITICAL **: plug_in_pop: assertion `GIMP_IS_GIMP (gimp)' failed (gimp-2.3:26246): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed (gimp-2.3:26246): Gimp-Plug-In-WARNING **: gimp-2.3: plug_in_flush(): error (gimp-2.3:26246): Gimp-Plug-In-WARNING **: plug_in_handle_proc_run: ERROR (gimp-2.3:26246): Gimp-Plug-In-CRITICAL **: plug_in_close: assertion `plug_in->open == TRUE' failed
Just verified that this problem still exists in the current CVS version.
Raising priority to High because it is important to fix this for 2.4.
Setting back because stable branched are not affected by this, they simply call exit() at the right time.
In that case, since 2.4 will be coming out shortly and we need to concentrate on the essential things, I will bump the target to Future.
Not reproductible with 2.3.9 on both Linux/x86 ans Solaris/Sparc. Here is the end of console output. It is very similar to gimp 2.3.5 but application does not trigger the segmentation fault. Processing request #4 (gimp-2.3:21311): GLib-CRITICAL **: g_io_channel_write_chars: assertion `channel != NULL' failed (gimp-2.3:21311): Gimp-Plug-In-WARNING **: gimp-2.3: plug_in_flush(): error (gimp-2.3:21311): Gimp-Plug-In-WARNING **: plug_in_handle_proc_run: ERROR (gimp-2.3:21311): Gimp-Plug-In-CRITICAL **: gimp_plug_in_close: assertion `plug_in->open' failed
Fixed in CVS: 2006-10-27 Michael Natterer <mitch@gimp.org> * app/plug-in/gimpplugin-message.c (gimp_plug_in_handle_proc_run): don't send a return value if executing the procedure closed the plug-in (as is the case with gimp-quit). Fixes bug #332608.
OK even with tiny-fu (2.3.15) using script-fu console and script-fu server.