comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Segmentation fault with CDF routines under Linux
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Segmentation fault with CDF routines under Linux [message #22375] Fri, 10 November 2000 00:00 Go to next message
riglerej is currently offline  riglerej
Messages: 5
Registered: November 2000
Junior Member
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.
Re: Segmentation fault with CDF routines under Linux [message #22471 is a reply to message #22375] Fri, 10 November 2000 16:23 Go to previous message
riglerej is currently offline  riglerej
Messages: 5
Registered: November 2000
Junior Member
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.
Re: Segmentation fault with CDF routines under Linux [message #22473 is a reply to message #22375] Fri, 10 November 2000 00:00 Go to previous message
Med Bennett is currently offline  Med Bennett
Messages: 109
Registered: April 1997
Senior Member
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.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: C to IDL?
Next Topic: IDL "Birds of Feather" session in Boston

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:33:10 PDT 2025

Total time taken to generate the page: 0.40048 seconds