Infinite loop in mapserver::curve3_div::recursive_bezier with nan values drawing labels (reopened) #4908

Closed
dfuhry opened this Issue Apr 18, 2014 · 5 comments

Comments

Projects
None yet
2 participants
@dfuhry

dfuhry commented Apr 18, 2014

Opening this as a new issue because I can't reopen issue #3862 which was imported by mapserver-bot and subsequently closed for inactivity. More recently I reproduced on 6.2.1 and posted new stack trace and debug local variable output. The below is that recent information (but see original bug for older details).

Hi Thomas or other(s), I hit this bug again in 6.2.1 on Linux. I tried creating a simple single layer shapefile testcase but the bug failed to manifest itself there. It is somewhat fickle so I assume might be dependent on previous items in the label cache.

Below is a backtrace and following that, gdb's "info locals" output from frames 41 (msDrawLabelCache), 40 (msDrawText), and 39 (agg2RenderGlyphs). The first obvious appearance of nan values are in msDrawLabelCache's metrics_poly.bounds.{minx,miny,maxx,maxy} and metrics_points[*].{x,y}, and the second are in msDrawText's s.rotation, x, and y. Not sure which (if either) of these is necessarily the root problem of the subsequent (near?) infinite recursion / looping.

$ gdb --args ./mapserv-dbg "QUERY_STRING=map=...&mode=tile&tilemode=gmap&tile=5343+11909+15"
...
#0  0x00007ffff79dc1e1 in mapserver::curve3_div::recursive_bezier (this=0x7fffffffda78, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff), level=32) at renderers/agg/src/agg_curves.cpp:157
...
#31 0x00007ffff79dc648 in mapserver::curve3_div::recursive_bezier (this=0x7fffffffda78, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff), level=1) at renderers/agg/src/agg_curves.cpp:225
#32 0x00007ffff79dc648 in mapserver::curve3_div::recursive_bezier (this=0x7fffffffda78, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff), level=0) at renderers/agg/src/agg_curves.cpp:225
#33 0x00007ffff79dc714 in mapserver::curve3_div::bezier (this=0x7fffffffda78, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff)) at renderers/agg/src/agg_curves.cpp:235
#34 0x00007ffff79dc0f0 in mapserver::curve3_div::init (this=0x7fffffffda78, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff)) at renderers/agg/src/agg_curves.cpp:136
#35 0x00007ffff79e8288 in mapserver::curve3::init (this=0x7fffffffd9f8, x1=-nan(0xfffffffffffff), y1=-nan(0xfffffffffffff), x2=-nan(0xfffffffffffff), y2=-nan(0xfffffffffffff), 
    x3=-nan(0xfffffffffffff), y3=-nan(0xfffffffffffff)) at renderers/agg/src/../include/agg_curves.h:502
#36 0x00007ffff7ad8268 in mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>::vertex(double*, double*) ()
   from /usr/local/lib/libmapserver-6.2.1.so
#37 0x00007ffff7ad4d70 in mapserver::conv_transform<mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>, mapserver::trans_affine>::vertex(double*, double*) () from /usr/local/lib/libmapserver-6.2.1.so
#38 0x00007ffff7ad0d62 in void mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >::concat_path<mapserver::conv_transform<mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>, mapserver::trans_affine> >(mapserver::conv_transform<mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>, mapserver::trans_affine>&, unsigned int) () from /usr/local/lib/libmapserver-6.2.1.so
#39 0x00007ffff7ac790e in agg2RenderGlyphs (img=0x6082e0, x=-nan(0xfffffffffffff), y=-nan(0xfffffffffffff), style=0x7fffffffde50, text=0x6a6230 "SE McKinley Ave") at mapagg.cpp:377
#40 0x00007ffff79fd6d8 in msDrawText (image=0x6082e0, labelPnt=..., string=0x6a6230 "SE McKinley Ave", label=0x6a5fe0, fontset=0x6054e8, scalefactor=1) at maprendering.c:982
#41 0x00007ffff7ac60db in msDrawLabelCache (image=0x6082e0, map=0x605480) at mapdraw.c:3166
#42 0x00007ffff7ab8f45 in msDrawMap (map=0x605480, querymap=0) at mapdraw.c:488
#43 0x00007ffff7b67089 in msTileDraw (msObj=0x604040) at maptile.c:516
#44 0x00007ffff7b64cdb in msCGIDispatchImageRequest (mapserv=0x604040) at mapservutil.c:1459
#45 0x00007ffff7b657cf in msCGIDispatchRequest (mapserv=0x604040) at mapservutil.c:1690
#46 0x000000000040152c in main (argc=2, argv=0x7fffffffe5d8) at mapserv.c:259

(gdb) f 41
#41 0x00007ffff7ac60db in msDrawLabelCache (image=0x6082e0, map=0x605480) at mapdraw.c:3166
3166                    msDrawText(image, labelPtr->annopoint, labelPtr->annotext, labelPtr, &(map->fontset), layerPtr->scalefactor); /* actually draw the label */
Current language:  auto
The current source language is "auto; currently c".
(gdb) info locals
scalefactor = 1
size = 10
cacheslot = 0x605590
ll = 0
marker_offset_x = 0
value = 0x0
cachePtr = 0x65bed0
classPtr = 0x632c60
r = {minx = 1, miny = -11, maxx = 103, maxy = 1}
label_marker_line = {numpoints = 5, point = 0x7fffffffe0c0}
marker_offset_y = 0
label_offset_x = 0
i = -136395790
marker_poly = {numlines = 0, numvalues = 0, line = 0x7fffffffe1e0, values = 0x0, geometry = 0x0, renderer_cache = 0x0, bounds = {minx = -1, miny = -1, maxx = -1, maxy = -1}, type = 2, index = -1, 
  tileindex = -1, classindex = 0, text = 0x0, scratch = 0, resultindex = -1}
label_marker_points = {{x = 1.3505032603810789e-315, y = 6.9533490682342454e-310}, {x = 0, y = 0}, {x = 6.9531436082559572e-310, y = 0}, {x = 4.9406564584124654e-324, y = 6.953349175449949e-310}, 
  {x = 6.9533558074626765e-310, y = 6.9533491749792032e-310}}
metrics_poly = {numlines = 1, numvalues = 0, line = 0x7fffffffe1c0, values = 0x0, geometry = 0x0, renderer_cache = 0x0, bounds = {minx = -nan(0xfffffffffffff), miny = -nan(0xfffffffffffff), 
    maxx = -nan(0xfffffffffffff), maxy = -nan(0xfffffffffffff)}, type = 2, index = -1, tileindex = -1, classindex = 0, text = 0x0, scratch = 0, resultindex = -1}
label_offset_y = 0
labelPtr = 0x6a5fe0
label_mindistance = 1500
layerPtr = 0x6319b0
priority = 4
marker_line = {numpoints = 5, point = 0x7fffffffe110}
metrics_line = {numpoints = 5, point = 0x7fffffffe070}
l = 28
marker_points = {{x = 4.3971842479870942e-322, y = 6.9533451137324208e-310}, {x = 0, y = 6.953349175492241e-310}, {x = 6.9533558074508189e-310, y = 6.9533558074520046e-310}, {
    x = 4.2439882697144549e-314, y = 6.9533488423168494e-310}, {x = 3.115617487926568e-317, y = 6.9533451138746129e-310}}
label_marker_poly = {numlines = 0, numvalues = 0, line = 0x7fffffffe1d0, values = 0x0, geometry = 0x0, renderer_cache = 0x0, bounds = {minx = -1, miny = -1, maxx = -1, maxy = -1}, type = 2, 
  index = -1, tileindex = -1, classindex = 0, text = 0x0, scratch = 0, resultindex = -1}
metrics_points = {{x = -nan(0xfffffffffffff), y = -nan(0xfffffffffffff)}, {x = -nan(0xfffffffffffff), y = -nan(0xfffffffffffff)}, {x = -nan(0xfffffffffffff), y = -nan(0xfffffffffffff)}, {
    x = -nan(0xfffffffffffff), y = -nan(0xfffffffffffff)}, {x = -nan(0xfffffffffffff), y = -nan(0xfffffffffffff)}}
label_buffer = 0
nReturnVal = 0
__PRETTY_FUNCTION__ = "msDrawLabelCache"

(gdb) f 40
#40 0x00007ffff79fd6d8 in msDrawText (image=0x6082e0, labelPnt=..., string=0x6a6230 "SE McKinley Ave", label=0x6a5fe0, fontset=0x6054e8, scalefactor=1) at maprendering.c:982
982         return renderer->renderGlyphs(image,x,y,&s,string);
Current language:  auto
The current source language is "auto; currently c".
(gdb) info locals
s = {fonts = {0x618e10 "/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf", 0x0, 0x0, 0x0, 0x0}, numfonts = 1, size = 10, rotation = -nan(0xfffffffffffff), color = 0x6a5ff4, outlinewidth = 0, 
  outlinecolor = 0x0, antialias = -1}
renderer = 0x608650
x = -nan(0xfffffffffffff)
y = -nan(0xfffffffffffff)
nReturnVal = -1


(gdb) f 39
#39 0x00007ffff7ac790e in agg2RenderGlyphs (img=0x6082e0, x=-nan(0xfffffffffffff), y=-nan(0xfffffffffffff), style=0x7fffffffde50, text=0x6a6230 "SE McKinley Ave") at mapagg.cpp:377
377       glyphs.concat_path(trans_c);
Current language:  auto
The current source language is "auto; currently c++".
(gdb) info locals
trans_c = {m_source = 0x7fffffffd9e0, m_trans = 0x7fffffffdc80}
curfontidx = 0
fx = -nan(0xfffffffffffff)
r = 0x66df50
unicode = 83
m_curves = {m_source = 0x63ab28, m_last_x = -nan(0xfffffffffffff), m_last_y = -nan(0xfffffffffffff), m_curve3 = {m_curve_inc = {m_num_steps = 0, m_step = -1, m_scale = 1, 
      m_start_x = 2.4703282292062327e-323, m_start_y = 3.3369668023137799e-317, m_end_x = 5.2370958459172134e-322, m_end_y = 1.3486015868882666e-319, m_fx = 6.9533491548940514e-310, 
      m_fy = 3.3369668023137799e-317, m_dfx = 3.7020694570149609e-317, m_dfy = 3.3379154083537951e-317, m_ddfx = 3.3380735093604643e-317, m_ddfy = 3.9525251667299724e-323, 
      m_saved_fx = 4.5454039417394682e-322, m_saved_fy = 3.359741252324478e-317, m_saved_dfx = 3.2258692249273339e-317, m_saved_dfy = 3.0138004396316039e-322}, m_curve_div = {
      m_approximation_scale = 1, m_distance_tolerance_square = 0.25, m_angle_tolerance = 0, m_count = 0, m_points = {m_size = 1, m_num_blocks = 1, m_max_blocks = 64, m_blocks = 0x60c320, 
        m_block_ptr_inc = 64}}, m_approximation_method = mapserver::curve_div}, m_curve4 = {m_curve_inc = {m_num_steps = 0, m_step = -1, m_scale = 1, m_start_x = 9.8461219881341052e-312, 
      m_start_y = 3.2258692249273339e-317, m_end_x = 7.2500037626604419, m_end_y = 6.9533558073765114e-310, m_fx = 6.9533558073769067e-310, m_fy = 3.2258692249273339e-317, 
      m_dfx = 6.9533558073844165e-310, m_dfy = 6.953348861569896e-310, m_ddfx = 1.3910955607251939e-309, m_ddfy = 3.1298149583254621e-317, m_dddfx = 3.7004884469482689e-317, 
      m_dddfy = 3.1301944007414681e-317, m_saved_fx = 3.2258692249273339e-317, m_saved_fy = 3.2258455097763335e-317, m_saved_dfx = 2.1219957909652723e-314, m_saved_dfy = 3.3380142214829634e-317, 
      m_saved_ddfx = 3.6928837885274805e-317, m_saved_ddfy = 0}, m_curve_div = {m_approximation_scale = 1, m_distance_tolerance_square = 4.3458473798968777e-311, m_angle_tolerance = 0, 
      m_cusp_limit = 0, m_count = 0, m_points = {m_size = 0, m_num_blocks = 0, m_max_blocks = 0, m_blocks = 0x0, m_block_ptr_inc = 64}}, m_approximation_method = mapserver::curve_div}}
mtx = {sx = nan(0xfffffffffffff), shy = nan(0xfffffffffffff), shx = nan(0xfffffffffffff), sy = nan(0xfffffffffffff), tx = nan(0xfffffffffffff), ty = nan(0xfffffffffffff)}
fy = -nan(0xfffffffffffff)
utfptr = 0x6a6231 "E McKinley Ave"
glyphs = {m_vertices = {m_total_vertices = 2, m_total_blocks = 1, m_max_blocks = 256, m_coord_blocks = 0x60b310, m_cmd_blocks = 0x60bb10}, m_iterator = 0}
cache = 0x63a000
glyph = 0x71cdc0
@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Apr 18, 2014

Member

can you check with master/7.0 ? there's been a rewrite of the text handling in there and I wonder if it fails there to...

Member

tbonfort commented Apr 18, 2014

can you check with master/7.0 ? there's been a rewrite of the text handling in there and I wonder if it fails there to...

@dfuhry

This comment has been minimized.

Show comment
Hide comment
@dfuhry

dfuhry Nov 20, 2015

Yes, it fails with mapserver-7.0.0 too. A reproducible test case with a single shapefile and .map file is at:
https://www.dropbox.com/s/gctu8zh6i59kbdj/recursive_bezier_bug.zip?dl=0
(Sorry for the link, but github does not allow .zip attachments to comments.)
Extract the contents of that file and run:

MS_ERRORFILE=stderr MS_DEBUGLEVEL=5 gdb --args ./mapserv "QUERY_STRING=map=recursivebezier_bug.map&mode=map"

or omit the "gdb --args" to run without debugger. I get the output:

loadParams() QUERY_STRING: map=recursive_bezier_bug.map&mode=map
msLoadMap(): 0.011s
CGI Request 1 on process 18892
msDrawMap(): rendering using outputformat named AGG_PNG8 (AGG/PNG).
msSearchDiskTree(): Search returned no results. Unable to open spatial index for /home/dfuhry/mapserver_recursive_bug/./labels.qix. In most cases you can safely ignore this message, otherwise check file names and permissions.
msDrawMap(): Layer 0 (Labels), 0.048s
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)

and it hangs there. If I Ctrl+C there, the gdb backttrace is:

Program received signal SIGINT, Interrupt.
0x00007ffff7ab14b8 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
(gdb) bt
#0  0x00007ffff7ab14b8 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#1  0x00007ffff7ab1b27 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
...
#33 0x00007ffff7ab1bf0 in mapserver::curve3_div::bezier(double, double, double, double, double, double) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#34 0x00007ffff7ab13c0 in mapserver::curve3_div::init(double, double, double, double, double, double) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#35 0x00007ffff7a7f4ab in mapserver::curve3::init(double, double, double, double, double, double) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#36 0x00007ffff7a88da2 in mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4>::vertex(double*, double*) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#37 0x00007ffff7a83462 in void mapserver::rasterizer_scanline_aa<mapserver::rasterizer_sl_clip<mapserver::ras_conv_int> >::add_path<mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4> >(mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4>&, unsigned int) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#38 0x00007ffff7a79caa in agg2RenderGlyphsPath(imageObj*, textPathObj*, colorObj*, colorObj*, int) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#39 0x00007ffff7a39a91 in msDrawTextSymbol ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#40 0x00007ffff79e1bdb in msDrawLabelCache ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#41 0x00007ffff79d5b7b in msDrawMap ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#42 0x00007ffff794cba4 in msCGIDispatchImageRequest ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#43 0x00007ffff794d9af in msCGIDispatchRequest ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#44 0x0000000000401676 in main ()

dfuhry commented Nov 20, 2015

Yes, it fails with mapserver-7.0.0 too. A reproducible test case with a single shapefile and .map file is at:
https://www.dropbox.com/s/gctu8zh6i59kbdj/recursive_bezier_bug.zip?dl=0
(Sorry for the link, but github does not allow .zip attachments to comments.)
Extract the contents of that file and run:

MS_ERRORFILE=stderr MS_DEBUGLEVEL=5 gdb --args ./mapserv "QUERY_STRING=map=recursivebezier_bug.map&mode=map"

or omit the "gdb --args" to run without debugger. I get the output:

loadParams() QUERY_STRING: map=recursive_bezier_bug.map&mode=map
msLoadMap(): 0.011s
CGI Request 1 on process 18892
msDrawMap(): rendering using outputformat named AGG_PNG8 (AGG/PNG).
msSearchDiskTree(): Search returned no results. Unable to open spatial index for /home/dfuhry/mapserver_recursive_bug/./labels.qix. In most cases you can safely ignore this message, otherwise check file names and permissions.
msDrawMap(): Layer 0 (Labels), 0.048s
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)
setting outlinewidth to 1 (1, 10, 10)

and it hangs there. If I Ctrl+C there, the gdb backttrace is:

Program received signal SIGINT, Interrupt.
0x00007ffff7ab14b8 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
(gdb) bt
#0  0x00007ffff7ab14b8 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#1  0x00007ffff7ab1b27 in mapserver::curve3_div::recursive_bezier(double, double, double, double, double, double, unsigned int) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
...
#33 0x00007ffff7ab1bf0 in mapserver::curve3_div::bezier(double, double, double, double, double, double) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#34 0x00007ffff7ab13c0 in mapserver::curve3_div::init(double, double, double, double, double, double) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#35 0x00007ffff7a7f4ab in mapserver::curve3::init(double, double, double, double, double, double) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#36 0x00007ffff7a88da2 in mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4>::vertex(double*, double*) ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#37 0x00007ffff7a83462 in void mapserver::rasterizer_scanline_aa<mapserver::rasterizer_sl_clip<mapserver::ras_conv_int> >::add_path<mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4> >(mapserver::conv_curve<mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >, mapserver::curve3, mapserver::curve4>&, unsigned int) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#38 0x00007ffff7a79caa in agg2RenderGlyphsPath(imageObj*, textPathObj*, colorObj*, colorObj*, int) () from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#39 0x00007ffff7a39a91 in msDrawTextSymbol ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#40 0x00007ffff79e1bdb in msDrawLabelCache ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#41 0x00007ffff79d5b7b in msDrawMap ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#42 0x00007ffff794cba4 in msCGIDispatchImageRequest ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#43 0x00007ffff794d9af in msCGIDispatchRequest ()
   from /home/dfuhry/mapserver-7.0.0/build/libmapserver.so.2
#44 0x0000000000401676 in main ()

@tbonfort tbonfort self-assigned this Nov 22, 2015

tbonfort added a commit that referenced this issue Nov 22, 2015

Fix hang while rendering text on degenerate polygons (#4908)
center-of-gravity calculation was returning NaNs which in turn caused
agg's rasterizer to hang
@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Nov 22, 2015

Member

The interaction between our polygon clipper for features that barely intersect the image extent (causing vertices to lie exactly on the image border) and our geometry simplifier (discarding consecutive points if they are too close to one-another) causes degenerate geometries to be passed into further rendering steps. I've added a check so that these degenerate geometries don't cause the polygon labelling point calculation to return NaN values, but we will probably want to investigate further to disallow this to happen altogether.

Member

tbonfort commented Nov 22, 2015

The interaction between our polygon clipper for features that barely intersect the image extent (causing vertices to lie exactly on the image border) and our geometry simplifier (discarding consecutive points if they are too close to one-another) causes degenerate geometries to be passed into further rendering steps. I've added a check so that these degenerate geometries don't cause the polygon labelling point calculation to return NaN values, but we will probably want to investigate further to disallow this to happen altogether.

@tbonfort tbonfort closed this Nov 22, 2015

@tbonfort

This comment has been minimized.

Show comment
Hide comment
@tbonfort

tbonfort Nov 22, 2015

Member

A workaround to prevent the issue without applying the current patch is to set PROCESSING "APPROXIMATION_SCALE=full" at the layer level

Member

tbonfort commented Nov 22, 2015

A workaround to prevent the issue without applying the current patch is to set PROCESSING "APPROXIMATION_SCALE=full" at the layer level

@dfuhry

This comment has been minimized.

Show comment
Hide comment
@dfuhry

dfuhry Nov 26, 2015

Thomas, Great, thank you for the investigation, patch, and workaround.

dfuhry commented Nov 26, 2015

Thomas, Great, thank you for the investigation, patch, and workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment