[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #UDG-681606]: A request



Hello Wei,

If you want to change the code and have it return an error code instead of 
abort on the ASSERT call,  it may be easiest to make this change on your end 
and then recompile the library for your use.  This should be a fairly 
straightforward process.  The assert statement typically is used in 
circumstances where it is impractical/impossible to continue operation, 
however, so it may not be practical to replace this with an error code. 

I do not recall offhand which version of netcdf you are using, but looking at 
NC4_open there is only one case I can see which would throw SIGABRT with an 
'Assertion failed:(0)' statement; this is at the end of the function, and 
appears to occur when a file of unknown type is passed to NC4_open.  (Russ may 
correct me if I'm wrong on this).  Assuming this is the case, there isn't 
really any debugging information that we can provide that would be of any use.  
The error boils down to 'this is not a netcdf file, so netcdf cannot open it'.  

Have you tried opening the file with a hex editor and examining the header 
manually? This may provide some insight as to what type of file you are dealing 
with.  

I hope this helps,

-Ward

> Hi there,
> 
> I the last few days, I have quite few questions to you.
> This time is a request.
> 
> The situation is like this:
> We have a file, but we do not know what format it is.
> So we try to open it as hdf, as netcdf, etc.
> 
> When we tried to use: nc__open(filename, ...)
> to open it. it gives:
> 
> Assertion failed: (0), function NC4_open, file nc4file.c, line 2696.
> 
> Program received signal SIGABRT, Aborted.
> 
> We are wondering if you guys can make it return with an error code.
> 
> If it aborts, then we lose control, and have no way to continue checking.
> 
> Thanks in advance!
> 
> Wei
> 
> ================================================
> 1850 Table Mesa Dr.
> Boulder, CO 80307
> Phone: 303-497-8924
> 
> 


Ticket Details
===================
Ticket ID: UDG-681606
Department: Support netCDF
Priority: Normal
Status: Closed