Problems with ArcSDE & MapServer (Premature end of script headers)

Shim, Stephen Stephen.Shim at CA.COM
Mon Feb 19 16:29:37 PST 2007


Hi,
 
I just used GDB to get more debugging output, I ran the shp2img program under GDB.  
 
The Seg Fault occurs when MapServer is trying to close the ArcSDE Layer.  
During this closing, its trying to free up data in an array, using msFree() and this causes the Segmentation Fault,
 
Does anyone have any idea what this problem means?
 
BTW, thanks to David for responding.  
I've tried your suggestion but its still Seg Faulting.
 
Here's the output:

msLayerClose (layer=0x8935288) at maplayer.c:234
234       msLayerFreeItemInfo(layer);
(gdb)
232     {
(gdb)
234       msLayerFreeItemInfo(layer);
(gdb)
msLayerFreeItemInfo (layer=0x8935288) at maplayer.c:120
120       if ( ! layer->vtable) {
(gdb)
119     {
(gdb)
120       if ( ! layer->vtable) {
(gdb)
125       layer->vtable->LayerFreeItemInfo(layer);
(gdb)
msSDELayerFreeItemInfo (layer=0x8935288) at mapsde.c:1720
1720      if(layer->iteminfo) {
(gdb)
1718    {
(gdb)
1720      if(layer->iteminfo) {
(gdb)
1721        SE_table_free_descriptions((SE_COLUMN_DEF *)layer->iteminfo);
(gdb)
1722        layer->iteminfo = NULL;
(gdb)
1729    }
(gdb)
msLayerFreeItemInfo (layer=0x8935288) at maplayer.c:126
126     }
(gdb)
msLayerClose (layer=0x8935288) at maplayer.c:235
235       if(layer->items) {
(gdb)
236         msFreeCharArray(layer->items, layer->numitems);
(gdb)
msFreeCharArray (array=0x8a97308, num_items=2) at mapfile.c:269
269       if((num_items < 0) || !array) return;
(gdb)
271       for(i=0;i<num_items;i++)
(gdb)
272         msFree(array[i]);
(gdb)
msFree (p=0x80f862b) at mapfile.c:259
259       if(p) free(p);
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x07936fc0 in free () from /lib/tls/libc.so.6
(gdb)

 
Stephen Shim
SLIP Team 
Email: Stephen.Shim at ca.com

CA Phone: 9488 8193 
  

________________________________

From: UMN MapServer Users List on behalf of Shim, Stephen
Sent: Fri 16/02/2007 3:45 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Problems with ArcSDE & MapServer (Premature end of script headers)



Hi,

I have a problem with MapServer connecting to our ArcSDE server.
The error logs show a "Premature end of script headers" error.
I'm using MapServer 4.8.4 and have tried 4.10.0, which also returns the same error.
Previously, I used MapServer 4.6.2 and have had no problems connecting to ArcSDE.

In all three cases (MapServer 4.8.4, 4.10.0 and 4.6.2), I used the same mapfile.

The different versions of MapServer were compiled with ArcSDE support 
using the maptools.org "fgs" toolkit on Red Hat Linux servers.

If you have used MapServer 4.8.4 or 4.10.0 connecting to ArcSDE on Red Hat Linux successfully,
I'd like to hear from you.

ENVIRONMENT

We have the MapServer running on a Linux box and ArcSDE running on a Windows box.

MapServer Server:
* MapServer 4.8.4
* Red Hat ES4

ArcSDE Server:
* Windows 2003 Server.
* ArcSDE 9.1 (Release: 91003) [BugFix: 0]
* Oracle9i  Build 1269

ERROR LOGS:

I turned on error logging in MapServer and here are the results:

Debug Information from MapServer 4.8.4

[Thu Feb 15 15:31:57 2007].578336 msWMSLoadGetMapParams(): enabling non-square pixels.
[Thu Feb 15 15:31:57 2007].590997 msDrawMap(): kicking into non-square pixel preserving mode.
[Thu Feb 15 15:31:57 2007].591072 msSDELayerOpen(): Layer CALM_REGIONS opened from scratch.
[Thu Feb 15 15:31:58 2007].119776 msConnPoolRegister(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x93d5ab8)
[Thu Feb 15 15:31:58 2007].119834 msSDELayerOpen(): Layer CALM_REGIONS specified version SDE.DEFAULT.
[Thu Feb 15 15:31:58 2007].121464 msSDEGetLayerInfo(): Looking for layer by SDE.CALM_REGIONS, SHAPE, sliptest,port:5151,slip,sde,aslkzxmn
[Thu Feb 15 15:31:58 2007].121516 msSDEGetLayerInfo(): No cached layerid found.
[Thu Feb 15 15:31:58 2007].123143 msSDELCacheAdd(): Caching id for SDE.CALM_REGIONS, SHAPE, sliptest,port:5151,slip,sde,aslkzxmn
[Thu Feb 15 15:31:58 2007].124391 msSDELayerGetRowIDColumn(): Table was not registered, returning SE_ROW_ID.
[Thu Feb 15 15:31:58 2007].124620 msSDELayerGetRowIDColumn(): Table was not registered, returning SE_ROW_ID.
[Thu Feb 15 15:31:58 2007] [error] [client 172.20.249.52] Premature end of script headers: /MapServer410/www/cgi-bin/mapserv

On MapServer 4.6.2, which succeeded in returning an image, I also obtained debugging information to compare:

Debug Information from MapServer 4.6.2

[Fri Feb 16 13:13:41 2007].3009   msWMSLoadGetMapParams(): enabling non-square pixels.
[Fri Feb 16 13:13:41 2007].12309  msDrawMap(): kicking into non-square pixel preserving mode.
[Fri Feb 16 13:13:41 2007].12389  msSDELayerOpen(): Layer CALM_REGIONS opened from scratch.
[Fri Feb 16 13:13:41 2007].571953 msConnPoolRegister(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)
[Fri Feb 16 13:13:41 2007].572006 msSDELayerOpen(): Layer CALM_REGIONS specified version SDE.DEFAULT.
[Fri Feb 16 13:13:41 2007].586505 msSDEGetLayerInfo(): Looking for layer by SDE.CALM_REGIONS, SHAPE, sliptest,port:5151,slip,sde,aslkzxmn
[Fri Feb 16 13:13:41 2007].586526 msSDEGetLayerInfo(): No cached layerid found.
[Fri Feb 16 13:13:41 2007].593036 msSDELCacheAdd(): Caching id for SDE.CALM_REGIONS, SHAPE, sliptest,port:5151,slip,sde,aslkzxmn
[Fri Feb 16 13:13:41 2007].594426 msSDELayerGetRowIDColumn(): Table was not registered, returning SE_ROW_ID.
[Fri Feb 16 13:13:41 2007].594652 msSDELayerGetRowIDColumn(): Table was not registered, returning SE_ROW_ID.
[Fri Feb 16 13:13:41 2007].729126 msDrawMap(): Layer 1 (CALM_REGIONS), 0.717s
[Fri Feb 16 13:13:41 2007].729202 msDrawMap(): Drawing Label Cache, 0.000s
[Fri Feb 16 13:13:41 2007].729233 msDrawMap() total time: 0.717s
[Fri Feb 16 13:13:41 2007].732874 msPOSTGISLayerClose datastatement: the_geom from cadastre
[Fri Feb 16 13:13:41 2007].732905 msPOSTGISLayerClose -- layerinfo is  NULL
[Fri Feb 16 13:13:41 2007].732923 msSDELayerClose(): Closing layer CALM_REGIONS.
[Fri Feb 16 13:13:41 2007].732962 msConnPoolRelease(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)
[Fri Feb 16 13:13:41 2007].732983 msConnPoolClose(sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)

Here is the mapfile LAYER definition that we tried connecting.

        LAYER
         NAME "CALM_REGIONS"
         CONNECTION "sliptest,port:5151,slip,sde,aslkzxmn"
         CONNECTIONTYPE SDE
         DATA "SDE.CALM_REGIONS,SHAPE,SDE.DEFAULT"
         DEBUG ON
         STATUS ON
         GROUP "CALM"
         DUMP true #required for wfs
         TYPE polygon
         TEMPLATE 'demo.html'
         METADATA
          "wms_title"           "CALM - CALM Regions"
          "wms_srs"             "EPSG:4283 EPSG:4326 EPSG:28349 EPSG:28350 EPSG:28351 EPSG:28352"
          "wms_extent"          "112.866 -35.2419 129.001 -13.5101"
          "wms_group_title"     "CALM"
          "gml_include_items"   "all"  ## optional (serves all attributes for layer)
         END #METADATA

         PROJECTION
          "init=epsg:4283"
         END

         CLASS
          NAME 'CALM_Regions'
          STYLE
           SYMBOL "line-vertical"
           COLOR 0 0 255
           OUTLINECOLOR 0 0 0
           SIZE 5
          END #STYLE
          STYLE
           SYMBOL "line-horizontal"
           COLOR 0 0 255
           OUTLINECOLOR 0 0 0
           SIZE 5
          END #STYLE
         END #CLASS
       END #LAYER


I would greatly appreciate it if anyone can offer any help in this matter.

Sincerely,

Stephen Shim
SLIP Team 

 

Email: Stephen.Shim at ca.com <mailto:Stephen.Shim at ca.com> 

CA Phone: 9488 8193 

 

  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070220/e103efb4/attachment.htm>


More information about the MapServer-users mailing list