Opened 14 years ago

Closed 8 years ago

#9 closed defect (invalid)

Python mapscript Segmentation fault with SWIG Parameter

Reported by: brfr Owned by: aboudreault
Component: MapServer Severity: normal
Keywords: Python mapscript SWIG OWSRequest Cc:

Description

Hi,

I have a problem with python mapscript concerning the OWSRequest. Whenever I pass an URL to setParameter and call OWSDispatch(request) mapscript crashes with a segfault. A small snippet for testing:

request = mapscript.OWSRequest() request.setParameter('LAYERS','post') request.setParameter('SLD', 'http://192.168.0.111/sld/style.sld') request.setParameter('FORMAT','image/png') request.setParameter('SERVICE','WMS') request.setParameter('VERSION','1.1.1') request.setParameter('REQUEST','GetMap') request.setParameter('STYLES',) request.setParameter('EXCEPTIONS','application/vnd.ogc.se_inimage') request.setParameter('SRS','EPSG:2169') request.setParameter('BBOX','64757.194165115,66551.046310101,89442.805834885,83748.953689899') request.setParameter('WIDTH','1399') request.setParameter('HEIGHT','975')

map = mapscript.mapObj('/usr/local/mapconf/share/osm.map') map.OWSDispatch(request)

Map debug level is 5, console output is: brfr@E033:/usr/local/www$ python ows_test.py Content-type: image/png

Segmentation fault

I am using the following sources: deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu hardy main deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu hardy main

Whenever I pass the request to the mapserver cgi all works as expected. It seems the parameter parser for python mapscript uses another parser than cgi-mapserver. Using urllib.quote, urllib.quote_plus doesn't help any further.

I did a

apt-get build-dep python-mapscript

and downloaded the latest mapserver source from mapserver.org (5.6.6). In the mapserver source directory:

./configure --enable-debug --with-ogr --with-gdal with-wfs make

then I went into the mapscript/python directory and did a python setup.py build

I copied my test script into the mapscript directory, renamed mapscript.py (the module) to mapscript2.py just to avoid importing the wrong module and did my test again (with import mapscript2 as mapscript) - and I get some binaryish characters back on the console, so I can report that it works with a self compiled version.

See http://lists.osgeo.org/pipermail/ubuntu/2011-February/000341.html and http://osgeo-org.1803224.n2.nabble.com/WMS-SLD-Troubles-td5999937.html for a report discussion

Frank

Change History (1)

comment:1 by Bas Couwenberg, 8 years ago

Resolution: invalid
Status: newclosed

Apparently nobody handles Trac tickets. Closing this ancient issue as the Ubuntu release in question is EOL.

Note: See TracTickets for help on using tickets.