Opened 18 years ago

Last modified 17 years ago

#1946 closed defect

MapServer crashes in legend mode when works with long templates — at Version 13

Reported by: mcoladas@… Owned by: dmorissette
Priority: high Milestone: 5.0 release
Component: MapServer CGI Version: 4.10
Severity: major Keywords:
Cc:

Description (last modified by dmorissette)

The legend template option MapServer crashes in some cases. I atach a test case to reproduce (mapfile, legend template and url) this problem. The legend template of this test case shows 12 lines of text for layer. When i remove a line in the template MapServer works. It seems that when I put a lot of layers visibles in the legend, or layers with a lot of text content MapServer crashes.

Change History (15)

by mcoladas@…, 18 years ago

Attachment: test.tgz added

This file (*.tgz) include a legend template, a mapfile and a url of example

comment:1 by mcoladas@…, 18 years ago

attachments.mimetype: application/octet-streamapplication/x-gzip

comment:2 by mcoladas@…, 18 years ago

attachments.mimetype: application/x-gzipapplication/x-tar

comment:3 by mcoladas@…, 18 years ago

attachments.description: This file include a legend template, a mapfile and a url of exampleThis file (*.tgz) include a legend template, a mapfile and a url of example

comment:4 by sdlime, 18 years ago

Cc: mapserver-bugs@… added

comment:5 by sdlime, 18 years ago

Cc: dmorissette@… added

comment:6 by mcoladas@…, 18 years ago

blocked: 1945

comment:7 by mcoladas@…, 18 years ago

blocked: 1945

comment:8 by mcoladas@…, 18 years ago

*** Bug 1945 has been marked as a duplicate of this bug. ***

comment:9 by nfarrell@…, 17 years ago

I have replicated this bug and investigated a little:

with our map file and legends HTML template, no legend is generated. If many
layers are removed it renders correctly.

Working through the code: in generateLegendTemplate(...), it appears that
strcatalloc() is the problem: when it tries to append a 640byte string to
~6600byte pszResult string, it returns a NULL.

In my case, this occurs on the 10th iteration through the layers in the group,
at the strcatalloc(pszResult, legLayerHtmlCopy) command. 

by nfarrell@…, 17 years ago

Workaround for the legend crash bug

comment:10 by dmorissette, 17 years ago

Description: modified (diff)
Milestone: 5.0 release

comment:11 by sdlime, 17 years ago

Owner: changed from sdlime to mapserverbugs

Reassigning to the owners of the HTML legend code (I have enough bugs at the moment)...

Steve

comment:12 by dmorissette, 17 years ago

Owner: changed from mapserverbugs to dmorissette

Funny, I remembered about this issue and was surprised to not see this bug on my list yesterday. Taking it.

comment:13 by dmorissette, 17 years ago

Description: modified (diff)
Status: newassigned
Note: See TracTickets for help on using tickets.