Regardless of what the data file look like internally it is not very nice
of the netCDF importer to just SIGSEGV and die. Could someone with CVS
access apply the attached patch? 

For the case submitted this result in a (semi-polite) message to the user


Cheers,
/Nils

> I've been trying to import two netCDF files that I ran the ncdx utility on in
> order to make them OpenDX compliant.  Each time I've run into a segmentation
> fault (signal 11) that disconnects the ui from the executive server.  I
> understand this is a memory problem, but I'm not sure exactly of the problem's
> characteristics or how to rectify it.

Index: src/exec/dxmods/import_ncdf.c
===================================================================
RCS file: /src/master/dx/src/exec/dxmods/import_ncdf.c,v
retrieving revision 1.13
diff -p -r1.13 import_ncdf.c
*** src/exec/dxmods/import_ncdf.c       24 Jul 2001 20:04:32 -0000      1.13
--- src/exec/dxmods/import_ncdf.c       29 Aug 2002 15:41:09 -0000
*************** Object_Import(char *filename, char **var
*** 298,303 ****
--- 298,308 ----
  
        case IMPORT_DATA:      
        o = import_field(cdfhandle, vp);
+       if( !o ) {
+         DXWarning("Nothing has been imported. "
+                   "Did you use a DX-compliant netCDF file convention?");
+         break;
+       }
          /* add any Global Attributes */
          getglobalattr(o,vp);
        break;
*************** static Error getglobalattr(Object o, Var
*** 1630,1635 ****
--- 1635,1644 ----
    char stringattr[MAXNAME];
    char *attr_string;
    void *attr_value;
+ 
+   if( !o ) {
+     DXErrorReturn(ERROR_INTERNAL,"getglobalattr called without a proper 
object");
+   }
  
    while(ncattname(vp->cdfid,NC_GLOBAL,attr_count,stringattr) !=-1) {
      attr_count++;

Reply via email to