After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 332608 - gimp-quit crashes Gimp when used through Script-Fu
gimp-quit crashes Gimp when used through Script-Fu
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: General
2.3.x
Other All
: Normal critical
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-02-26 11:14 UTC by Eric Lamarque
Modified: 2008-01-15 14:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Eric Lamarque 2006-02-26 11:14:56 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:
  • #0 _waitid
    from /usr/lib/libc.so.1
  • #1 _waitpid
    from /usr/lib/libc.so.1
  • #2 waitpid
    from /usr/lib/libthread.so.1
  • #3 g_on_error_query
  • #4 gimp_eek
  • #5 gimp_fatal_error
  • #6 gimp_sigfatal_handler
  • #7 __sighndlr
    from /usr/lib/libthread.so.1
  • #8 <signal handler called>
  • #9 g_type_check_instance_is_a
  • #10 plug_in_pop
  • #11 plug_in_handle_proc_run
  • #12 plug_in_handle_message
  • #13 plug_in_recv_message
  • #14 g_io_unix_dispatch
  • #15 g_main_dispatch
  • #16 g_main_context_dispatch
  • #17 g_main_context_iterate
  • #18 g_main_loop_run
  • #19 app_run
  • #20 main


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.
Comment 1 Sven Neumann 2006-02-26 12:40:01 UTC
Using (gimp-quit) from the Script-Fu console triggers the crash as well.
Comment 2 Eric Lamarque 2006-03-02 10:26:05 UTC
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
Comment 3 Michael Schumacher 2006-03-02 10:58:20 UTC
Hm... no (at least no obvious) signs of a crash with 2.3.7 on Win32.
Comment 4 Sven Neumann 2006-03-03 10:51:27 UTC
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.
Comment 5 Eric Lamarque 2006-03-05 14:55:24 UTC
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
Comment 6 Sven Neumann 2006-04-04 14:29:14 UTC
Just verified that this problem still exists in the current CVS version.
Comment 7 weskaggs 2006-05-21 19:42:12 UTC
Raising priority to High because it is important to fix this for 2.4.
Comment 8 Michael Natterer 2006-05-21 21:26:36 UTC
Setting back because stable branched are not affected by this,
they simply call exit() at the right time.
Comment 9 weskaggs 2006-05-21 23:01:42 UTC
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.
Comment 10 Eric Lamarque 2006-06-08 21:00:10 UTC
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

Comment 11 Michael Natterer 2006-10-27 13:17:12 UTC
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.
Comment 12 Eric Lamarque 2007-04-24 15:10:08 UTC
OK even with tiny-fu (2.3.15) using script-fu console and script-fu server.