Page 1 of 1

Segmentation fault when using crop, inside display

Posted: 2008-03-20T07:30:15-07:00
by naoliv
Hi!

From this bug report on Debian http://bugs.debian.org/374631.
I can reproduce the described segmentation fault when using crop, inside display.

A test image can be obtained from http://www.vinc17.org/test/cwt.png
Steps to reproduce:
  • display cwt.png
  • Transform -> Crop
  • Select a region
  • Click on Crop
gdb backtrace is:

Code: Select all

(gdb) run cwt-firefox.png
Starting program: /usr/bin/display cwt-firefox.png
[Thread debugging using libthread_db enabled]
[New Thread 0xa77a66b0 (LWP 21671)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xa77a66b0 (LWP 21671)]
0xa7e5e8e3 in XMakeImageLSBFirst (resource_info=0xafba6060, 
    window=<value optimized out>, image=0x82aa168, ximage=0x82a9878, 
    matte_image=0x0) at magick/xwindow.c:6015
6015	magick/xwindow.c: No such file or directory.
	in magick/xwindow.c
(gdb) bt
#0  0xa7e5e8e3 in XMakeImageLSBFirst (resource_info=0xafba6060, 
    window=<value optimized out>, image=0x82aa168, ximage=0x82a9878, 
    matte_image=0x0) at magick/xwindow.c:6015
#1  0xa7e658d3 in XMakeImage (display=0x804e5b0, resource_info=0xafba6060, 
    window=0x828c1a4, image=0x8288a98, width=140, height=27)
    at magick/xwindow.c:5696
#2  0xa7d6b75c in XConfigureImage (display=0x804e5b0, 
    resource_info=0xafba6060, windows=0x828bcf8, image=0x8288a98)
    at magick/display.c:4380
#3  0xa7d6ee6e in XCropImage (display=0x804e5b0, resource_info=0xafba6060, 
    windows=0x828bcf8, image=0x8288a98, mode=CropMode) at magick/display.c:5288
#4  0xa7d75828 in XMagickCommand (display=0x804e5b0, resource_info=0xafba6060, 
    windows=0x828bcf8, command=CropCommand, image=0xafba5f94)
    at magick/display.c:7362
#5  0xa7d83baf in XDisplayImage (display=0x804e5b0, resource_info=0xafba6060, 
    argv=0x804a328, argc=2, image=0xafba8160, state=0xafba81ec)
    at magick/display.c:14848
#6  0xa7c7dcca in DisplayImageCommand (image_info=0x8059130, argc=2, 
    argv=0x804a328, wand_unused_metadata=0x0, exception=0x804a030)
    at wand/display.c:574
#7  0x080488ca in main (argc=2, argv=0xafba82e4) at utilities/display.c:128
(gdb)
ImageMagick version is 6.3.7-9

Thank you!

Re: Segmentation fault when using crop, inside display

Posted: 2008-03-20T09:56:27-07:00
by magick
The cwt.png image does not exist. Instead we tried with cwt-firefox.png and followed your recipe and no exceptions were thrown. We're using ImageMagick 6.3.9-9, the current release.

Re: Segmentation fault when using crop, inside display

Posted: 2008-03-20T14:09:17-07:00
by naoliv
Sorry for the wrong link (cwt.png instead cwt-firefox.png)
Indeed it's not crashing with the latest ImageMagick (using 3.6.9.10 beta here).
But I am getting an all transparent crop.

Using cwt-firefox.png, Transform -> Crop, selected region is 96X33+321+3 (that has the numbers 382 and 236 from the image) and then click on Crop. I get a transparent only image.

Re: Segmentation fault when using crop, inside display

Posted: 2008-03-20T18:14:12-07:00
by magick
We have a patch in ImageMagick 6.3.9-10 Beta to fix the problem you reported. In the mean-time try
  • display -page +0+0 cwt-firefox.png