multithread seg fault

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
blowzy
Posts: 8
Joined: 2011-12-20T12:04:44-07:00
Authentication code: 8675308

multithread seg fault

Post by blowzy » 2012-04-09T14:19:19-07:00

Seams that IM++ on my multithread application crash with Segmentation failt at this simple code:

Code: Select all

			
Magick::Image::Image img;
img.read( picturepath );
IM:
> convert -version
Version: ImageMagick 6.7.5-10 2012-04-03 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features:
disabled: threads and openmp (when compiled)
enabled: 16bit-pixel, bzlib, fftw, fpx, jbig, jpeg, jpeg2000, lcms2, lcms, lzma, lqr, perl, png, tiff, ttf, webp

System:
> uname -a
FreeBSD A0201 7.3-RELEASE-p2 FreeBSD 7.3-RELEASE-p2


Maybe any suggestion how to fix this? Maybe need to init some settings or variables for IM if I use it in multithread mode?
thanks

PS. On other FreeBSD version 8.2 and IM
#convert -version
Version: ImageMagick 6.7.3-4 2012-01-01 Q16
This code work well!
Last edited by blowzy on 2012-04-09T15:01:25-07:00, edited 2 times in total.

blowzy
Posts: 8
Joined: 2011-12-20T12:04:44-07:00
Authentication code: 8675308

Re: multithread seg fault

Post by blowzy » 2012-04-09T14:36:40-07:00

YOUR TEST

I run your thread unit tests from this my thread on the problem system (as I wrote above): viewtopic.php?f=23&t=20090

And result is:
> > ./imtest
Invalid null command.
Size: 500x332 / JPEG Blob-Length: 33087
Size: 170x134
Size: 188x138
Size: 188x138
Size: 188x126
Size: 178x124
Size: 174x132
Size: 188x134
Size: 170x138
Size: 174x130
Segmentation fault (core dumped)

User avatar
magick
Site Admin
Posts: 11095
Joined: 2003-05-31T11:32:55-07:00

Re: multithread seg fault

Post by magick » 2012-04-09T16:41:20-07:00

Can you get a stack trace? An alternative would be a minimal set of code and instructions so we can reproduce the fault.

blowzy
Posts: 8
Joined: 2011-12-20T12:04:44-07:00
Authentication code: 8675308

Re: multithread seg fault

Post by blowzy » 2012-04-10T01:04:05-07:00

Stack:
(gdb) fr 1
#1 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
whole stack
#0 0x482752ba in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#1 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#2 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#3 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#4 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#5 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#6 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#7 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#8 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#9 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#10 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#11 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#12 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#13 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#14 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#15 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#16 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#17 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#18 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#19 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#20 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#21 0x4827524f in SignatureImage () from /usr/local/lib/libMagickCore.so.5
#22 0x482757cd in ResetSplayTree () from /usr/local/lib/libMagickCore.so.5
---Type <return> to continue, or q <return> to quit---
#23 0x48276140 in GetNextValueInSplayTree ()
from /usr/local/lib/libMagickCore.so.5
#24 0x481fc699 in GetMagickInfo () from /usr/local/lib/libMagickCore.so.5
#25 0x481e9948 in SetImageInfo () from /usr/local/lib/libMagickCore.so.5
#26 0x48141898 in ImageToBlob () from /usr/local/lib/libMagickCore.so.5
#27 0x480d7b06 in Magick::Image::write () from /usr/local/lib/libMagick++.so.5
#28 0x08049690 in testthread ()
#29 0x486b07cc in pthread_getprio () from /lib/libthr.so.3
#30 0x00000000 in ?? ()
I have also tried to change the original test code and see that often its crashed when many threads work with "write" function.
when on the original test code 30, 31 lines are commented - its crashed less times, but can "hang".
Crashed always at SignatureImage ();

Maybe will try to install older IM version...
added: current version recompiled - does not help

blowzy
Posts: 8
Joined: 2011-12-20T12:04:44-07:00
Authentication code: 8675308

Re: multithread seg fault

Post by blowzy » 2012-04-14T13:48:48-07:00

any ideas?

Post Reply