GNOME Bugzilla – Bug 350226
recompose plugin crashes GIMP when called through the PDB
Last modified: 2006-08-15 06:26:57 UTC
The recompose plugin crashes when called through the PDB, though it works normally when called through the menus. Try the following: 1. Close all open images, then load an image. 2. Bring up the Python console 3. Paste in the following: # decompose to images, try to recompose i = gimp.image_list()[0] images = pdb.plug_in_decompose(i, i.layers[0], 'rgb', 0) # The following line crashes GIMP. pdb.plug_in_recompose(images[0], images[0].layers[0]) recomposing from the result of decomposing to drawables also causes a crash: i = gimp.image_list()[0] images = pdb.plug_in_decompose(i, i.layers[0], 'rgb', 1) # The following line crashes GIMP. pdb.plug_in_recompose(images[0], images[0].layers[0]) I've checked that decompose returns values that make sense, And I can do the decompose through the menus okay, but PDB calling recompose on the resultant image(s) still crashes GIMP that way. I've examined plug-ins/common/compose.c without success so far.
This works for me. No crash and the result looks just fine. Setting to NEEDINFO to give the bug reporter a chance to describe how to reliably reproduce this problem. If you can reproduce it, it would probably be useful to run the compose plug-in in a debugger (see devel-docs/debug-plug-ins.txt).
Of course it's reliable! it's a few steps, that ALWAYS cause the crash. But, I can put it more simply: to crash gimp, just call pdb.plug_in_recompose on the output of a previous decompose operation. It happened with all tested RGB images, whether the previous decompose operation was done via PDB call or menu,whether decomposing to images or layers, whether decomposing the RGB or RGBA or LAB channels. In all cases. The only difference between crash or not is whether I access recompose via the PDB or via the menus. with GIMP_PLUGIN_DEBUG=compose , I got the following backtrace, which is possibly even less helpful than the backtrace of gimp itself, mainly because I don't know what the specifics of what the MAIN() macro is supposed to produce (line 327 of compose.c is 'MAIN()') " (gdb) cont Continuing. Program received signal SIGSTOP, Stopped (signal). 0xffffe410 in __kernel_vsyscall () (gdb) backtrace
+ Trace 70425
Continuing. Program received signal SIGSTOP, Stopped (signal). 0xffffe410 in __kernel_vsyscall () (gdb) cont Continuing. Program exited normally. (gdb) backtrace No stack. (gdb) cont The program is not being run. " I hope that since I can reproduce this 100% of the time, someone else will at least be able to do so some of the time. I can make a simple plugin that should always trigger the crash. (attachment follows)
Created attachment 70867 [details] plugin to cause recompose to crash To be used on one of the outputs of decompose, accessed via 'Image->Kaboom recompose'
As your output clearly shows, the compose plug-in didn't crash and exited normally. What is the point you are trying to make?
If it didn't, then gimp did, because the result is a crash, gimp exploding (not just compose)
I noticed just before gimp prints the 'waiting for debugger' message, it prints the following: a calling error occurred while trying to run: "gimp-image-get-name" a calling error occurred while trying to run: "gimp-image-get-layers" Which I must assume is related to the compose plugin directly, since pygimp manages to show the name and layerstack okay. I also noticed, that the compose progress dialog comes up, the progress bar fills up, and *then* the crash occurs (as you said, after compose exits 'successfully') Here's the backtrace of gimp; perhaps it will mean more to you than me. All I discern is that somewhere between #9 and #8, the paramspecs argument becomes NULL. plug-in-params.c and gimpplugin-message.c seem to indicate that this is acceptable, but given the calling errors I'm wondering if something unexpected is happening in that area.
+ Trace 70463
That's not reproducable for me because it has been fixed already. This is a duplicate of bug #350555. But we should nevertheless also fix the return value of the recompose procedure, thus I am not closing this bug-report yet.
2006-08-15 Sven Neumann <sven@gimp.org> * plug-ins/common/compose.c: has only one return value if called as recompose. Fixes the trigger for bug #350226. *** This bug has been marked as a duplicate of 350555 ***