[mapserver-users] FW: Segfaults with MapScript from Python

Jelmer Baas baas at speerit.nl
Wed Jun 24 23:41:25 PDT 2015


Hi all,

A crosspost between mapserver and gdal, since I have no idea where to look, now. 

The issue I wrote about below still exists, although I implemented a crappy workaround (when a label starts with a (, I add a . in front of it - yuck). 

There's another issue I found, though: I have a ogr_style column value with
LABEL(t:"1,2",a:295.800000,s:1.293854g,c:#ff0000,p:1,f:"ISOCP")
This is rendered as '1', instead of '1,2'. Replacing the comma with a period seems to work OK. Also quoting the string works:
LABEL(t:"'1,2'",a:295.800000,s:1.293854g,c:#ff0000,p:1,f:"ISOCP")

It seems both my issues are related to parsing of the OGR_STYLE column when using an ANNOTATION layer in MapServer. Is this a known issue? If not, can someone please tell me where to look to investigate? As I said before, I simply use the binaries for MapServer, so I'm not really that well versed in the 'code hacking'. I'd still be willing to jump into this, though, but I'd need some pointers on where to start, first.

Thanks,

Regards,
Jelmer


-----Original Message-----
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jelmer Baas
Sent: vrijdag 13 februari 2015 11:07
To: Dan Little
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Segfaults with MapScript from Python

Dan, List,

I've been messing around with this issue some more, and found the cause!

This record crashes MapScript is this (this is the ONLY record in the database now):
OID, geom, ogr_style
1234, POINT(620008 6697971), 'LABEL(t:"(0) test")'

The ONLY thing that matters is the OGR_STYLE clause - the (0) part. Replace the style with 'LABEL(t:".(0) test")' and all is well.

I attached my test scripts. Run simply with 'python test.py'.

Test-data:
CREATE TABLE testset
(
  oid oid,
  geom geometry,
  ogr_style character varying(350),
  filetype character(1)
)
Insert into testset(oid, geom, ogr_style) values (1234, '010100002031BF0D00F726AD90D0EB2241846601CDFC8C5941', 'LABEL(t:"(0) test")')

This single record crashes Python / MapScript with a lovely
" Segmentation fault (core dumped)".

Hopefully someone can debug this issue.

Regards,
Jelmer

-----Original Message-----
From: Dan Little [mailto:theduckylittle at gmail.com] 
Sent: donderdag 12 februari 2015 16:55
To: Jelmer Baas
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Segfaults with MapScript from Python

I don't see any debugging symbols in there making life a little bit
more difficult.

Is your Python code very complex? Could a useful snippet be posted to a gist?

On Thu, Feb 12, 2015 at 9:44 AM, Jelmer Baas <baas at speerit.nl> wrote:
> Hi List,
>
> Some of my automated renders are failing because Python crashes with an Segmentation fault. I've finally found at least some logs of this:
> Feb 12 16:16:19 vm-ctwrender07 kernel: [276759.889265] traps: python[8002] general protection ip:7f104ec4f50f sp:7fff17d8d790 error:0 in libmapserver.so.6.4.1[7f104eb91000+1d8000]
> Feb 12 15:08:01 vm-ctwrender07 kernel: [272664.046597] traps: python[7841] general protection ip:7f80558877b6 sp:7fff641f27c0 error:0 in libmapserver.so.6.4.1[7f80557c9000+1d8000]
> Feb 12 13:53:01 vm-ctwrender07 kernel: [268166.881041] python[7614]: segfault at fffffffffffffffc ip 00007f805588750f sp 00007fff641f27c0 error 5 in libmapserver.so.6.4.1[7f80557c9000+1d8000]
>
> Unfortunatly, I have no idea how to continue. I suspect this has something todo with odd font rendering (too large, too small), since I had issues with that before. Can someone match these addresses with code and find out where it crashes?
>
> Thanks in advance!
>
> Regards,
> Jelmer
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MapScript crash.zip
Type: application/x-zip-compressed
Size: 2262 bytes
Desc: MapScript crash.zip
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150625/6c0d3be2/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00001.txt
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150625/6c0d3be2/attachment.txt>


More information about the mapserver-users mailing list