queryByAttributes issue

Rhys Ickeringill rhysi at OMNILINK.COM.AU
Sun May 15 19:30:47 PDT 2005


Hi list,

I'm attempting to do a pretty basic attribute search on a layer and am
getting MapServer crashes. I'll take a guess that I'm giving the
queryByAttributes method invalid input, but the MapServer process dies
silently, giving me no hint of what I could be doing wrong. Hence I would
greatly appreciate some feedback from more experienced MapServer users as to
what (if any) mistakes I've made.

Data config:
~~~~~~~~~
Postgres 7.4.7
PostGIS 1.0.0
PostGIS table 'parks' : CREATE TABLE parks ( ogc_fid integer NOT NULL,
wkb_geometry geometry, name character(50) )

System Config:
~~~~~~~~~~~
Linux (Slackware 10.1)
Apache 1.3.33
PHP 4.3.10 (running as Apache DSO)
MapServer 4.4.1 (runninng as PHP module)


My map file looks like this:

MAP "Map"
    #
    # Other layer definitions & map properties
    #
    LAYER
        NAME "Parks"
        TYPE polygon
        CONNECTIONTYPE postgis
        CONNECTION "dbname=mapdata"
        DATA "wkb_geometry from parks using unique ogc_fid"
        TEMPLATE "stub"
        STATUS ON
        PROJECTION
            "prog=longlat"
            "ellips=GRS80"
        END
        CLASS
            NAME "Parks"
            COLOR 0 160 0
        END
    END
    #
    # Other layer definitions...
    #
END


The relevant code looks like this:

...
if( array_key_exists('FID', $_REQUEST ) ){
    $layer = $map->getLayerByName( 'Parks' ); // always succeeds
    $fid = $_REQUEST['FID'];
    $qryResult = $layer->queryByAttributes( 'ogc_fid', $fid , MS_SINGLE ) //
PHP processing dies here

    if( $qryResult === MS_SUCCESS ){
        // do stuff to highlight result and alter map extent (yet to be
tested - never gets that far)
...

I know it is the queryByAttributes() call which is causing the problem - if
I comment out the queryByAttributes() call, I get a pefectly drawn map with
the default [mapfile defined] extents. The only information I have as to
what is going wrong is found in the Apache error log:

*** glibc detected *** double free or corruption (!prev): 0x[some memory
address] ***
[some timstamp] [notice] child pid 1234 exit signal Aborted (6)

Am I doing something wrong, or shall I take this over to MAPSERVER-DEV ?

Thanks for your thoughts

Rhys



More information about the MapServer-users mailing list