python mapscript segfault

Howard Butler hobu at IASTATE.EDU
Thu Nov 9 08:30:30 EST 2006


On Nov 9, 2006, at 2:01 AM, Umberto Nicoletti wrote:

> On 11/9/06, John Cartwright <John.C.Cartwright at noaa.gov> wrote:
>> Hello All,
>>
>> I'm trying to use python mapscript (4.10.0) on MacOS 10.4 to create a
>> map dynamically and output the image.  Code seems to segfault at the
>> termination of the program. Can anyone see what I'm doing wrong or
>> suggest a method of tracing the problem?
>
> John,
> you are not doing anything wrong, simply mapsscript doesn't have
> properly implemented memory management so creating maps dinamically is
> not supported (even though it could work).
> I think in your case you should get the image correctly drawn anyway,
> so you could ignore the (annoying) segfault at program exit.

Umberto,

Creating maps dynamically is the entire point of MapScript. It very  
much supports the concept of creating maps dynamically.   IIRC, the  
code John has posted is right out of an example that Sean and I did  
for a workshop at OSG '05.  It may be that this example is no longer  
valid in 4.10 because of how the memory management has changed, but I  
wouldn't go so far as to say MapScript's memory management is  
outright implemented incorrectly.  There may be some issues, and it  
may be a little rough in areas, but it has been improving.

I suspect that the colorObjs of the styleObjs are not properly  
referencing the styleObj.  Running this script through gdb to get a  
traceback to find out which destructor is being called is what  
probably needs to be done.

Howard



More information about the mapserver-users mailing list