GEOMTRANSFORM (buffer([shape],n)) + GetLegendGraphic -> Error 500 #5193

Closed
m431m opened this Issue Nov 2, 2015 · 12 comments

Projects

None yet

5 participants

@m431m
m431m commented Nov 2, 2015

Hi,

It appears that the Geomtransform directive in STYLE object is not working with GetLegendGraphic requests. It returns an error 500: ‘End of script output before headers: mapserv’.

There is no problem in GetMap.

I tried using master branch.

Regards,

m431m

@tbonfort
Member
tbonfort commented Nov 2, 2015

please include a testcase (mapfile + request)

@m431m
m431m commented Nov 2, 2015

Yep,

A minimal MAP:

MAP
  NAME "test"
  EXTENT -180 -90 180 90
  SIZE 600 400
  STATUS ON
  UNITS DD
  PROJECTION
    "init=epsg:4326"
  END
  WEB
    METADATA
      ows_enable_request "*"
    END
  END
  LAYER
    NAME "my_layer"
    TYPE POLYGON
    FEATURE
      POINTS -100 -60 -100 60 100 60 100 -60 -100 -60 END
    END
    STATUS ON
    CLASS
      NAME "legend"
      STYLE
        COLOR 255 0 0
        GEOMTRANSFORM (buffer([shape],-1))
      END
    END
  END
END

And the GetLegendGraphic request (basic):

http://hostname/cgi-bin/mapserv?map=/path/to/mapfile.map&version=1.3.0&service=WMS&request=GetLegendGraphic&sld_version=1.1.0&layer=my_layer&format=image/png&STYLE=default
@jratike80

This is how bug reports should be written!

I could repeat Internal server error within 5 minutes. Comment out GEOMTRANSFORM and GetLegendGraphic request is successful. Unfortunately I can't fix anything.

@tbonfort
Member
tbonfort commented Nov 2, 2015

assigning to @sdlime , the parser seems to be borking here:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7a72308 in msDrawTransformedShape (map=0x60d260, image=0x61a800, shape=0x7fffffffd830, style=0x616850, scalefactor=1)
    at /home/tbonfort/dev/mapserver/mapgeomtransform.c:193
193       switch (tmpshp->type) {
(gdb) bt
#0  0x00007ffff7a72308 in msDrawTransformedShape (map=0x60d260, image=0x61a800, shape=0x7fffffffd830, style=0x616850, scalefactor=1)
    at /home/tbonfort/dev/mapserver/mapgeomtransform.c:193
#1  0x00007ffff79a6053 in msDrawLegendIcon (map=0x60d260, lp=0x615070, theclass=0x616440, width=20, height=10, image=0x61a800, dstX=5,
    dstY=5, scale_independant=1, hittest=0x0) at /home/tbonfort/dev/mapserver/maplegend.c:268
#2  0x00007ffff79a80e6 in msDrawLegend (map=0x60d260, scale_independent=1, hittest=0x0) at /home/tbonfort/dev/mapserver/maplegend.c:692
#3  0x00007ffff7921036 in msWMSLegendGraphic (map=0x60d260, nVersion=66304, names=0x60c790, values=0x60cac0, numentries=8,
    wms_exception_format=0x0, ows_request=0x7fffffffe2e0, hittest=0x0) at /home/tbonfort/dev/mapserver/mapwms.c:4541
#4  0x00007ffff7922b7e in msWMSDispatch (map=0x60d260, req=0x60c750, ows_request=0x7fffffffe2e0, force_wms_mode=0)
    at /home/tbonfort/dev/mapserver/mapwms.c:4994
#5  0x00007ffff7931d1b in msOWSDispatch (map=0x60d260, request=0x60c750, ows_mode=-1) at /home/tbonfort/dev/mapserver/mapows.c:286
#6  0x00007ffff793f893 in msCGIDispatchRequest (mapserv=0x60c510) at /home/tbonfort/dev/mapserver/mapservutil.c:1711
#7  0x00000000004015ba in main (argc=2, argv=0x7fffffffe4b8) at /home/tbonfort/dev/mapserver/mapserv.c:275
(gdb) print status
$2 = 0
(gdb) print p
$4 = {pixel = 0x7ffff7fb9358, shape = 0x7fffffffd830, dblval = 3.1336014774351894e-317, dblval2 = 6.9533558074263132e-310,
  expr = 0x616858, type = 2, result = {intval = 0,
    strval = 0x3ff0000000000000 <error: Cannot access memory at address 0x3ff0000000000000>, shpval = 0x3ff0000000000000}}
(gdb)
@sdlime sdlime was assigned by tbonfort Nov 2, 2015
@rbovard
rbovard commented Feb 3, 2016

I'm also facing this issue after upgrading to MapServer 7. Do you have any plans to fix it?

@sdlime
Member
sdlime commented Feb 3, 2016

Yes, I will fix it... I'll have a look later today. --Steve

@sdlime
Member
sdlime commented Feb 4, 2016

I can create the segfault with non-WMS calls too:

http://hostname/cgi-bin/mapserv?map=/path/to/mapfile.map&mode=legend&layers=all

At least for me version 6.4 also err's out. @rbovard, what version were you upgrading from?

@sdlime
Member
sdlime commented Feb 4, 2016

Problem seems to be that the style expression has not been turned into tokens which normally happens as a result of msLayerWhichItems() being called.

@rbovard
rbovard commented Feb 5, 2016

At least for me version 6.4 also err's out. @rbovard, what version were you upgrading from?

From an old one: 6.0.1

@tbonfort
Member

backported to 6.4 in 4f7d463 , will be in 6.4.3

@tbonfort
Member

merged into branch-7-0 in 89965c1

@tbonfort tbonfort closed this Feb 23, 2016
@sdlime
Member
sdlime commented Feb 23, 2016

Thanks Thomas.

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