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.
Chris, > To: address@hidden, > To: address@hidden > From: Chris Webster <address@hidden> > Subject: GMT on RH9: pscoast core dump on nc_open() > Organization: NCAR Research Aviation Facility The above message contained the following: > I'm rebuilding the latest GMT for Redhat 9 with netCDF 3.5.1 beta. > > Upon running my classic pscoast(1) command I receive a core dump in > nc_open(). The file nc_open() is going after does exist and is > readable. I couldn't figure out how to compile netcdf with debugging > (at least no CFLAGS in the Makefiles). Any advice? I would be very surprised if the problem lay with the nc_open() function. Do this to build a netCDF library with support for debugging: 1. Go to the top-level source directory of the netCDF package. 2. Perform steps 3 through 5 described near the end of the file INSTALL.html. 3. Ensure that the environment variable CFLAGS contains the string "-g". e.g., export CFLAGS -g or setenv CFLAGS -g depending on your user shell. 4. Perform steps 6 through 9 described near the end of the file INSTALL.html. If you don't want to install the netCDF package with debugging enabled, then don't do the "make install" in step 4 above. You should then change the build of your program to reference the netCDF library in the "src/" directory rather than the installed library. > > --Chris > > > 237% pscoast -R-97/-94/-6/21 -M -Na -W -Ia -Df > Segmentation fault (core dumped) > 238% gdb pscoast core.13077 > > [SNIP] > > (gdb) where > #0 0x42074245 in _int_malloc () from /lib/tls/libc.so.6 > #1 0x4207335b in malloc () from /lib/tls/libc.so.6 > #2 0x08051f11 in nc_redef () > #3 0x0805252c in nc_redef () > #4 0x0805103b in nc_create () > #5 0x08050fea in nc_create () > #6 0x080510ca in nc_open () > #7 0x4007e7e6 in GMT_init_shore (res=102 'f', c=0x42131300, w=263, > e=266, s=-6, n=21) > at gmt_shore.c:107 > #8 0x0804b8db in strcpy () > #9 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6 > (gdb) up > #1 0x4207335b in malloc () from /lib/tls/libc.so.6 > (gdb) up > #2 0x08051f11 in nc_redef () > (gdb) up > #3 0x0805252c in nc_redef () > (gdb) up > #4 0x0805103b in nc_create () > (gdb) up > #5 0x08050fea in nc_create () > (gdb) up > #6 0x080510ca in nc_open () > (gdb) up > #7 0x4007e7e6 in GMT_init_shore (res=102 'f', c=0x42131300, w=263, > e=266, s=-6, n=21) > at gmt_shore.c:107 > 107 check_nc_status (nc_open (path, NC_NOWRITE,&c->cdfid)); > (gdb) p path > $1 = "/jnet/linux/GMT/share/binned_GSHHS_f.cdf\000 Regards, Steve Emmerson