[mapserver-dev] segfault in label repeat code

Thomas Bonfort thomas.bonfort at camptocamp.com
Sun Nov 8 09:01:32 EST 2009


hi,
this one is probably for Alan,
I'm getting a segfault in mapprimitive.c (my layers dont use repeatdistance):

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000105dffff8
0x000000010007fd1c in msPolylineLabelPointLineString
(p=0x7fff5fbfeac0, min_length=-1, repeat_distance=0,
angles=0x7fff5fbfea30, lengths=0x7fff5fbfea28,
segment_lengths=0x101282220, line_index=0, line_length=0,
total_length=0, segment_index=0, labelpoints_index=0x7fff5fbfe63c,
labelpoints_size=0x7fff5fbfe638, labelpoints=0x7fff5fbfe610,
center_on_longest_segment=0) at mapprimitive.c:1484
1484            t = 1 - (fwd_length - point_position) / segment_lengths[i][j-1];


(gdb) print i
$1 = 0
(gdb) print j
$2 = 0
>>> something fishy here, as the code tries to access segment_lengths[i][j-1];


(gdb) bt
#0  0x000000010007fd1c in msPolylineLabelPointLineString
(p=0x7fff5fbfeac0, min_length=-1, repeat_distance=0,
angles=0x7fff5fbfea30, lengths=0x7fff5fbfea28,
segment_lengths=0x101282220, line_index=0, line_length=0,
total_length=0, segment_index=0, labelpoints_index=0x7fff5fbfe63c,
labelpoints_size=0x7fff5fbfe638, labelpoints=0x7fff5fbfe610,
center_on_longest_segment=0) at mapprimitive.c:1484
#1  0x000000010007f7b2 in msPolylineLabelPointExtended
(p=0x7fff5fbfeac0, min_length=-1, repeat_distance=0,
angles=0x7fff5fbfea30, lengths=0x7fff5fbfea28,
numpoints=0x7fff5fbfea44, regularLines=0x1012fb830, numlines=1,
center_on_longest_segment=0) at mapprimitive.c:1387
#2  0x00000001000b811e in msDrawShape (map=0x10182b800,
layer=0x101262d10, shape=0x7fff5fbfeac0, image=0x10127c730, style=0,
querymapMode=1) at mapdraw.c:2004
#3  0x00000001000b2b9a in msDrawVectorLayer (map=0x10182b800,
layer=0x101262d10, image=0x10127c730) at mapdraw.c:1019
#4  0x00000001000b20af in msDrawLayer (map=0x10182b800,
layer=0x101262d10, image=0x10127c730) at mapdraw.c:809
#5  0x00000001000b1167 in msDrawMap (map=0x10182b800, querymap=0) at
mapdraw.c:455
#6  0x00000001000a6a99 in msWMSGetMap (map=0x10182b800,
nVersion=65793, names=0x10120bbb0, values=0x10120bed0, numentries=10)
at mapwms.c:2676
#7  0x00000001000aa23f in msWMSDispatch (map=0x10182b800,
req=0x10120bb80) at mapwms.c:3799
#8  0x0000000100107ae1 in msOWSDispatch (map=0x10182b800,
request=0x10120bb80, force_ows_mode=0) at mapows.c:67
#9  0x0000000100005f7a in main (argc=2, argv=0x7fff5fbff400) at mapserv.c:1262
(gdb) print point_position
$12 = 0
(gdb) print point_repeat
$13 = 1
(gdb) print l
$14 = 0
(gdb)



looking at the code, I also don't understand the usage of
center_on_longest_segment, as it seems to always be called with
MS_FALSE.

don't know if others can reproduce, but I'd say this is a blocker for
5.6 release.

regards,

thomas

www.camptocamp.com
+33 5 16 57 01 02


More information about the mapserver-dev mailing list