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 350226 - recompose plugin crashes GIMP when called through the PDB
recompose plugin crashes GIMP when called through the PDB
Status: RESOLVED DUPLICATE of bug 350555
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal normal
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2006-08-07 06:28 UTC by david gowers
Modified: 2006-08-15 06:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugin to cause recompose to crash (726 bytes, text/plain)
2006-08-14 15:02 UTC, david gowers
Details

Description david gowers 2006-08-07 06:28:14 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.
Comment 1 Sven Neumann 2006-08-14 13:07:02 UTC
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).
Comment 2 david gowers 2006-08-14 14:59:04 UTC
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
  • #0 __kernel_vsyscall
  • #1 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #2 gimp_debug_stop
    at gimp.c line 1445
  • #3 gimp_main
    at gimp.c line 452
  • #4 main
    at compose.c line 327
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)
Comment 3 david gowers 2006-08-14 15:02:56 UTC
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'
Comment 4 Sven Neumann 2006-08-14 17:48:51 UTC
As your output clearly shows, the compose plug-in didn't crash and exited normally. What is the point you are trying to make?
Comment 5 david gowers 2006-08-15 00:37:42 UTC
If it didn't, then gimp did, because the result is a crash, gimp exploding (not just compose)
Comment 6 david gowers 2006-08-15 00:58:11 UTC
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.

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 IA__g_on_error_stack_trace
  • #3 IA__g_on_error_query
  • #4 gimp_eek
  • #5 gimp_fatal_error
  • #6 gimp_sigfatal_handler
    at main.c line 581
  • #7 <signal handler called>
  • #8 plug_in_params_to_args
  • #9 gimp_plug_in_handle_message
  • #10 gimp_plug_in_recv_message
  • #11 g_io_unix_dispatch
  • #12 IA__g_main_context_dispatch
  • #13 g_main_context_iterate
  • #14 IA__g_main_loop_run
    at gmain.c line 2879
  • #15 gimp_plug_in_manager_call_run
  • #16 gimp_plug_in_procedure_execute
  • #17 gimp_procedure_execute
  • #18 gimp_pdb_execute_procedure_by_name_args
  • #19 gimp_plug_in_handle_message
  • #20 gimp_plug_in_recv_message
  • #21 g_io_unix_dispatch
  • #22 IA__g_main_context_dispatch
  • #23 g_main_context_iterate
  • #24 IA__g_main_loop_run
    at gmain.c line 2879
  • #25 app_run
  • #26 main
    at main.c line 318

Comment 7 Sven Neumann 2006-08-15 06:18:43 UTC
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.
Comment 8 Sven Neumann 2006-08-15 06:26:57 UTC
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 ***