Bugzilla – Bug 693578
graphics/ImageMagick: crash in DrawImage when localized and after SetStrokeColor
Last modified: 2014-11-08 17:27:18 UTC
Program received signal SIGSEGV, Segmentation fault. TraceBezier (primitive_info=0x7ffff4d14840, number_coordinates=<value optimized out>) at magick/draw.c:5076 I am going to work on this bug myself. Test case follows. Aside: Please build IM for 11.4 too (I need -debugsource to get the full backtrace). /* .NAME wlb \- expose a locale-related bug in MagickWand * .SH SYNOPSIS * LANG=pl_PL.utf8 gdb wlb * .SH BUGS * The program crashes with segmentation violation when $LANG == pl_PL.utf8 * */ #define TRIGGER_CRASH /* undef to inhibit the crash */ #include <stdlib.h> #include <stdio.h> #include <locale.h> #include <assert.h> #include <string.h> #include <ImageMagick/wand/MagickWand.h> struct stdnames { char t_locale [07], t_write [06], t_spawn [05], t_empty [01]; } const sc_stdnames = { "locale", "write", "spawn" }; static void handle_Magick_error (MagickWand *p_wand) /* Writes an error message to the standard error */ { ExceptionType a_sev; register char *const a_descr = MagickGetException (p_wand, &a_sev); if (0 > fprintf (stderr, "%s %s %lu %s", GetMagickModule (), a_descr)) { perror (sc_stdnames. t_write); } MagickRelinquishMemory (a_descr); } /* !handle_Magick_error X */ int main (int p_arg_count, char const *const p_args []) /* * Fills the form with predefined strings. * The form has four pages and the strings are placed on subsequent pages in order. */ { register int a_code = +EXIT_FAILURE; if (setlocale (LC_ALL, "") == NULL) perror (sc_stdnames. t_locale); MagickWandGenesis (); { register MagickWand *const a_wand = NewMagickWand (); if (MagickReadImage (a_wand, "canvas:white") == MagickTrue) /* ?READ_IMAGE_SUCCEEDED Y */ { register DrawingWand *const a_draw = NewDrawingWand (); register PixelWand *const a_px = NewPixelWand (); /* .H2 FORM DATA */ static unsigned char const sc_message [] = "BUG!"; PixelSetHSL (a_px, 0, 0, 0); #ifdef TRIGGER_CRASH DrawSetStrokeColor (a_draw, a_px); #endif DrawAnnotation (a_draw, 0, 0, sc_message); if (MagickDrawImage (a_wand, a_draw) != MagickTrue) handle_Magick_error (a_wand); DestroyPixelWand (a_px); DestroyDrawingWand (a_draw); } else /* ?READ_IMAGE_SUCCEEDED N */ handle_Magick_error (a_wand); /* ?READ_IMAGE_SUCCEEDED */ DestroyMagickWand (a_wand); } MagickWandTerminus (); if (fflush (stdout) < 0) { perror (sc_stdnames. t_write); return +EXIT_FAILURE; } else return +a_code; }
Hmm I cannot reproduce this bug.
> Aside: Please build IM for 11.4 too (I need -debugsource to get the full > backtrace). Done today morning.
Which version of ImageMagick do you use?
reassign
Post by magick ยป 2011-05-18T19:00:51-07:00 We'll use strtod_l() and specify the C locale in ImageMagick 6.6.9-10 Beta to fix the problem you reported.