Segmentation fault adding a new layer with php-mapscript (4.6beta3)

Bill Binko bill at BINKO.NET
Mon Jun 6 09:47:07 EDT 2005


On Mon, 6 Jun 2005, Nicol Hermann wrote:
> Hi List,
> i 'am trying to build a map from the scratch using php-mapscript and the
> lastest cvs version.
> Whenever i add a new layer with
> $Layer = ms_newLayerObj($map);
> I receive a segmentation fault.
> 
> gdb returns the following.
> Is this a bug?

I've tried your script, and don't get a segfault against CVS HEAD.  I have 
a couple of suggestions, but first, some questions:

1) Could you post your configure command line?  In particular, I'm
interested in your --with-php= and --with-php-regex-dir= parameters.

2) What is the output of 'ldd php_mapscript_45.so'

3) Why is php_mapscript.so renamed to _45.so?  I don't think this is a 
problem, but I'm curious.

As for the suggestions, try running configure without the
--with-php-regex-dir= parameter.  Then, a complete rebuild (make clean
all).

If you're running a binary, then it's likely that it is built with
the wrong choice of regex, and you'll need to rebuild or find another
binary.

Basically, the configure script detects whether the local PHP uses the 
system regex or the PHP builtin version.  It always has, it just does so 
without the PHP source now.  The --with-php-regex-dir paramater was used 
to point to the PHP source, but it should not be needed anymore.

BTW, this is just a guess, but most of the segfaults I've seen with
php_mapscript recently have come back to this issue, so I wouldn't be
surprised if this is what you're finding.

Bill



More information about the mapserver-dev mailing list