Opened 12 years ago

Last modified 12 years ago

#4189 assigned defect

Occasional segmentation fault with AGG/PNG driver

Reported by: cnieman Owned by: tbonfort
Priority: normal Milestone:
Component: AGG Version: 6.0
Severity: normal Keywords:
Cc: zjames

Description

I've reproduced this problem with MapServer 5.6.7, 5.6.8 and 6.0.2. Strangely, when using MapServer compiled with -enable_debug, the problem doesn't happen. Not sure if this is relevant, but I tried using libpng 1.2.35 (because this is the version of libpng I used with MS 5.6.5, which doesn't have problems with the test area) and 1.2.46.

I was getting some scales at certain locations where the map wasn't drawing (getting Internal Server Errors from Apache, segmentation faults when run on the command line). If I panned a little bit, or zoomed in in OpenLayers, it would draw. Also, changing the line width to a value of 1.5 or greater seems to fix the problem.

I set OpenLayers up to tile on the fly, and was able to get the example area as the only pink tile in a given map extent.

The configuration and URL with query string that reproduces the Internal Server Error are in the attached txt file.

Attachments (3)

test.zip (135.2 KB ) - added by cnieman 12 years ago.
sample mapfile and data
configure.txt (1.1 KB ) - added by cnieman 12 years ago.
configure and query string
test2.zip (44.7 KB ) - added by cnieman 12 years ago.
new example

Download all attachments as: .zip

Change History (12)

by cnieman, 12 years ago

Attachment: test.zip added

sample mapfile and data

by cnieman, 12 years ago

Attachment: configure.txt added

configure and query string

comment:1 by tbonfort, 12 years ago

Component: MapServer C LibraryAGG
Owner: changed from sdlime to tbonfort
Status: newassigned

comment:2 by tbonfort, 12 years ago

unable to reproduce, please provide a backtrace of the crash.

comment:3 by cnieman, 12 years ago

This is what I got from GDB with a non-debug binary (as the debug binary drew the map properly):

Program received signal SIGSEGV, Segmentation fault. 0x001e3be9 in void mapserver::render_scanlines<mapserver::rasterizer_scanline_aa<mapserver::rasterizer_sl_clip<mapserver::ras_conv_int> >, mapserver::scanline_u8, mapserver::renderer_scanline_aa_solid<mapserver::renderer_base<mapserver::pixfmt_alpha_blend_rgba<mapserver::blender_rgba_pre<mapserver::rgba8, mapserver::order_bgra>, mapserv_row_ptr_cache<int>, int> > > >(mapserver::rasterizer_scanline_aa<mapserver::rasterizer_sl_clip<mapserver::ras_conv_int> >&, mapserver::scanline_u8&, mapserver::renderer_scanline_aa_solid<mapserver::renderer_base<mapserver::pixfmt_alpha_blend_rgba<mapserver::blender_rgba_pre<mapserver::rgba8, mapserver::order_bgra>, mapserv_row_ptr_cache<int>, int> > >&) ()

from /opt/fgs-ms5.6.8/lib/libmapserver.so

I'm going to try on a different system to see if it's maybe something specific on mine. I'm running Fedora 15.

comment:4 by cnieman, 12 years ago

Compiled with -g -O2 CFLAGS (since just -g didn't crash) and got the following backtrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
sweep_scanline<mapserver::scanline_u8> (ras=..., sl=..., ren=...)
    at renderers/agg/include/agg_rasterizer_scanline_aa.h:255
255	                        if(cur_cell->x != x) break;
(gdb) bt
#0  sweep_scanline<mapserver::scanline_u8> (ras=..., sl=..., ren=...)
    at renderers/agg/include/agg_rasterizer_scanline_aa.h:255
#1  mapserver::render_scanlines<mapserver::rasterizer_scanline_aa<mapserver::rasterizer_sl_clip<mapserver::ras_conv_int> >, mapserver::scanline_u8, mapserver::renderer_scanline_aa_solid<mapserver::renderer_base<mapserver::pixfmt_alpha_blend_rgba<mapserver::blender_rgba_pre<mapserver::rgba8, mapserver::order_bgra>, mapserver::row_accessor<unsigned char>, unsigned int> > > > (ras=..., sl=..., 
    ren=...) at renderers/agg/include/agg_renderer_scanline.h:444
#2  0x08157140 in agg2RenderLine (img=0x81e0310, p=0xbfffeab4, 
    style=0xbfffe628) at mapagg.cpp:224
#3  0x08110688 in msDrawLineSymbol (symbolset=0x81dd914, image=0x81e0310, 
    p=0xbfffeab4, style=0x81e5c18, scalefactor=1) at maprendering.c:446
#4  0x080ace80 in msDrawShape (map=0x81dd8f0, layer=0x81e4ef0, 
    shape=0xbfffeab4, image=0x81e0310, style=-1, querymapMode=0)
    at mapdraw.c:1946
#5  0x080af0b6 in msDrawVectorLayer (map=0x81dd8f0, layer=0x81e4ef0, 
    image=0x81e0310) at mapdraw.c:964
#6  0x080afb59 in msDrawLayer (map=0x81dd8f0, layer=0x81e4ef0, image=0x81e0310)
    at mapdraw.c:728
#7  0x080b0ee7 in msDrawMap (map=0x81dd8f0, querymap=0) at mapdraw.c:422
#8  0x0813b4a0 in msWMSGetMap (map=0x81dd8f0, nVersion=65793, names=0x81dcf00, 
    values=0x81dd098, numentries=11, wms_exception_format=0x0, 
    ows_request=0xbfffee28) at mapwms.c:2900

This was with the MapServer 6.0.2 release source code, compiled in an FGS environemnt on Ubuntu 10.04 32-bit. I've refined the example to just the shape on which it seems to be failing. I have this same problem happening on many different maps that worked with 5.6.5, though.

by cnieman, 12 years ago

Attachment: test2.zip added

new example

comment:5 by tbonfort, 12 years ago

Still not reproducible with a fresh compile of 6.0.2 (./configure --with-proj) without FGS

is the problem still present if you add

PROCESSING "APPROXIMATION_SCALE=full"

?

comment:6 by cnieman, 12 years ago

Yes, it does. I will try building outside of FGS, with system libraries. Maybe the problem lies elsewhere.

comment:7 by cnieman, 12 years ago

My test using system libraries yielded the same results.

I think it's only happening on 32-bit systems. I just built on a 64-bit Ubuntu system and it works properly.

comment:8 by cnieman, 12 years ago

We can give you access to the 32-bit machine I've been testing on, if it'd help.

comment:9 by zjames, 12 years ago

Cc: zjames added
Note: See TracTickets for help on using tickets.