Opened 13 years ago

Last modified 13 years ago

#3862 assigned defect

Infinite loop in mapserver::curve3_div::recursive_bezier with nan values drawing labels

Reported by: dfuhry Owned by: tbonfort
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords:
Cc:

Description

#0 mapserver::calc_sq_distance (x1=-nan(0x8000000000000),

y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000)) at renderers/agg/src/../include/agg_math.h:70

#1 0x0000000000599016 in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=30) at renderers/agg/src/agg_curves.cpp:216

#2 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=29) at renderers/agg/src/agg_curves.cpp:228

#3 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=28) at renderers/agg/src/agg_curves.cpp:227

#4 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=27) at renderers/agg/src/agg_curves.cpp:228

---Type <return> to continue, or q <return> to quit--- #5 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=26) at renderers/agg/src/agg_curves.cpp:227

#6 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=25) at renderers/agg/src/agg_curves.cpp:228

#7 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=24) at renderers/agg/src/agg_curves.cpp:228

#8 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=23) at renderers/agg/src/agg_curves.cpp:228

#9 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000),

---Type <return> to continue, or q <return> to quit---

x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=22) at renderers/agg/src/agg_curves.cpp:227

#10 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=21) at renderers/agg/src/agg_curves.cpp:228

#11 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=20) at renderers/agg/src/agg_curves.cpp:227

#12 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=19) at renderers/agg/src/agg_curves.cpp:227

#13 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=18) at renderers/agg/src/agg_curves.cpp:227

#14 0x00000000005990ea in mapserver::curve3_div::recursive_bezier ( ---Type <return> to continue, or q <return> to quit---

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=17) at renderers/agg/src/agg_curves.cpp:228

#15 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=16) at renderers/agg/src/agg_curves.cpp:228

#16 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=15) at renderers/agg/src/agg_curves.cpp:228

#17 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=14) at renderers/agg/src/agg_curves.cpp:227

#18 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=13)

---Type <return> to continue, or q <return> to quit---

at renderers/agg/src/agg_curves.cpp:228

#19 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=12) at renderers/agg/src/agg_curves.cpp:227

#20 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=11) at renderers/agg/src/agg_curves.cpp:228

#21 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=10) at renderers/agg/src/agg_curves.cpp:228

#22 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=9) at renderers/agg/src/agg_curves.cpp:227

#23 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000),

---Type <return> to continue, or q <return> to quit---

x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=8) at renderers/agg/src/agg_curves.cpp:228

#24 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=7) at renderers/agg/src/agg_curves.cpp:228

#25 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=6) at renderers/agg/src/agg_curves.cpp:228

#26 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=5) at renderers/agg/src/agg_curves.cpp:227

#27 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=4) at renderers/agg/src/agg_curves.cpp:227

---Type <return> to continue, or q <return> to quit--- #28 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=3) at renderers/agg/src/agg_curves.cpp:228

#29 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=2) at renderers/agg/src/agg_curves.cpp:227

#30 0x00000000005990ea in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=1) at renderers/agg/src/agg_curves.cpp:228

#31 0x00000000005990ac in mapserver::curve3_div::recursive_bezier (

this=0x7fffffffd848, x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000), level=0) at renderers/agg/src/agg_curves.cpp:227

#32 0x0000000000599178 in mapserver::curve3_div::bezier (this=0x7fffffffd848,

x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000),

---Type <return> to continue, or q <return> to quit---

x3=-nan(0x8000000000000), y3=-nan(0x8000000000000)) at renderers/agg/src/agg_curves.cpp:237

#33 0x0000000000598b54 in mapserver::curve3_div::init (this=0x7fffffffd848,

x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000)) at renderers/agg/src/agg_curves.cpp:136

#34 0x000000000055f922 in mapserver::curve3::init (this=0x7fffffffd7c8,

x1=-nan(0x8000000000000), y1=-nan(0x8000000000000), x2=-nan(0x8000000000000), y2=-nan(0x8000000000000), x3=-nan(0x8000000000000), y3=-nan(0x8000000000000)) at renderers/agg/include/agg_curves.h:502

#35 0x000000000056bd8c in mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>::vertex (

this=0x7fffffffd7b0, x=0x7fffffffd760, y=0x7fffffffd758) at renderers/agg/include/agg_conv_curve.h:168

#36 0x00000000005678d6 in mapserver::conv_transform<mapserver::conv_curve<mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>, mapserver::trans_affine>::vertex (this=0x7fffffffdab0,

x=0x7fffffffd760, y=0x7fffffffd758) at renderers/agg/include/agg_conv_transform.h:43

#37 0x00000000005631ce in mapserver::path_base<mapserver::vertex_block_storage<double, 8u, 256u> >::concat_path<mapserver::conv_transform<mapserver::conv_curve<---Type <return> to continue, or q <return> to quit--- mapserver::serialized_integer_path_adaptor<short, 6u>, mapserver::curve3, mapserver::curve4>, mapserver::trans_affine> > (this=0x7fffffffda80, vs=...,

path_id=0) at renderers/agg/include/agg_path_storage.h:726

#38 0x0000000000558cd7 in agg2RenderGlyphs (img=0x821a30,

x=-nan(0x8000000000000), y=-nan(0x8000000000000), style=0x7fffffffdc10, text=0x988020 "State Route 141") at mapagg.cpp:324

#39 0x000000000050586e in msDrawText (image=0x821a30, labelPnt=...,

string=0x988020 "State Route 141", label=0x8d59a0, fontset=0x81a3c8, scalefactor=1) at maprendering.c:826

#40 0x000000000048ec35 in msDrawLabelCache (image=0x821a30, map=0x81a360)

at mapdraw.c:2616

#41 0x0000000000483885 in msDrawMap (map=0x81a360, querymap=0) at mapdraw.c:475 #42 0x000000000041a550 in main (argc=2, argv=0x7fffffffe5c8) at mapserv.c:1407

Change History (3)

comment:1 by dfuhry, 13 years ago

gdb backtrace in description. One ugly fix is to guard against passing NaN values m_curve3.init in renderers/agg/include/agg_conv_curve.h. Hope there's enough information here for someone to implement a proper fix.

$ diff new/mapserver-6.0.0-rc1/renderers/agg/include/agg_conv_curve.h orig/mapserver-6.0.0-rc1/renderers/agg/include/agg_conv_curve.h 168,170c168 < if (!isnan(m_last_x) && !isnan(m_last_y) && !isnan(*x) && !isnan(*y) && !isnan(end_x) && !isnan(end_y)) < { < m_curve3.init(m_last_x, m_last_y, ---

m_curve3.init(m_last_x, m_last_y,

174,176c172,173 < m_curve3.vertex(x, y); First call returns path_cmd_move_to < m_curve3.vertex(x, y); This is the first vertex of the curve < } ---

m_curve3.vertex(x, y); First call returns path_cmd_move_to m_curve3.vertex(x, y); This is the first vertex of the curve

comment:2 by tbonfort, 13 years ago

Owner: changed from sdlime to tbonfort
Status: newassigned

comment:3 by tbonfort, 13 years ago

msDrawLabelCache is passing in nans to the renderers, so the problem is not only in the agg code.

Can you provide a test case that reproduces this please?

Note: See TracTickets for help on using tickets.