segmentation fault in convert

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
thx1138
Posts: 2
Joined: 2015-06-15T09:21:31-07:00
Authentication code: 6789

segmentation fault in convert

Post by thx1138 »

imagemagick 6.9.1.2-1 and 6.9.1.4-1 in Arch Linux

$ strace convert "icons/openscad.png" -resize 128x128\> "icons/openscad-128.png"

...
munmap(0x7f9aa1213000, 3149824) = 0
stat("/var/build/openscad-git/src/openscad", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
munmap(0x7f9aa185a000, 266240) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
tgkill(7001, 7001, SIGABRT) = 0
--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=7001, si_uid=1000} ---
+++ killed by SIGABRT (core dumped) +++
Aborted (core dumped)

"/var/build/openscad-git/src/openscad" is the current working directory.

Sorry, I don't see any way to attach the file here, but the image file is linked here:

https://github.com/openscad/openscad/bl ... enscad.png

James
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: segmentation fault in convert

Post by dlemstra »

Can you retry this with the latest beta? And I am unable to reproduce your issue on Windows.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: segmentation fault in convert

Post by glennrp »

I could not reproduce the problem with IM-6.9.1-3 or 6.9.1-5 on Ubuntu with libpng-1.6.17.
Run "convert -list format | grep PNG" to find out what libpng version you've got.
thx1138
Posts: 2
Joined: 2015-06-15T09:21:31-07:00
Authentication code: 6789

Re: segmentation fault in convert

Post by thx1138 »

Thanks for looking into this. After trying upgraded imagemagick and libpng with the same seg fault, I tried running convert on a different machine, and it ran fine. It would seem that convert is triggering some hardware bug on this one machine, or possibly some compiler bug, running on an AMD Phenom 8400 Triple-Core Processor, with "microcode: updated early to new patch_level=0x01000083".

I did see - exactly once - running convert, instead of the "Aborted (core dumped)", this:

LLVM ERROR: Cannot select: 0x1972680: i32,ch = AtomicLoadAdd 0x22cc140, 0x19caaa0, 0x19d5ff0<Volatile LDST4[%125(addrspace=1)]>
[ORD=3] [ID=12]
0x19caaa0: i32 = add 0x1c9e1d0, 0x1c9dd90 [ORD=2] [ID=11]
0x1c9e1d0: i32 = add 0x19da5a0, 0x1c99c40 [ORD=2] [ID=10]
0x19da5a0: i32,ch = CopyFromReg 0x22cc140, 0x1ceec70 [ORD=2] [ID=7]
0x1ceec70: i32 = Register %vreg65 [ID=1]
0x1c99c40: i32 = shl 0x1c9da60, 0x197fab0 [ORD=2] [ID=9]
0x1c9da60: i32,ch = CopyFromReg 0x22cc140, 0x1c99910 [ORD=2] [ID=8]
0x1c99910: i32 = Register %vreg61 [ID=2]
0x197fab0: i32 = Constant<4> [ID=3]
0x1c9dd90: i32 = Constant<8> [ID=4]
0x19d5ff0: i32 = Constant<1> [ID=5]
In function: Histogram

Is imagemagick somewhere running LLVM? And there is some problem with LLVM and AMD Phenom?

The only LLVM reference I could find in the imagemagick source was in the ChangeLog:

2011-10-04 6.7.2-10 Cristy <quetzlzacatenango@image...>
* Remove most of the LLVM compiler warnings.

For reference, running convert with "-debug All", ends with:

...
2015-06-16T18:06:20-06:00 0:00.000 0.000u 6.9.1 Coder convert[1452]: png.c/ReadPNGImage/3988/Coder
exit ReadPNGImage()
Aborted (core dumped)


James
Isaac
Posts: 1
Joined: 2015-10-15T00:16:18-07:00
Authentication code: 1151

Re: segmentation fault in convert

Post by Isaac »

FWIW I'm hitting this, too. I get the LLVM message every time.
Archlinux as well. AMD A10-5700 APU Trinity Quad Core. No clue how to look up microcode info.

$ convert --version
Version: ImageMagick 6.9.2-0 Q16 x86_64 2015-08-18 http://www.imagemagick.org


$ convert -list format | grep JPG
JPG* JPEG rw- Joint Photographic Experts Group JFIF format (80)


$ convert -resize 10%x10% DSC_31735.JPG ~/a
LLVM ERROR: Cannot select: 0x224e5f0: i32,ch = AtomicLoadAdd 0x217b580, 0x223b5e0, 0x2230fc0<Volatile LDST4[%119(addrspace=1)]> [ORD=11] [ID=30]
0x223b5e0: i32 = add 0x224fe18, 0x2095b80 [ORD=10] [ID=29]
0x224fe18: i32 = add 0x223b4b8, 0x18762e8 [ORD=10] [ID=28]
... [snip]
0x2095b80: i32 = Constant<8> [ID=9]
0x2230fc0: i32 = Constant<1> [ID=10]
In function: Histogram

Last few lines with the -debug All:
...[snip]...
2015-10-15T00:21:45-07:00 0:00.000 0.000u 6.9.2 Configure convert[28472]: locale.c/LoadLocaleCache/1176/Configure
Loading locale configure file "/usr/share/ImageMagick-6/english.xml" ...
2015-10-15T00:21:45-07:00 0:00.000 0.000u 6.9.2 Exception convert[28472]: constitute.c/ReadImage/501/Exception
no decode delegate for this image format `'
LLVM ERROR: Cannot select: 0x1989550: i32,ch = AtomicLoadAdd 0x2006f60, 0x19b0200, 0x223e720<Volatile LDST4[%119(addrspace=1)]> [ORD=11] [ID=30]
Post Reply