This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Dear Magnus Weis, >Date: Thu, 9 May 1996 11:31:05 +0200 >From: Magnus Weis <address@hidden> >Organization: . >To: address@hidden >Subject: segmentation fault in drposix_putlong >Keywords: 199605091033.AA23012 In the above message you wrote: > I am trying to use netCDF for my work on numerical modelling of the > Greenland ice sheet. > > So far, netCDF works very well. But it gives me segmentation faults > when I trie to write more than three or four data sets into one single > file (arrays have one unlimited dimension). It tried it under LINUX > and also on an IBM RS6000 with AIX3.2. In both cases I get the same > error, but at different times for both systems (but reproducable). > > While debugging netCDF I found the location where the error occurs in > xdrposix.c: > > static bool_t > xdrposix_putlong(xdrs, lp) > XDR *xdrs; > internal_netlong *lp; > { > #if SWAP > # if SIZEOF_NETLONG != 4 > # include Unhandled condition: line=__LINE__, file=__FILE__ > # else > ==> netlong nl = htonl((netlong)*lp); <=== !!! HERE IT IS !!! > Odd. I wouldn't think the statement indicated above could result in a segmentation violation. Also, SWAP should be undefined on an IBM RS/6000 system, so the above section of code shouldn't even be executing. Would you please do to the following: 1. Go to your top-level, netCDF source directory. 2. Send me the output from the following commands: uname -a grep netlong config.status grep NETLONG config.status grep SWAP config.status -------- Steve Emmerson <address@hidden>