[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
While waiting for a patch which will correctly fix the problems described in this thread (OGC queries to SDE failing), we have introduced a change to our version of mapsde.c that is allowing us to move forward. In the msSDELayerFreeItemInfo function, we changed the boolean expressions at lines 2116 and 2121 to check that sde wasn't NULL before checking the basedefs and joindefs as shown below. For the time being, this is allowing us to continue our work with no serious problems encountered so far. If we do come across some, I'll be sure to let you know. Cheers, jtm 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; if (sde != NULL sde-basedefs) { SE_table_free_descriptions(sde-basedefs); sde-basedefs = NULL; } if (sde != NULL sde-joindefs) { SE_table_free_descriptions(sde-joindefs); sde-joindefs = NULL; } if (layer-iteminfo) { : -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6611100.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
We really need to get a ticket created for this issue, can you do that? Steve On Fri, Jul 22, 2011 at 11:38 AM, myOpenLayersUName joanne.mcg...@sympatico.ca wrote: While waiting for a patch which will correctly fix the problems described in this thread (OGC queries to SDE failing), we have introduced a change to our version of mapsde.c that is allowing us to move forward. In the msSDELayerFreeItemInfo function, we changed the boolean expressions at lines 2116 and 2121 to check that sde wasn't NULL before checking the basedefs and joindefs as shown below. For the time being, this is allowing us to continue our work with no serious problems encountered so far. If we do come across some, I'll be sure to let you know. Cheers, jtm 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; if (sde != NULL sde-basedefs) { SE_table_free_descriptions(sde-basedefs); sde-basedefs = NULL; } if (sde != NULL sde-joindefs) { SE_table_free_descriptions(sde-joindefs); sde-joindefs = NULL; } if (layer-iteminfo) { : -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6611100.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
I think this is probably a reasonable fix, although I'll look into it a bit more. I've confirmed the bug exists outside OGC queries too. Just a simple mode=nquery triggers the segfault. I'm not sure why we just don't return if the layer isn't open though. Steve On Fri, Jul 22, 2011 at 11:38 AM, myOpenLayersUName joanne.mcg...@sympatico.ca wrote: While waiting for a patch which will correctly fix the problems described in this thread (OGC queries to SDE failing), we have introduced a change to our version of mapsde.c that is allowing us to move forward. In the msSDELayerFreeItemInfo function, we changed the boolean expressions at lines 2116 and 2121 to check that sde wasn't NULL before checking the basedefs and joindefs as shown below. For the time being, this is allowing us to continue our work with no serious problems encountered so far. If we do come across some, I'll be sure to let you know. Cheers, jtm 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; if (sde != NULL sde-basedefs) { SE_table_free_descriptions(sde-basedefs); sde-basedefs = NULL; } if (sde != NULL sde-joindefs) { SE_table_free_descriptions(sde-joindefs); sde-joindefs = NULL; } if (layer-iteminfo) { : -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6611100.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
This is a correction and additional information to previous post. In my first post, I said However, the SDE log suggests the query took place and returned successfully. Upon closer inspection, this is not actually the case. Watching the SDE logs while trying to perform my query with 5.6.3, I see the following: Thu Jul 21 09:01:52 2011 - SDE Server Pid 11962 Registered, User: Username Schema: sde. Thu Jul 21 09:01:52 2011 - SDE Server 11962 exit'd with status 0 Thu Jul 21 09:01:52 2011 - SDE Server Pid 11962 Stopped, User: Username Schema: sde. Thu Jul 21 09:01:54 2011 - SDE Server Pid 11963 Registered, User: Username Schema: sde. Thu Jul 21 09:01:58 2011 - SDE Server 11963 exit'd with status 0 Thu Jul 21 09:01:59 2011 - SDE Server Pid 11963 Stopped, User: Username Schema: sde. When I perform the same query with 6.0.1, only one connection is made: Thu Jul 21 09:00:37 2011 - SDE Server Pid 11224 Registered, User: Username Schema: sde. Thu Jul 21 09:00:37 2011 - SDE Server 11224 exit'd with status 0 Thu Jul 21 09:00:37 2011 - SDE Server Pid 11224 Stopped, User: Username Schema: sde. So, while that one connection appears to perform successfully, there is no second connection at all (which according to what happens with 5.6.3, there should be). Somewhere between the handshaking (or whatever the heck it is) and the actual query being performed, something is going off the rails. Perhaps the connection value in layer-layerinfo being invalid in some way is stopping the second connection? It's also unable to free it. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6606885.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
I've done some additional debugging and have learned that the mapwfs.c's msWFSGetFeature has changed significantly between 5.6.3 and 6.0.1. In particular, the problem seems to be starting at line 2457 in the 6.0.1 code (1248 in 5.6.3). At that point, a call to msOWSGetLayerExtent is made and part of that process creates and frees a connection to SDE. That is the first connection that is identified in the above posts (and in Michelle Douvil's post discussing her GDB findings). The second SDE connection is not made in 6.0.1 because, at line 2500 (still in mapwfs.c's), there is a call to msQueryByRect(map) which did not happen in 5.6.3. In that function (msQueryByRect), at line 1024, there is a msLayerClose(lp) call that ultimately takes us to the msSDELayerFreeItemInfo where the layer-layerinfo (and therefore the sde variable at line 2116) is already null because of the previous close (in the msOWSGetLayerExtent process) and so the if (sde-basedefs) condition gives a segmentation fault because it's trying to access a property in an object that doesn't exist. I really don't know anything about any of this code but know that what I describe is definitely what is happening as far as I can observe. I am hoping that someone who knows more about the code can identify whether there is a problem with the source code related to all this. And, if so, should I be putting something in the DEV forum about this? -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6607659.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
First, thanks for taking the time to dig into this, we appreciate the help. Indeed there were large changes between 5.6 and 6.0 due to some overall changes in the parser and query handling. I wouldn't have thought they would introduce any issues specific to a particular driver though. It may be that the SDE code needs to simply be made more robust. If I supply a patch that does that can you test? Steve On Thu, Jul 21, 2011 at 12:00 PM, myOpenLayersUName joanne.mcg...@sympatico.ca wrote: I've done some additional debugging and have learned that the mapwfs.c's msWFSGetFeature has changed significantly between 5.6.3 and 6.0.1. In particular, the problem seems to be starting at line 2457 in the 6.0.1 code (1248 in 5.6.3). At that point, a call to msOWSGetLayerExtent is made and part of that process creates and frees a connection to SDE. That is the first connection that is identified in the above posts (and in Michelle Douvil's post discussing her GDB findings). The second SDE connection is not made in 6.0.1 because, at line 2500 (still in mapwfs.c's), there is a call to msQueryByRect(map) which did not happen in 5.6.3. In that function (msQueryByRect), at line 1024, there is a msLayerClose(lp) call that ultimately takes us to the msSDELayerFreeItemInfo where the layer-layerinfo (and therefore the sde variable at line 2116) is already null because of the previous close (in the msOWSGetLayerExtent process) and so the if (sde-basedefs) condition gives a segmentation fault because it's trying to access a property in an object that doesn't exist. I really don't know anything about any of this code but know that what I describe is definitely what is happening as far as I can observe. I am hoping that someone who knows more about the code can identify whether there is a problem with the source code related to all this. And, if so, should I be putting something in the DEV forum about this? -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6607659.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
Absolutely, we'd be happy to test a patch. I have some additional info (which you probably already know at this point but I'll pass it along just in case). I started looking into the WMS GetFeatureInfo request failure that Michelle was reporting in her post and found that ultimately it was the exact same problem. In that case, mapquery.c's msQueryByPoint makes an msLayerClose call on a layer that is not open (line 1535). Again, it ultimately gets down to the msSDELayerFreeItemInfo function where the layer-layerinfo is null, so sde-basedefs causes a segmentation fault. So, somewhere, there just needs to be a check that stops the attempt to free memory if the memory is not allocated at that time. Anyway, I'll send you an email directly to give you my coordinates and we'll arrange to try the patch. Cheers, jtm -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6608020.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
I would be interested in testing this patch as well! Thanks, Michelle -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6608040.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
Is it possible that this post and Michelle Douvil's http://osgeo-org.1803224.n2.nabble.com/ArcSDE-9-3-1-QUERYMAP-QUERY-or-GETFEATUREINFO-not-workin-Mapserver-6-td6600091.html are having the same problem? I ask because a co-worker has tried using MS4W 3.0.3 to do a WMS GetFeatureInfo request and he gets an error (mapserv.exe has encountered a problem and needs to close.) when the Mapfile is using SDE to access the data, but it works fine when he uses a Shapefile...kind of like what's happening to me with my WFS GetFeature query on Linux. Further to my own problem, I now have a 5.6.3 compiled with debug also and, using Data Display Debugger, find that in 5.6.3 the connection and stream properties of layer-layerinfo are 0x0 just before the point of failure in 6.0.1 but when I break at the same location with 6.0.1, there are addresses still referenced there. Like I said in my previous post, SDE appears to believe the connection has been closed successfully and given the error gdb gave it's almost like the connection has already been closed but the address not cleared from the pointer. I don't know. I'm grasping at straws here and hoping someone who knows more about the SDE connection code can provide some guidance. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6604123.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Re: Can't WFS getFeature w/MapServer 6.0.1
I have had no problems with shapefiles for GetFeatureInfo/GetMap via WMS. My issues are all with SDE (we have SDE 9.3.1 and all the data is in SDEBINARY) There were no issues with this data at Mapserver 5.2 and 5.7 Thanks, Michelle Michelle, I'm having problems doing a WFS GetFeature request using MapServer 6.0.1 (as described in my own post at http://osgeo- org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1- td6600286.html). Are you able to make a shapefile out of one of the layers you are accessing in SDE and point your mapfile layer to it rather than SDE? Does your query work then? If yes, then you may be having the same problems we are and it may be more related to the SDE connection than anything else. Let me know what you find out. Sheers jtm -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Can-t-WFS-getFeature-w-MapServer-6-0-1-tp6600286p6604394.html Sent from the Mapserver - User mailing list archive at Nabble.com. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users