[Xastir-Dev] segfault for tiger maps

Alan Crosswell alan at columbia.edu
Sat Jun 21 17:31:21 EDT 2003


Go figure, another ImageMagick problem:-)  /var/tmp/xastir_alan_map.gif 
looks fine in kview.  This reproduces identically with 1.1.5 and 1.2.0.
Something changed in ImageMagick I guess.

/a

(gdb) run
Starting program: /home/alan/src/xastir-1.2.0/src/xastir
[New Thread 1085211744 (LWP 10277)]
festival_client: connect to server failed
SayText: Couldn't open socket to Festival

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1085211744 (LWP 10277)]
0x4207a7b0 in strnlen () from /lib/tls/libc.so.6
(gdb) where
#0  0x4207a7b0 in strnlen () from /lib/tls/libc.so.6
#1  0x420477d8 in vfprintf () from /lib/tls/libc.so.6
#2  0x4206a284 in vsnprintf () from /lib/tls/libc.so.6
#3  0x4045ddb5 in FormatString () from /usr/lib/libMagick-5.5.6-Q16.so.0
#4  0x403e1c7b in GetLocaleExceptionMessage ()
    from /usr/lib/libMagick-5.5.6-Q16.so.0
#5  0x403e17b4 in CatchException () from /usr/lib/libMagick-5.5.6-Q16.so.0
#6  0x403e1d5b in MagickWarning () from /usr/lib/libMagick-5.5.6-Q16.so.0
#7  0x080dd342 in draw_tiger_map (w=0x8311918) at maps.c:7858
#8  0x080a6167 in create_image (w=0x8311918) at main.c:2815
#9  0x080b18c8 in da_resize (w=0x8311918, client_data=0x0, call_data=0x0)
     at main.c:7073
#10 0x080b2890 in UpdateTime (clientData=0x8311918, id=0) at main.c:7542
#11 0x080ce88a in main (argc=1, argv=0xbfffdfc4) at main.c:22421
#12 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) frame 7
#7  0x080dd342 in draw_tiger_map (w=0x8311918) at maps.c:7858
7858            MagickWarning(exception.severity, exception.reason, 
exception.description);
(gdb) list
7853        (void)fclose (f);
7854
7855        image = ReadImage(image_info, &exception);
7856
7857        if (image == (Image *) NULL) {
7858            MagickWarning(exception.severity, exception.reason, 
exception.description);
7859            //fprintf(stderr,"MagickWarning\n");
7860            return;
7861        }
7862
(gdb) p image
$1 = (Image *) 0x0
(gdb)

----

tracing the function, everything looks good until ReadImage returns NULL 
and the exception values are trash.


...

(gdb)
7847        f = fopen (image_info->filename, "r");
(gdb)
7848        if (f == NULL) {
(gdb) p f
$8 = (FILE *) 0x8318948
(gdb) n
7853        (void)fclose (f);
(gdb)
7855        image = ReadImage(image_info, &exception);
(gdb) p image_info
$9 = (ImageInfo *) 0x8319968
(gdb) p *image_info
$10 = {compression = UndefinedCompression, temporary = 0, adjoin = 1,
   affirm = 0, antialias = 1, subimage = 0, subrange = 0, depth = 0,
   size = 0x0, tile = 0x0, page = 0x0, interlace = 16, endian = LSBEndian,
   units = UndefinedResolution, quality = 0,
   sampling_factor = 0x4b <Address DEFANGED_0x4b DEFANGED_out DEFANGED_of DEFANGED_bounds>, server_name = 0x0,
   font = 0x0, texture = 0x0, density = 0x0, pointsize = 0,
   fuzz = 5.3179411118795216e-315, pen = {blue = 0, green = 0, red = 65535,
     opacity = 65535}, background_color = {blue = 65535, green = 0,
     red = 57311, opacity = 57311}, border_color = {blue = 57311, green 
= 0,
     red = 48573, opacity = 48573}, matte_color = {blue = 48573, green = 0,
     red = 1, opacity = 0}, dither = 0, monochrome = 0,
   colorspace = UndefinedColorspace, type = UndefinedType,
   preview_type = UndefinedPreview, group = 0, ping = 0, verbose = 0,
   view = 0x0, authenticate = 0x0, attributes = 0x0, client_data = 0x0,
   cache = 0x0, stream = 0, file = 0x0, blob = 0x0, length = 0,
   magick = '\0' <repeats 2052 times>, unique = '\0' <repeats 2052 times>,
   zero = '\0' <repeats 2052 times>,
   filename = "/var/tmp/xastir_alan_map.gif", '\0' <repeats 2024 times>,
   signature = 0}
(gdb) n
7857        if (image == (Image *) NULL) {
(gdb) p image
$11 = (Image *) 0x0
(gdb) list
7852        }
7853        (void)fclose (f);
7854
7855        image = ReadImage(image_info, &exception);
7856
7857        if (image == (Image *) NULL) {
7858            MagickWarning(exception.severity, exception.reason, 
exception.description);
7859            //fprintf(stderr,"MagickWarning\n");
7860            return;
7861        }
(gdb) p exception
$12 = {reason = 0x1ae <Address DEFANGED_0x1ae DEFANGED_out DEFANGED_of DEFANGED_bounds>, description = 0x0,
   severity = 137485128, signature = 137489256}
(gdb) (gdb) n
7858            MagickWarning(exception.severity, exception.reason, 
exception.description);
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x4207a7b0 in strnlen () from /lib/tls/libc.so.6
(gdb)

/a





More information about the Xastir-dev mailing list