[Ubuntu] Python mapscript Segmentation fault

Frank Broniewski brfr at metrico.lu
Wed Feb 16 05:50:44 EST 2011


Hi Alan,

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. I didn't enable all 
the modules (--with-xyz) as in the packaged mapserver, I hope that isn't 
a problem.

Over on the mapserver list, someone wrote me:
> Am 14.02.2011 11:58, schrieb Eichner, Andreas - SID-NLKM:
> Hi,
>
> it looks like the Python MapScript module is compiled against a different regex libary than the Python interpreter uses. The "premature end of script headers" is usually caused by a SIGSEGV where the script gets killed before being able to send any headers. I would suggest to build python-mapscript on your own.
>
> HTH


Frank


Am 15.02.2011 17:11, schrieb Alan Boudreault:
> hi Frank,
>
> Would you be able to try to reproduce that bug using a manual installation of
> mapserver/python binding. I would be interrested to know if it's a packaging
> bug or not. It might be a swig binding bug.
>
> Thanks,
> Alan
>
> On February 15, 2011 10:05:02 am Frank Broniewski wrote:
>> 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.80583488
>> 5,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 at 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.
>>
>>
>>
>> Many thanks for help and tipps
>>
>>
>> Frank
>


-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu


More information about the Ubuntu mailing list