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

Re: Segmentation fault with CDF routines under Linux



DOH!  It's been almost three years since I last used IDL (sadly I've
been forced to use MATLAB the whole time).  I recall making this mistake
quite often in my old IDL days.  Thanks for the quick reminder.  Of
course calling CDF_OPEN with "file[0]" fixed all my problems!

-Josh


In article <3A0C8541.2F5A26BF@indra.com>,
  Med Bennett <mbennett@indra.com> wrote:
> I've not used CDF, but the only thing I can think of is that perhaps
your
> variable 'file' is a string array of length 1 rather than just a
string.
> What does it say if you do a 'help,file' after
> file=findfile('ac_*_swe_'+year_beg+month_beg+day_beg+'*.cdf')?  This
has
> tripped me up numerous times in other situations.  You should probably
also
> use a variable name other than 'file', as that is a keyword to the
open
> procedure.
>
> riglerej@my-deja.com wrote:
>
> > Using both 5.3, and 5.4, I consistently have problems with
seg-faults
> > when trying to run various CDF routines under Linux.  I'm fairly new
to
> > using IDL to read CDFs, but I'm not trying to do anything strange.
In
> > fact, I can't even get cdf_open to work.
> >
> > Specifically, I have a problem when my argument to cdf_open is a
string
> > provided by the findfile routine.  If I type in my own string,
> > everything works great, but if it comes from findfile, I get a
> > seg-fault.  The exerpt below is copied exactly from my session, an
> > should give a very clear idea of what is happening...
> >
> >   IDL Version 5.4 (linux x86). (c) 2000, Research Systems, Inc.
> >   Installation number: 100.
> >   Licensed for use by: moiraine
> >
> >   IDL> year_beg='2000'
> >   IDL> month_beg='08'
> >   IDL> day_beg='01'
> >   IDL> help
> >   % At  $MAIN$
> >   DAY_BEG         STRING    = '01'
> >   MONTH_BEG       STRING    = '08'
> >   YEAR_BEG        STRING    = '2000'
> >   Compiled Procedures:
> >       $MAIN$
> >
> >   Compiled Functions:
> >
> >   IDL> file=findfile('ac_*_swe_'+year_beg+month_beg+day_beg+'*.cdf')
> >   IDL> print,file
> >   ac_k0_swe_20000801_v01.cdf
> >   IDL> id=cdf_open(file)
> >   % Loaded DLM: CDF.
> >   Segmentation fault
> >
> >   [jrigler@moiraine] [15:55:03]
> >   1016 <~/research/LPF/data/cdf/ace/swe/2000> idl
> >   IDL Version 5.4 (linux x86). (c) 2000, Research Systems, Inc.
> >   Installation number: 100.
> >   Licensed for use by: moiraine
> >
> >   IDL> file='ac_k0_swe_20000801_v01.cdf'
> >   IDL> id=cdf_open(file)
> >   % Loaded DLM: CDF.
> >   IDL>
> >
> > Can anyone else recreate this on Linux, or with versions other than
5.3
> > and 5.4?  I tried this with several different cdf files, so I don't
> > think it is a problem with the file format.  Any other ideas?
> >
> > -Josh
> >
> > P.S. While I'd love to move to HDF, that is not an option, so it
might
> > be wisest not to make that suggestion.
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.