[mapserver-users] Can't WFS getFeature w/MapServer 6.0.1

myOpenLayersUName joanne.mcgraw at SYMPATICO.CA
Tue Jul 19 16:56:52 EDT 2011


I am trying to perform a WFS getFeature request with a newly compiled version
of MapServer 6.0.1. It is failing with a segmentation fault and the failure
is related to SDE somehow but I'm not sure how to proceed.

It's possible the thread
http://osgeo-org.1803224.n2.nabble.com/ArcSDE-9-3-1-QUERYMAP-QUERY-or-GETFEATUREINFO-not-workin-Mapserver-6-td6600091.html
is describing a similar problem, but the current suggested 'fix' post
suggests this is not the case. Since the original reporter has not
responded, I can't be sure if his problem is now addressed and is,
therefore, a different problem. It could just be a red herring.

Ultimately, at this moment, I'm stuck re: how to proceed and any information
or pointers to get me moving again would be appreciated. Details of my
problem follow.

cheers,
jtm


Background:
I have a simple Mapfile that supports WFS requests (the GetCapabilities
response provides no warnings or errors):


MAP
  NAME "mySubMap"
  FONTSET "../../../mapserv/etc/fonts.txt"
  SYMBOLSET "../../../mapserv/etc/symbols.sym"

  SIZE 800 600
  IMAGETYPE PNG
  IMAGECOLOR 255 255 255

  EXTENT -2903297.697389 -789911.662978 3431059.382789 3959683.443689

  UNITS METERS
  PROJECTION
    "init=epsg:42304"
  END

  WEB
    IMAGEPATH "/<path>/httpd/htdocs/ogc_tmp/"
    IMAGEURL "/ogc_tmp/"
    METADATA
        "ows_title" "joanne_sde.map"
        "ows_onlineresource" "http://<domain>/ogc/joanne_sde"
        "ows_enable_request" "*"
    END #end METADATA
  END #end WEB

  OUTPUTFORMAT
    NAME 'AGG'
    DRIVER AGG/PNG
    MIMETYPE "image/png"
    IMAGEMODE RGB
    EXTENSION "png"
  END #end OUTPUTFORMAT

  LAYER
    NAME 'Roads25M'
    TYPE LINE
    STATUS ON

    CONNECTION "host,port,sde,username,password"
    CONNECTIONTYPE SDE
    DATA 'XDM_XDATA.TRN_NSF_ROAD_V6_CT25M_R2,SHAPE,SDE.DEFAULT'

    METADATA
        "ows_title" "Roads Title"
        "gml_featureid" "OBJECTID"
        "gml_include_items" "all"
    END #end METADATA
    DUMP true

    CLASS
      STYLE
        COLOR 0 0 0
      END #end STYLE
    END #end CLASS
  END #end LAYER
END #end MAP



When I try to do a getFeature request, it fails with an Internal Server
Error:

http://<domain>/ogc/joanne_sde?typename=Roads25M&maxfeatures=2&service=wfs&version=1.0.0&request=getfeature



Looking at the error log, I see:

[Tue Jul 19 16:06:23 2011] [error] [client 10.117.21.141]
/server/nl18/httpd/cgi-bin/joanne_sde: line 4: 24316 Segmentation fault     
${MS_CGIBIN}mapserv
[Tue Jul 19 16:06:23 2011] [error] [client 10.117.21.141] Premature end of
script headers: joanne_sde



This is similar to that discussed at:
http://osgeo-org.1803224.n2.nabble.com/Upgrade-MapServer-from-5-4-to-6-0-td6563752.html.
So, taking the suggestion of Daniel Morisette in that post, I have used gdb
to try to find the source of the segmentation fault. It tells me the
segmentation fault is occurring at:

Program received signal SIGSEGV, Segmentation fault.
0x08157116 in msSDELayerFreeItemInfo (layer=0x8218a90) at mapsde.c:2117
2117    mapsde.c: No such file or directory.
        in mapsde.c
(gdb) bt
#0  0x08157116 in msSDELayerFreeItemInfo (layer=0x8218a90) at mapsde.c:2117
#1  0x080af586 in msLayerFreeItemInfo (layer=0x8218a90) at maplayer.c:68
#2  0x080af8b4 in msLayerClose (layer=0x8218a90) at maplayer.c:210
#3  0x08096685 in msQueryByRect (map=0x82112e0) at mapquery.c:1024
#4  0x080df889 in msWFSGetFeature (map=0x82112e0, paramsObj=0x821f510,
req=0x8210ca8, ows_request=0xbfffe46c) at mapwfs.c:2500
#5  0x080e098f in msWFSDispatch (map=0x82112e0, requestobj=0x8210ca8,
ows_request=0xbfffe46c, force_wfs_mode=0) at mapwfs.c:2917
#6  0x080d4622 in msOWSDispatch (map=0x82112e0, request=0x8210ca8,
ows_mode=-1) at mapows.c:92
#7  0x0805a2d6 in main (argc=2, argv=0xbfffea94) at mapserv.c:1241




The code in question is "(if (sde->basedefs))" in msSDELayerFreeItemInfo;
however, I think the problem is actually because the layer->layerinfo is
corrupt or null or something.


void msSDELayerFreeItemInfo(layerObj *layer)
{
#ifdef USE_SDE
    msSDELayerInfo *sde = NULL;
    int i;
    if (!msSDELayerIsOpen(layer)) {
        msSetError( MS_SDEERR,
                    "SDE layer has not been opened.",
                    "msSDELayerFreeItemInfo()");
    }
    sde = layer->layerinfo;                          /*  this is line 2116
*/
    if (sde->basedefs) {                             /*  this is line 2117
*/
        SE_table_free_descriptions(sde->basedefs);
        :



If I change the data in the Mapfile to use a Shapefile instead of SDE, the
getFeature request works. So, the problem is quite definately related to
working with SDE. However, the SDE log suggests the query took place and
returned successfully. The SDE version we are working with is 9.2; and the
9.2 ArcSDE libraries are being used to compile.

I have also tried this same thing using a compilation of MapServer 5.4 in
this same environment and it works. 

Any ideas what else I might look at to give me an idea of what I need to
fix?




--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6600286.html
Sent from the Mapserver - User mailing list archive at Nabble.com.


More information about the mapserver-users mailing list