Opened 12 years ago

Last modified 12 years ago

#4247 new defect

msSymbolGetDefaultSize: Assertion error with svg symbol

Reported by: woodbri Owned by: tbonfort
Priority: normal Milestone: 6.2 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords:
Cc:

Description

While converting my mapfile from pixmap image symbols to svg symbols, I got an msSymbolGetDefaultSize: Assertion error.

Starting program: /usr/local/bin/mapserv QUERY_STRING='MAP=%2Fu%2Fdata%2Ftiger2011-maps%2Ftiger2011-tmp.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Tiger_2011&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=-10273139.285136,4127631.6973889,-10269795.165232,4130259.2201703&WIDTH=700&HEIGHT=550' > junk.png
[Thread debugging using libthread_db enabled]
warning: Lowest section in /usr/lib/libicudata.so.38 is .hash at 0000000000000120
[Wed Mar 14 00:03:10 2012].569989 msDrawMap(): rendering using outputformat named agg_qn (AGG/PNG).
[Wed Mar 14 00:03:10 2012].570260 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Wed Mar 14 00:03:10 2012].610705 msDrawMap(): Layer 2 (World Z2), 0.040s
[Wed Mar 14 00:03:10 2012].611664 msDrawMap(): Layer 3 (Forest), 0.001s
[Wed Mar 14 00:03:10 2012].612255 msDrawMap(): Layer 6 (Lakes Z2), 0.001s
[Wed Mar 14 00:03:10 2012].612775 msDrawMap(): Layer 7 (World Boundaries Z1), 0.000s
[Wed Mar 14 00:03:10 2012].644882 msDrawMap(): Layer 17 (state), 0.032s
[Wed Mar 14 00:03:10 2012].659690 msDrawMap(): Layer 18 (place), 0.015s
[Wed Mar 14 00:03:10 2012].661119 msDrawMap(): Layer 20 (area_landmarks), 0.001s
[Wed Mar 14 00:03:10 2012].661988 msDrawMap(): Layer 21 (military), 0.001s
[Wed Mar 14 00:03:10 2012].672141 msDrawMap(): Layer 23 (area_water), 0.010s
[Wed Mar 14 00:03:10 2012].674359 msDrawMap(): Layer 24 (linear_water), 0.002s
[Wed Mar 14 00:03:10 2012].686087 msDrawMap(): Layer 27 (rails), 0.012s
[Wed Mar 14 00:03:10 2012].810826 msDrawMap(): Layer 28 (roads), 0.125s
[Wed Mar 14 00:03:10 2012].813580 msDrawMap(): Layer 29 (point_landmarks), 0.003s
[Wed Mar 14 00:03:10 2012].813626 msDrawLabelCache(): labelcache_map_edge_buffer = 10
mapserv: mapsymbol.c:90: msSymbolGetDefaultSize: Assertion `s->svg_cairo_surface != ((void *)0)' failed.
[New Thread 0x7f62a0c9c710 (LWP 1723)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7f62a0c9c710 (LWP 1723)]
0x00007f629891aed5 in raise () from /lib/libc.so.6
(gdb) bt
#0  0x00007f629891aed5 in raise () from /lib/libc.so.6
#1  0x00007f629891c3f3 in abort () from /lib/libc.so.6
#2  0x00007f6298913dc9 in __assert_fail () from /lib/libc.so.6
#3  0x00007f62a088b3c5 in msSymbolGetDefaultSize (s=0x111a220)
    at mapsymbol.c:90
#4  0x00007f62a088d226 in msGetMarkerSize (symbolset=0x10a6c80,
    style=0x1285a60, width=0x7fff56c78368, height=0x7fff56c78360,
    scalefactor=0.20932263797212874) at mapsymbol.c:667
#5  0x00007f62a09101a8 in computeLabelMarkerPoly (map=0x10a6c50,
    img=0x10aa4f0, cachePtr=0x1134fb0, label=0x12857f0,
    markerPoly=0x7fff56c784e0) at mapdraw.c:2620
#6  0x00007f62a0910f06 in msDrawLabelCache (image=0x10aa4f0, map=0x10a6c50)
    at mapdraw.c:2834
#7  0x00007f62a090511d in msDrawMap (map=0x10a6c50, querymap=0)
    at mapdraw.c:493
#8  0x00007f62a08f4278 in msWMSGetMap (map=0x10a6c50, nVersion=65793,
    names=0x10a5940, values=0x10a5c70, numentries=13,
    wms_exception_format=0x10a6980 "application/vnd.ogc.se_inimage",
    ows_request=0x7fff56c78ae0) at mapwms.c:4025
#9  0x00007f62a08f8ddb in msWMSDispatch (map=0x10a6c50, req=0x10a5900,
    ows_request=0x7fff56c78ae0, force_wms_mode=0) at mapwms.c:5443
#10 0x00007f62a0935662 in msOWSDispatch (map=0x10a6c50, request=0x10a5900,
    ows_mode=-1) at mapows.c:275
#11 0x00007f62a0998fea in msCGIDispatchRequest (mapserv=0x10a56c0)
    at mapservutil.c:1631
#12 0x00000000004012ed in main (argc=2, argv=0x7fff56c78cb8) at mapserv.c:201
(gdb)
(gdb) up 3
#3  0x00007f62a088b3c5 in msSymbolGetDefaultSize (s=0x111a220)
    at mapsymbol.c:90
90          assert(s->svg_cairo_surface != NULL);
(gdb) p *s
$1 = {name = 0x1106090 "U", type = 1006, inmapfile = 0, map = 0x0, sizex = 1,
  sizey = 1, minx = 0, miny = 0, maxx = 0, maxy = 0, points = {{x = 0,
      y = 0} <repeats 100 times>}, refcount = 1, numpoints = 0, filled = 0,
  anchorpoint_x = 0.5, anchorpoint_y = 0.5, renderer = 0x0,
  pixmap_buffer = 0x0, renderer_cache = 0x0, full_font_path = 0x0,
  full_pixmap_path = 0x10e2b50 "/u/data/tiger2011-maps/etc/svg/U-blank.svg",
  svg_cairo_surface = 0x0, imagepath = 0x10db170 "svg/U-blank.svg",
  transparent = 0, transparentcolor = 0, character = 0x0, antialias = 0,
  font = 0x0,
  svg_text = 0x111a930 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448)  -->\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w"...}
(gdb)

Change History (1)

comment:1 by woodbri, 12 years ago

Here is a patch that fixes this problem:

Index: mapsymbol.c
===================================================================
--- mapsymbol.c (revision 13252)
+++ mapsymbol.c (working copy)
@@ -663,6 +663,15 @@
       if (MS_SUCCESS != msPreloadImageSymbol(MS_MAP_RENDERER(symbolset->map), symbol))
          return MS_FAILURE;
   }
+  else if (symbol->type == MS_SYMBOL_SVG && !symbol->svg_cairo_surface) {
+#ifdef USE_SVG_CAIRO
+      if(MS_SUCCESS != msPreloadSVGSymbol(symbol))
+          return MS_FAILURE;
+#else
+      msSetError(MS_SYMERR, "SVG symbol support is not enabled.", "msGetMarkerSize()");
+      return MS_FAILURE;
+#endif
+  }
   if(style->size == -1) {
       size = ( msSymbolGetDefaultSize(symbol) * scalefactor );
   }
Note: See TracTickets for help on using tickets.