BUG : annotate No Thread Safe
Posted: 2011-01-24T03:15:41-07:00
hi,
I'm using IM 6.6.7-1. I am trying to put text into image with the "annotate" method.
This code works well in a single threaded program but i have errors in multi-threaded program :
I'm using IM 6.6.7-1. I am trying to put text into image with the "annotate" method.
Code: Select all
image.modifyImage();
Color col("white");
image.fillColor(col);
image.fontPointsize(20);
std::string Font="-*-bitstream charter-medium-r-normal-*-*-*-*-*-*-*-iso8859-1";
image.font(Font);
image.modifyImage();
Geometry geo(0,0);
image.annotate(message, geo);
David==17172== Thread 2:
==17172== Invalid read of size 8
==17172== at 0xAE06B10: _XOpenLC (in /usr/lib/libX11.so.6.3.0)
==17172== by 0xAE06C07: _XlcCurrentLC (in /usr/lib/libX11.so.6.3.0)
==17172== by 0xAE06FF8: XSupportsLocale (in /usr/lib/libX11.so.6.3.0)
==17172== by 0x88CDCA7: XGetAnnotateInfo (xwindow.c:2885)
==17172== by 0x8763E76: RenderX11 (annotate.c:1906)
==17172== by 0x8767461: GetTypeMetrics (annotate.c:734)
==17172== by 0x8768931: AnnotateImage (annotate.c:236)
==17172== by 0x81B09CD: Magick::Image::annotate(std::string const&, Magick::Geometry const&, MagickCore::GravityType, double) (Image.cpp:451)
==17172== Address 0xfdc79b0 is 0 bytes inside a block of size 16 free'd
==17172== at 0x4C270BD: free (vg_replace_malloc.c:366)
==17172== by 0xAE069C7: _XCloseLC (in /usr/lib/libX11.so.6.3.0)
==17172== by 0xADFF5AB: ??? (in /usr/lib/libX11.so.6.3.0)
==17172== by 0xADEEECE: XrmCombineDatabase (in /usr/lib/libX11.so.6.3.0)
==17172== by 0x88CCCFD: XGetResourceDatabase (xwindow.c:3391)
==17172== by 0x87642D6: RenderX11 (annotate.c:1847)
==17172== by 0x8767461: GetTypeMetrics (annotate.c:734)
==17172== by 0x8768931: AnnotateImage (annotate.c:236)
==17172== by 0x81B09CD: Magick::Image::annotate(std::string const&, Magick::Geometry const&, MagickCore::GravityType, double) (Image.cpp:451)
==17172==
==17172== Invalid read of size 8
==17172== at 0xADC93CD: XFreeFont (in /usr/lib/libX11.so.6.3.0)
==17172== by 0x8763EA3: RenderX11 (annotate.c:1913)
==17172== by 0x8767461: GetTypeMetrics (annotate.c:734)
==17172== by 0x8768931: AnnotateImage (annotate.c:236)
==17172== by 0x81B09CD: Magick::Image::annotate(std::string const&, Magick::Geometry const&, MagickCore::GravityType, double) (Image.cpp:451)
==17172== Address 0x8 is not stack'd, malloc'd or (recently) free'd
==17172==
==17172==
==17172== Process terminating with default action of signal 11 (SIGSEGV)
==17172== Access not within mapped region at address 0x8
==17172== at 0xADC93CD: XFreeFont (in /usr/lib/libX11.so.6.3.0)
==17172== by 0x8763EA3: RenderX11 (annotate.c:1913)
==17172== by 0x8767461: GetTypeMetrics (annotate.c:734)
==17172== by 0x8768931: AnnotateImage (annotate.c:236)
==17172== by 0x81B09CD: Magick::Image::annotate(std::string const&, Magick::Geometry const&, MagickCore::GravityType, double) (Image.cpp:451)