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 126212 - screenshot plugin crashes on large captures
screenshot plugin crashes on large captures
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Backend: X11
2.2.x
Other Linux
: Normal normal
: Need diagnosis
Assigned To: gtk-bugs
gtk-bugs
: 117487 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-11-04 17:38 UTC by lwillis
Modified: 2014-03-24 03:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that might fix the problem (2.32 KB, patch)
2003-11-05 12:10 UTC, Sven Neumann
committed Details | Review
test program (365 bytes, text/plain)
2003-11-07 23:28 UTC, Matthias Clasen
  Details
Debug output (2.04 KB, text/plain)
2003-11-10 09:32 UTC, lwillis
  Details
Valgrind output of valgrind --num-callers=12 ./testprogram 0x1e0000a 1006 779 (8.05 KB, text/plain)
2004-08-25 17:51 UTC, bugzilla
  Details

Description lwillis 2003-11-04 17:38:07 UTC
Capturing small[1] windows seems to work find, but capturing large
images[2] crashes the plugin, and the following message pops up:

---------------------------------------
Plug-In crashed: "screenshot"
(/home/lwillis/garnome-0.26.2/lib/gimp/1.3/plug-ins/screenshot)

The dying Plug-In may have messed up GIMP's internal state.
You may want to save your images and restart GIMP
to be on the safe side.
----------------------------------------

I can't see how to get a backtrace though (If anyone can point me in the
right direction I'll be happy to provide since I can reproduce this
consistently).

As you can probably tell this is built under garnome-0.26.2. Version 1.3.21
worked fine.

[1] Rhythmbox in "small mode" (Approx 705x138 pixels) works fine
[2] Epiphany at around 1280x980 crashes the plugin, as does a GNOME
terminal at (Approx) 1024x768
Comment 1 Sven Neumann 2003-11-04 22:38:30 UTC
I cannot reproduce this problem. Windows up to the size of my screen
(1400x1050) are properly grabbed.

To get a stack trace from the crashing plug-in, you can run gdb on the
screenshot plug-in and attach to the plug-in process when the dialog
is up. Type 'c' at the gdb prompt to let the plug-in continue. Then,
when it crashed, type 'bt' to get a stack-trace.
Comment 2 lwillis 2003-11-05 10:25:48 UTC
Backtrace is less than useful :(

(gdb) bt
  • #0 rgb565lsb
    at gdkpixbuf-drawable.c line 438
  • #1 ??

I'm assuming I need to re-compile something with -ggdb, but any
suggestions of what? GTK? (Re-compiling everything will take a while
on my lowly PIII .... and just re-compiling the screenshot plugin
didn't help - I'm currently re-compiling the whole of GIMP with -g3 -ggdb)

Any suggestions and I'll go and re-build ...
Comment 3 Sven Neumann 2003-11-05 11:02:58 UTC
That actually looks quite useful already. You could install a package
of gtk+ with debugging information enabled. The crash seems to happen
in gdk-pixbuf which is part of gtk+.

What your stack trace unveils is that the problem could be located in
the conversion routines in gdk-pixbuf that are used when the X server
is not running in true color mode. This would also explain why the
problem doesn't appear on my system.
Comment 4 lwillis 2003-11-05 11:57:00 UTC
-------
That actually looks quite useful already. You could install a package
of gtk+ with debugging information enabled. The crash seems to happen
in gdk-pixbuf which is part of gtk+.
-------
OK - I'm re-building GTK now.

-------
What your stack trace unveils is that the problem could be located in
the conversion routines in gdk-pixbuf that are used when the X server
is not running in true color mode. This would also explain why the
problem doesn't appear on my system.
-------
Ah - then maybe my initial bug report was misleading. What I didn't
consider was that I recently changed monitor, and re-configured X, so
maybe this bug just didn't show in previous version of GIMP because of
my X setup. I'll try and confirm that either way as well ....
Comment 5 Sven Neumann 2003-11-05 12:10:17 UTC
Created attachment 21213 [details] [review]
patch that might fix the problem
Comment 6 Sven Neumann 2003-11-05 12:12:50 UTC
I would appreciate if you could apply the patch I just attached and
test if it cures the problem. I'm only guessing here but I found the
clipping code rather confusing. I've rewritten it in a way that is
easier to understand and thus more likely to be correct.
Comment 7 lwillis 2003-11-05 17:45:22 UTC
I've tried your patch, and unfortunately still get the same result :(

The problem definitely occurs within gdk_pixbuf_get_from_drawable
although at first glance we're passing sane arguments
(NULL,0x80f2c00,NULL,0,0,0,0,1280,942).

I've yet to get a decent backtrace though, or have chance to try
moving to truecolour and seeing if that helps. I'll update later ...
Comment 8 Sven Neumann 2003-11-05 17:59:47 UTC
It's almost certainly a GDK bug then. I will apply the patch anyway
since it makes the code more easier to understand. Removing the PATCH
keyword since the patch doesn't fix the reported problem.
Comment 9 lwillis 2003-11-05 18:03:32 UTC
Hmmm - switching to 24bpp from 16bpp stops the crash occuring. I'll
move this from being a GIMP bug - sorry for any confusion - and thanks
for the help ...
Comment 10 Sven Neumann 2003-11-05 18:09:02 UTC
gdk_pixbuf_get_from_drawable() is a GDK function, not part of
gdk-pixbuf. Changing the component accordingly. This bug was
originally reported against GIMP-1.3.22.
Comment 11 Matthias Clasen 2003-11-07 23:28:51 UTC
Created attachment 21287 [details]
test program
Comment 12 Matthias Clasen 2003-11-07 23:29:39 UTC
I couldn't reproduce this with the attached test program, running
against X servers of various depths. Can you ?
Comment 13 lwillis 2003-11-10 09:14:48 UTC
Yes.

Backtrace:

bt
  • #0 rgb555lsb
    at gdkpixbuf-drawable.c line 614
  • #1 ??

The values for x1 and y1 above seem to be completely screwy, for
reference I called the program as follows:

$ ./testbug 0x1600008 1002 776

Where the values are all taken from xwininfo ...
Comment 14 lwillis 2003-11-10 09:31:29 UTC
In case it helps I've added various debug statements and attached the
output. It should be fairly obvious where the debug's lie in the code.
Maybe this will help?
Comment 15 lwillis 2003-11-10 09:32:01 UTC
Created attachment 21326 [details]
Debug output
Comment 16 Owen Taylor 2003-11-11 21:24:12 UTC
Can you run the test under ElectricFence?

gdb testprog
(gdb) set env LD_PRELOAD=/usr/lib/libefence.so
(gdb) r
<watch it segfault>
(gdb) bt

I can't see any problem staring at the code or in
your debugging output.

The obviously unusual thing about your configuration is
using 555 rather than 565 - nobody really does that any more - 
but I don't see any obvious code portions where that would
make a difference, and it's good that someone is testing
the 555 code :-)

Please reopen from NEEDINFO when you add more information.
Comment 17 lwillis 2003-11-13 10:49:28 UTC
Hmm - the only additional output I seem to get is the following line:

614               register guint32 data = *s++;
(gdb) bt
  • #0 rgb555lsb
    at gdkpixbuf-drawable.c line 614
  • #1 ??

Does that help? 
Comment 18 Matthias Clasen 2003-11-13 13:00:47 UTC
Owen, the earlier backtraces further up show the same crash happening 
in rgb565lsb, so it is not 555-specific.
Comment 19 Soren Sandmann Pedersen 2004-02-02 15:52:34 UTC
lwillis, did you use any special flags when you compiled gtk+?
Apparently noone else than you can reproduce this bug.

Comment 20 lwillis 2004-02-02 18:25:30 UTC
Well - the bug still occurs with gimp 2.0pre2 compiled against garnome
0.29.1.  As far as I can see, the compile flags are:

-g -O2 -pipe

so fairly standard ...

Is there anything else I can do to help debug?
Comment 21 Soren Sandmann Pedersen 2004-02-02 21:32:58 UTC
Hmm, to me it looks the stack gets overwritten (broken trace, insane
parameters). 

Some things that might be helpful:

-   either see if the bug occurs when you run remotely on the X
    server that usually causes the crash, or recompile gdk 
    with --disable-shm

-   What happens when you run

            valgrind --num-callers=12 testprogram

-   recompile gdk without optimization and regenerate the backtrace

but it's all pretty much random guesses from me. Other guesses would
certainly be appreciated.

Comment 22 Mark McLoughlin 2004-03-24 07:52:30 UTC
*** Bug 117487 has been marked as a duplicate of this bug. ***
Comment 23 Mark McLoughlin 2004-03-24 07:56:36 UTC
The duplicate isn't very interesting, btw. Same reporter, same crash in the 565 code, different program.
Comment 24 Elijah Newren 2004-06-19 18:42:17 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 25 Matthias Clasen 2004-08-12 14:34:22 UTC
lwillis, did you try any of the proposals by Soeren ?
Comment 26 bugzilla 2004-08-25 17:49:25 UTC
Sorry for the delays, I've installed valgrind, and attached the valgrind output.
Comment 27 bugzilla 2004-08-25 17:51:11 UTC
Created attachment 30938 [details]
Valgrind output of valgrind --num-callers=12 ./testprogram 0x1e0000a 1006 779
Comment 28 Matthias Clasen 2005-05-09 05:39:36 UTC
Could the problem be unaligned accesses ? 
rgb565lsb (and many of the other 16bit functions) seems to cast a guint8* to a
guint16* and dereference the result....
Comment 29 Matthias Clasen 2014-03-24 03:11:51 UTC
closing out old bugs