artemp/mapnik — Issue #253: crash in libagg when rendering extremely long lines
Author: artemp
Created: 2011-10-11 16:07:15+00:00
State: open
Labels: Core_Library

The mapnik render daemon on the OSM site has crashed a few times over the past week. It seems the problem is an infinite recursion inside the agg code when trying to draw an extremely long line segment.
{{{
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1107310928 (LWP 16821)]
0x00002b2e7b9fba31 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=1065848760, y2=0)
at /usr/include/agg2/agg_rasterizer_cells_aa.h:336
336 line(x1, y1, cx, cy);
Current language: auto; currently c++
(gdb) bt
#0 0x00002b2e7b9fba31 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=1065848760, y2=0)
at /usr/include/agg2/agg_rasterizer_cells_aa.h:336
#1 0x00002b2e7b9fba36 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=-794176447, y2=0)
at /usr/include/agg2/agg_rasterizer_cells_aa.h:336
#2 0x00002b2e7b9fba36 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=-219259565, y2=0)
...
thousands of stack frames later
...
#57896 0x00002b2e7b9fba36 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=-115527, y2=262144)
at /usr/include/agg2/agg_rasterizer_cells_aa.h:336
#57897 0x00002b2e7b9fba36 in agg::rasterizer_cells_aa::line (this=0x2aaab029e7c0, x1=-1369093329, y1=0, x2=1368862275, y2=524288)
at /usr/include/agg2/agg_rasterizer_cells_aa.h:336
#57898 0x00002b2e7b9fc03e in agg::rasterizer_sl_clip::line_clip_y > (this=0x2aaab029e838,
ras=@0x2aaab029e7c0, x1=0, y1=-2147402706, x2=524288, y2=2146742252, f1=8, f2=2) at /usr/include/agg2/agg_rasterizer_sl_clip.h:205
#57899 0x00002b2e7b9fc6ba in agg::rasterizer_sl_clip::line_to > (this=0x2aaab029e838,
ras=@0x2aaab029e7c0, x2=889537082, y2=752338992) at /usr/include/agg2/agg_rasterizer_sl_clip.h:289
#57900 0x00002b2e7b9fc83c in agg::rasterizer_scanline_aa >::close_polygon (this=0x2aaab029e7c0)
at /usr/include/agg2/agg_rasterizer_scanline_aa.h:372
#57901 0x00002b2e7b9fc996 in agg::rasterizer_scanline_aa >::add_vertex (this=0x2aaab029e7c0, x=-1825716.7351219044,
y=-5524682.447617433, cmd=111) at /usr/include/agg2/agg_rasterizer_scanline_aa.h:435
#57902 0x00002b2e7ba05321 in agg::rasterizer_scanline_aa >::add_path > >, agg::null_markers> > (this=0x2aaab029e7c0, vs=@0x41ff7b30, path_id=0)
at /usr/include/agg2/agg_rasterizer_scanline_aa.h:208
#57903 0x00002b2e7ba0e6c9 in mapnik::agg_renderer::process (this=0x41ff8180, sym=@0x2aaab05d5858, feature=@0x2aaab00064f0, prj_trans=@0x41ff7f50)
at src/agg_renderer.cpp:411
#57904 0x0000000000409d09 in mapnik::feature_style_processor >::apply_to_layer (this=0x41ff8180, lay=@0x2aaaac640dd0,
p=@0x41ff8180, proj0=, scale_denom=4265.4591677002636) at /usr/include/boost/variant/variant.hpp:1738
#57905 0x000000000040a301 in mapnik::feature_style_processor >::apply (this=0x2aaab029e7c0)
at /usr/local/include/mapnik/feature_style_processor.hpp:92
#57906 0x0000000000407ac8 in render (m=@0x41ff93e0, xmlname=0x2aaabc1a8e04 "Default", prj=@0x41ff94a0, x=78728, y=52568, z=17, size=8, tiles=@0x42002db0)
---Type to continue, or q to quit---
at gen_tile.cpp:250
#57907 0x00000000004081f8 in render_thread (arg=) at gen_tile.cpp:341
#57908 0x00002b2e7c95c317 in start_thread () from /lib/libpthread.so.0
#57909 0x00002b2e7c6ced5d in clone () from /lib/libc.so.6
#57910 0x0000000000000000 in ?? ()
(gdb)
}}}