imagemagick tools should be built without threading (or recursive mutexes fixed)

Bug #164533 reported by Domas Mituzas
4
Affects Status Importance Assigned to Milestone
imagemagick (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Imagemagick signal handlers, if compiled with pthread support, may enter recursive mutex locks.
This may lead to deadlock in single-threaded programs such as 'convert'.

Generally, either error checking mutexes have to be used (and crash horribly), or signal handlers simplified, or at least stand-alone tools compiled without pthread.

(gdb) bt
#0 0x00002aabb7776bd8 in __lll_mutex_lock_wait () from /lib/libpthread.so.0
#1 0x00002aabb7772ac8 in _L_mutex_lock_106 () from /lib/libpthread.so.0
#2 0x00002aabb7772423 in pthread_mutex_lock () from /lib/libpthread.so.0
#3 0x00002aabb5447cc5 in AcquireSemaphoreInfo () from /usr/lib/libMagick.so.9
#4 0x00002aabb544f185 in GetNextKeyInSplayTree () from /usr/lib/libMagick.so.9
#5 0x00002aabb5444141 in AsynchronousDestroyMagickResources () from /usr/lib/libMagick.so.9
#6 0x00002aabb54032e4 in ?? () from /usr/lib/libMagick.so.9
#7 <signal handler called>
#8 0x00002aabb7776bd8 in __lll_mutex_lock_wait () from /lib/libpthread.so.0
#9 0x00002aabb7772ac8 in _L_mutex_lock_106 () from /lib/libpthread.so.0
#10 0x00002aabb7772423 in pthread_mutex_lock () from /lib/libpthread.so.0
#11 0x00002aabb5447cc5 in AcquireSemaphoreInfo () from /usr/lib/libMagick.so.9
#12 0x00002aabb53ff111 in GetLocaleInfo_ () from /usr/lib/libMagick.so.9
#13 0x00002aabb53ff451 in GetLocaleMessage () from /usr/lib/libMagick.so.9
#14 0x00002aabb53db52d in GetLocaleExceptionMessage () from /usr/lib/libMagick.so.9
#15 0x00002aabb53db91d in ThrowMagickExceptionList () from /usr/lib/libMagick.so.9
#16 0x00002aabb53dbaba in ThrowMagickException () from /usr/lib/libMagick.so.9
#17 0x00002aabb5447c86 in AllocateSemaphoreInfo () from /usr/lib/libMagick.so.9
#18 0x00002aabb5447ce5 in AcquireSemaphoreInfo () from /usr/lib/libMagick.so.9
#19 0x00002aabb53ff111 in GetLocaleInfo_ () from /usr/lib/libMagick.so.9
#20 0x00002aabb53ff451 in GetLocaleMessage () from /usr/lib/libMagick.so.9
#21 0x00002aabb53db52d in GetLocaleExceptionMessage () from /usr/lib/libMagick.so.9
#22 0x00002aabb53db91d in ThrowMagickExceptionList () from /usr/lib/libMagick.so.9
#23 0x00002aabb53dbaba in ThrowMagickException () from /usr/lib/libMagick.so.9
#24 0x00002aabb535e958 in ?? () from /usr/lib/libMagick.so.9
#25 0x00002aabb535f158 in SetCacheNexus () from /usr/lib/libMagick.so.9
#26 0x00002aabb535f464 in GetCacheNexus () from /usr/lib/libMagick.so.9
#27 0x00002aabb536f42d in CompositeImage () from /usr/lib/libMagick.so.9
#28 0x00002aabb5456f13 in CoalesceImages () from /usr/lib/libMagick.so.9
#29 0x00002aabb5407460 in MogrifyImageList () from /usr/lib/libMagick.so.9
#30 0x00002aabb540c00b in MogrifyImages () from /usr/lib/libMagick.so.9
#31 0x00002aabb53830f4 in ConvertImageCommand () from /usr/lib/libMagick.so.9
#32 0x0000000000400cc2 in ?? ()
#33 0x00002aabb5b208e4 in __libc_start_main () from /lib/libc.so.6
#34 0x0000000000400b29 in ?? ()
#35 0x00007ffff59e44f8 in ?? ()
#36 0x0000000000000000 in ?? ()

Revision history for this message
Benjamin Mako Hill (mako) wrote :

Domas, can you explain on the bug what the upstream status of this bug is? Both for the record and for other people reading the bug and because I've forgotten. :)

Changed in imagemagick:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :

Could you please add more precision?

Bastien

Changed in imagemagick (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Domas Mituzas (domas-mituzas) wrote :

Excuse me, what do you want to have clarified?

Doesn't stack trace show you that there's a deadlock condition inside ImageMagick?
My fix is having it compiled without pthreads support.

Revision history for this message
broucaries (roucaries-bastien+bugs) wrote :

Sorry for the delay.

I means have you a test case ?

Bastien

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for imagemagick (Ubuntu) because there has been no activity for 60 days.]

Changed in imagemagick (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.