<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML DIR=ltr><HEAD></HEAD><BODY>
<DIV id=idOWAReplyText67336 dir=ltr>
<DIV dir=ltr><FONT face="Courier New" color=#000000 size=2>Hi,</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>I just used GDB to get&nbsp;more 
debugging&nbsp;output, I ran the shp2img program under GDB.&nbsp; </FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face="Courier New"><FONT size=2>The Seg Fault occurs 
when&nbsp;</FONT><FONT size=2>MapServer is trying&nbsp;to close the ArcSDE 
Layer.&nbsp; </FONT></FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>During this closing,&nbsp;its 
trying to free up data in an array, using msFree() and&nbsp;this&nbsp;causes the 
Segmentation Fault,</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>Does&nbsp;anyone have any 
idea&nbsp;what this problem means?</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>BTW, thanks to David for 
responding.&nbsp; </FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>I've tried your suggestion but its 
still Seg Faulting.</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>Here's the output:</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" color=black size=2><SPAN 
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Arial"><BR>msLayerClose 
(layer=0x8935288) at maplayer.c:234<BR>234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
msLayerFreeItemInfo(layer);<BR>(gdb)<BR>232&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>(gdb)<BR>234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
msLayerFreeItemInfo(layer);<BR>(gdb)<BR>msLayerFreeItemInfo (layer=0x8935288) at 
maplayer.c:120<BR>120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( ! 
layer-&gt;vtable) {<BR>(gdb)<BR>119&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>(gdb)<BR>120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( ! layer-&gt;vtable) 
{<BR>(gdb)<BR>125&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
layer-&gt;vtable-&gt;LayerFreeItemInfo(layer);<BR>(gdb)<BR>msSDELayerFreeItemInfo 
(layer=0x8935288) at mapsde.c:1720<BR>1720&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(layer-&gt;iteminfo) {<BR>(gdb)<BR>1718&nbsp;&nbsp;&nbsp; 
{<BR>(gdb)<BR>1720&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(layer-&gt;iteminfo) 
{<BR>(gdb)<BR>1721&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SE_table_free_descriptions((SE_COLUMN_DEF 
*)layer-&gt;iteminfo);<BR>(gdb)<BR>1722&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
layer-&gt;iteminfo = NULL;<BR>(gdb)<BR>1729&nbsp;&nbsp;&nbsp; 
}<BR>(gdb)<BR>msLayerFreeItemInfo (layer=0x8935288) at 
maplayer.c:126<BR>126&nbsp;&nbsp;&nbsp;&nbsp; }<BR>(gdb)<BR>msLayerClose 
(layer=0x8935288) at maplayer.c:235<BR>235&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(layer-&gt;items) 
{<BR>(gdb)<BR>236&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
msFreeCharArray(layer-&gt;items, 
layer-&gt;numitems);<BR>(gdb)<BR>msFreeCharArray (array=0x8a97308, num_items=2) 
at mapfile.c:269<BR>269&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if((num_items &lt; 
0) || !array) return;<BR>(gdb)<BR>271&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
for(i=0;i&lt;num_items;i++)<BR>(gdb)<BR>272&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
msFree(array[i]);<BR>(gdb)<BR>msFree (p=0x80f862b) at 
mapfile.c:259<BR>259&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(p) 
free(p);<BR>(gdb)<BR>Program received signal SIGSEGV, Segmentation 
fault.<BR>0x07936fc0 in free () from 
/lib/tls/libc.so.6<BR>(gdb)<BR></SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT>&nbsp;</DIV></DIV>
<DIV id=idSignature23529 dir=ltr>
<DIV RE>Stephen Shim<BR>SLIP Team 
<DIV RE>
<DIV RE><PRE></PRE>
<DIV RE>Email: <A 
href="mailto:Stephen.Shim@ca.com">Stephen.Shim@ca.com</A><BR><BR>CA Phone: 9488 
8193 
<DIV RE>
<DIV RE><PRE></PRE>
<DIV RE>&nbsp; 
<DIV RE>
<DIV RE><PRE></PRE></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> UMN MapServer Users List on behalf of 
Shim, Stephen<BR><B>Sent:</B> Fri 16/02/2007 3:45 PM<BR><B>To:</B> 
MAPSERVER-USERS@LISTS.UMN.EDU<BR><B>Subject:</B> [UMN_MAPSERVER-USERS] Problems 
with ArcSDE &amp; MapServer (Premature end of script 
headers)<BR></FONT><BR></DIV>
<DIV dir=ltr>
<P dir=ltr><FONT face="Courier New" color=#000000 size=2>Hi,</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>I have a problem with MapServer 
connecting to&nbsp;our ArcSDE server.<BR>The error logs&nbsp;show a "Premature 
end of script headers" error.<BR>I'm using MapServer 4.8.4 and have tried 
4.10.0, which also returns&nbsp;the same error.<BR></FONT><FONT 
face="Courier New" size=2>Previously, I used MapServer 4.6.2 and have had no 
problems connecting to ArcSDE.<BR></FONT><FONT face="Courier New" size=2><BR>In 
all three cases (MapServer 4.8.4, 4.10.0 and 4.6.2), I used the same 
mapfile.</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>The different versions of MapServer 
were compiled with ArcSDE&nbsp;support <BR></FONT><FONT face="Courier New" 
size=2>using&nbsp;the maptools.org "fgs" toolkit on Red Hat Linux 
servers.</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>If you have used MapServer 4.8.4 or 
4.10.0&nbsp;connecting to ArcSDE&nbsp;on Red Hat Linux successfully,<BR>I'd like 
to hear from you.</FONT><FONT face="Courier New" 
size=2><BR><BR>ENVIRONMENT</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>We have the MapServer running on a 
Linux box and ArcSDE running on a Windows box.</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>MapServer Server:<BR></FONT><FONT 
face="Courier New" size=2>* MapServer 4.8.4<BR></FONT><FONT face="Courier New" 
size=2>* Red Hat ES4</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>ArcSDE Server:<BR>* Windows 2003 
Server.<BR>* ArcSDE </FONT><FONT face="Courier New" size=2>9.1 (Release: 91003) 
[BugFix: 0]<BR>* </FONT><FONT face="Courier New" size=2>Oracle9i&nbsp; Build 
1269</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>ERROR LOGS:</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>I turned on error logging in 
MapServer and here are the results:</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>Debug Information&nbsp;from MapServer 
4.8.4</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>[Thu Feb 15 15:31:57 2007].578336 
msWMSLoadGetMapParams(): enabling non-square pixels.<BR>[Thu Feb 15 15:31:57 
2007].590997 msDrawMap(): kicking into non-square pixel preserving mode.<BR>[Thu 
Feb 15 15:31:57 2007].591072 msSDELayerOpen(): Layer CALM_REGIONS opened from 
scratch.<BR>[Thu Feb 15 15:31:58 2007].119776 
msConnPoolRegister(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x93d5ab8)<BR>[Thu 
Feb 15 15:31:58 2007].119834 msSDELayerOpen(): Layer CALM_REGIONS specified 
version SDE.DEFAULT.<BR>[Thu Feb 15 15:31:58 2007].121464 msSDEGetLayerInfo(): 
Looking for layer by SDE.CALM_REGIONS, SHAPE, 
sliptest,port:5151,slip,sde,aslkzxmn<BR>[Thu Feb 15 15:31:58 2007].121516 
msSDEGetLayerInfo(): No cached layerid found.<BR>[Thu Feb 15 15:31:58 
2007].123143 msSDELCacheAdd(): Caching id for SDE.CALM_REGIONS, SHAPE, 
sliptest,port:5151,slip,sde,aslkzxmn<BR>[Thu Feb 15 15:31:58 2007].124391 
msSDELayerGetRowIDColumn(): Table was not registered, returning 
SE_ROW_ID.<BR>[Thu Feb 15 15:31:58 2007].124620 msSDELayerGetRowIDColumn(): 
Table was not registered, returning SE_ROW_ID.<BR>[Thu Feb 15 15:31:58 2007] 
[error] [client 172.20.249.52] Premature end of script headers: 
/MapServer410/www/cgi-bin/mapserv</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>On MapServer 4.6.2, which succeeded 
in returning an image, I also obtained debugging information&nbsp;to 
compare:</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>Debug Information&nbsp;from MapServer 
4.6.2</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>[Fri Feb 16 13:13:41 
2007].3009&nbsp;&nbsp; msWMSLoadGetMapParams(): enabling non-square 
pixels.<BR>[Fri Feb 16 13:13:41 2007].12309&nbsp; msDrawMap(): kicking into 
non-square pixel preserving mode.<BR>[Fri Feb 16 13:13:41 2007].12389&nbsp; 
msSDELayerOpen(): Layer CALM_REGIONS opened from scratch.<BR>[Fri Feb 16 
13:13:41 2007].571953 
msConnPoolRegister(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)<BR>[Fri 
Feb 16 13:13:41 2007].572006 msSDELayerOpen(): Layer CALM_REGIONS specified 
version SDE.DEFAULT.<BR>[Fri Feb 16 13:13:41 2007].586505 msSDEGetLayerInfo(): 
Looking for layer by SDE.CALM_REGIONS, SHAPE, 
sliptest,port:5151,slip,sde,aslkzxmn<BR>[Fri Feb 16 13:13:41 2007].586526 
msSDEGetLayerInfo(): No cached layerid found.<BR>[Fri Feb 16 13:13:41 
2007].593036 msSDELCacheAdd(): Caching id for SDE.CALM_REGIONS, SHAPE, 
sliptest,port:5151,slip,sde,aslkzxmn<BR>[Fri Feb 16 13:13:41 2007].594426 
msSDELayerGetRowIDColumn(): Table was not registered, returning 
SE_ROW_ID.<BR>[Fri Feb 16 13:13:41 2007].594652 msSDELayerGetRowIDColumn(): 
Table was not registered, returning SE_ROW_ID.<BR>[Fri Feb 16 13:13:41 
2007].729126 msDrawMap(): Layer 1 (CALM_REGIONS), 0.717s<BR>[Fri Feb 16 13:13:41 
2007].729202 msDrawMap(): Drawing Label Cache, 0.000s<BR>[Fri Feb 16 13:13:41 
2007].729233 msDrawMap() total time: 0.717s<BR>[Fri Feb 16 13:13:41 2007].732874 
msPOSTGISLayerClose datastatement: the_geom from cadastre<BR>[Fri Feb 16 
13:13:41 2007].732905 msPOSTGISLayerClose -- layerinfo is&nbsp; NULL<BR>[Fri Feb 
16 13:13:41 2007].732923 msSDELayerClose(): Closing layer CALM_REGIONS.<BR>[Fri 
Feb 16 13:13:41 2007].732962 
msConnPoolRelease(CALM_REGIONS,sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)<BR>[Fri 
Feb 16 13:13:41 2007].732983 
msConnPoolClose(sliptest,port:5151,slip,sde,aslkzxmn,0x82d1000)</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>Here is the 
mapfile&nbsp;LAYER&nbsp;definition that we tried connecting.</FONT></P>
<P dir=ltr><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
LAYER<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME 
"CALM_REGIONS"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTION 
"sliptest,port:5151,slip,sde,aslkzxmn"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CONNECTIONTYPE SDE<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATA 
"SDE.CALM_REGIONS,SHAPE,SDE.DEFAULT"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
DEBUG ON<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STATUS 
ON<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GROUP 
"CALM"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DUMP true #required 
for wfs<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE 
polygon<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TEMPLATE 
'demo.html'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
METADATA<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"wms_title"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "CALM - 
CALM Regions"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"wms_srs"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"EPSG:4283 EPSG:4326 EPSG:28349 EPSG:28350 EPSG:28351 
EPSG:28352"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"wms_extent"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "112.866 
-35.2419 129.001 
-13.5101"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"wms_group_title"&nbsp;&nbsp;&nbsp;&nbsp; 
"CALM"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"gml_include_items"&nbsp;&nbsp; "all"&nbsp; ## optional (serves all attributes 
for layer)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END 
#METADATA</FONT></P>
<P dir=ltr><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
PROJECTION<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
"init=epsg:4283"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
END</FONT></P>
<P dir=ltr><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
CLASS<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; N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courier New" size=2>I would greatly appreciate it if 
anyone can offer any help in this matter.<BR></FONT><FONT face="Courier New" 
size=2><BR>Sincerely,</FONT></P>
<P dir=ltr><FONT face="Courier New" size=2>Stephen Shim<BR>SLIP Team </FONT></P>
<P dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</P>
<P dir=ltr><FONT face="Courier New" size=2>Email: </FONT><A 
href="mailto:Stephen.Shim@ca.com"><FONT face="Courier New" 
size=2>Stephen.Shim@ca.com</FONT></A><BR><BR><FONT face="Courier New" size=2>CA 
Phone: 9488 8193 </FONT></P>
<P dir=ltr><FONT face="Courier New" size=2></FONT>&nbsp;</P>
<P dir=ltr><FONT face="Courier New" size=2>&nbsp; </FONT></P>
<P dir=ltr>&nbsp;</P></DIV></BODY></HTML>