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

Home » Public Forums » archive » _EXTRA inheritance crashing IDL
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
_EXTRA inheritance crashing IDL [message #30208] Wed, 10 April 2002 14:25 Go to next message
Rob.Preece is currently offline  Rob.Preece
Messages: 8
Registered: December 1999
Junior Member
OK, Rob de-lurking here.

Has anyone seen a behavior where IDL 5.5 crashes on a call to a subroutine
with an added _EXTRA keyword? I have found the same behavior on several
different machines, Linux and Mac, which does not exist under 5.4. Here
goes a test case:

PRO test1, _REF_EXTRA = extra

testStuff = ['TITLE','XTITLE','YTITLE']

test2, INDGEN (10), _EXTRA = [testStuff, 'XRANGE']

END

PRO test2, plotStuff, _EXTRA = extra

PLOT, plotStuff, plotStuff, _EXTRA = extra

END


Compile and execute :

IDL> test1, XRANGE = [-1, 10]

On 5.4, I get a nice plot, with my new XRANGE. On 5.5, I get a *totally
irrelevant* error message:

% File expression not allowed in this context: <no name>

The error message varies, depending on when in my code I call a subroutine
using the _EXTRA keyword. Once, I hard crashed IDL on my Mac iBook. I
would very much appreciate any suggestions / tips, since this is candidate
release code, and I have to tell my users if they can or must not use IDL
5.5!

Thanks!

- Rob

==================================================
+ Robert D. Preece Rob.Preece@nsstc.nasa.gov
+ Dept. of Physics, Univ. of Alabama in Huntsville
+ Phone: (256) 961-7654 FAX: (256) 961-7215
+ SD50, National Space Science & Technology Center
+ 320 Sparkman Drive, Huntsville, AL 35805
==================================================
Re: _EXTRA inheritance crashing IDL [message #30244 is a reply to message #30208] Sun, 14 April 2002 12:48 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Sorry forget my last answer I did a type mismatch!

Reimar

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
Re: _EXTRA inheritance crashing IDL [message #30245 is a reply to message #30208] Sun, 14 April 2002 12:43 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Rob Preece wrote:
>
> In article <a950i2$6j6$1@newsreader.mailgate.org>, "Mark Hadfield"
> <m.hadfield@niwa.co.nz> wrote:
>
>>
>> Yes it's a bug. Report it to IDL.
>>
>
> I did, and found that it is a known issue, to be fixed in version 5.6.
> David asked for RSI's response to be posted, so here goes:
>
> ------------------
> RE: Incident #: 120580 Tech Support Submission
>
Dear Rob,
here is a solution of your problem.

Exchange _EXTRA with _STRICT_EXTRA then it works
But then you have always to write completly the keywords as
you did in the example.

regards
Reimar

PRO test1, _REF_EXTRA = extra,dummy=dummy

testStuff = ['TITLE','XTITLE','YTITLE']

test2, INDGEN (10), _EXTRA = [testStuff, 'XRANGE']

END

PRO test2, plotStuff, _STRICT_EXTRA = extra

PLOT, plotStuff, plotStuff, _EXTRA = extra

END

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
Re: _EXTRA inheritance crashing IDL [message #30254 is a reply to message #30208] Fri, 12 April 2002 08:20 Go to previous message
Rob.Preece is currently offline  Rob.Preece
Messages: 8
Registered: December 1999
Junior Member
In article <a950i2$6j6$1@newsreader.mailgate.org>, "Mark Hadfield"
<m.hadfield@niwa.co.nz> wrote:

>
> Yes it's a bug. Report it to IDL.
>

I did, and found that it is a known issue, to be fixed in version 5.6.
David asked for RSI's response to be posted, so here goes:

------------------
RE: Incident #: 120580 Tech Support Submission

I believe in your case, however, that you are actually
experiencing the symptoms of a known bug that appeared first in IDL 5.5, and
has already been identified and recoded for subsequent release in IDL 5.6.
Here is the bug report:

"Title: "Passing _REF_EXTRA keyword name without specifying keyword crashes
IDL"

Description:
Compile the following procedures in IDL:
pro test2, junk=junk
print, 'hi'
end
pro test, _REF_EXTRA=_extra
test2, _Extra='junk'
end
Calling "test" without passing the JUNK keyword causes a SegFault on Solaris
and dereference error (at 0xfffffffc) on Windows, and crashes IDL.

Resolution:
This is an internal logic error, in which IDL was looking for _REF_EXTRA
variables to pass on even though the current frame has no such variables."

James Jay Jones
Technical Support Engineer
RSI Incorporated
Tel: +1 (303) 413-3920
Email: support@rsinc.com
-------------------

Note: I have snipped out some comments and suggestions that James made, as
they were not appropos to my problem; see below.

> Re the need to do it this way, if you're passing specific keywords
> then you don't *need* to use inheritance. Eg this...
>
<snip>

OK. My example code simply illustrated the crash, it does not show the
rationale behind it. Suffice it to say that I hit upon this method by
reading the documentation, and it solved much head-banging that had been
going on. The short answer as to why I do it this way is that I have a
quite generic plotting method that can be called under many circumstances;
some keywords must not be passed on, while an unknown number (and
unknowable, except at runtime) of others can. It was a perfect match for
the _REF_EXTRA mechanism...

>
> Warning: if you use this last technique with IDL 5.4 you must use
> inheritance by value not reference because there was a bug in 5.4.
>
> Of course with the different bugs in different versions you may well
> decide to leave your code as it is and stick with 5.4!
>

Ack! This is what I will do. Thanks all!

==================================================
+ Robert D. Preece Rob.Preece@nsstc.nasa.gov
+ Dept. of Physics, Univ. of Alabama in Huntsville
+ Phone: (256) 961-7654 FAX: (256) 961-7215
+ SD50, National Space Science & Technology Center
+ 320 Sparkman Drive, Huntsville, AL 35805
==================================================
Re: _EXTRA inheritance crashing IDL [message #30264 is a reply to message #30208] Thu, 11 April 2002 14:51 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Rob Preece" <Rob.Preece@msfc.nasa.gov> wrote in message
news:Rob.Preece-1104021521040001@biggamma.nsstc.nasa.gov...
>
> I have a *very* good reason for doing it this way (otherwise, why
> bother! ;) I have a set of keywords to pass on to an embedded plot
> routine, and I can't know at the time what their values will be. I
> have a plot zooming function in a widget (object) that simply calls
> the object's 'PLOT' method, passing new x and y ranges. The plot
> method does some stuff, and then hands it all off to the IDL
> (direct) PLOT routine, adding in the 'XRANGE' and 'YRANGE' keywords
> so that they can be overridden when the 'ZOOM' method is
> invoked. Very much like 'test1' in my sample code. Since I followed
> the documentation as Mark H. mentioned, is this a valid bug in IDL?
> How to proceed?

Yes it's a bug. Report it to IDL.

Re the need to do it this way, if you're passing specific keywords
then you don't *need* to use inheritance. Eg this...

PRO test1, _REF_EXTRA=extra
test2, INDGEN (10), _EXTRA = ['TITLE','XTITLE','YTITLE', 'XRANGE']
END

...can be written...

PRO test1, TITLE=title, XTITLE=xtitle, YTITLE=ytitle, XRANGE=xrange
test2, INDGEN (10), TITLE=title, XTITLE=xtitle, YTITLE=ytitle, $
XRANGE=xrange
END

(I note that your original test1 was a little more complicated than
the one I have written. Was there a reason for that?)

If you want to direct different keywords to different routines you can
do this.

PRO test1, TITLE=title, XTITLE=xtitle, YTITLE=ytitle, XRANGE=xrange
test2, INDGEN (10), TITLE=title, XTITLE=xtitle,
test3, YTITLE=ytitle, XRANGE=xrange
END

or even

PRO test1, TITLE=title, XTITLE=xtitle, YTITLE=ytitle, XRANGE=xrange, $
_EXTRA=extra
test2, INDGEN (10), TITLE=title, XTITLE=xtitle,
test3, YTITLE=ytitle, XRANGE=xrange
test4, _EXTRA=extra
END

Defaults can be supplied and overridden for explicit or inherited
keywords, eg:

PRO test1, KEY1=key1, _EXTRA=extra
if n_elements(key1) eq 0 then key1 = 33
test2, indgen(10), KEY1=key1, KEY2=33, _EXTRA
END

The default for key1 is obvious, What's not so obvious is that if I
call

IDL> test1, KEY2=66

then this value is passed to test2, overriding 33.

Warning: if you use this last technique with IDL 5.4 you must use
inheritance by value not reference because there was a bug in 5.4.

Of course with the different bugs in different versions you may well
decide to leave your code as it is and stick with 5.4!

--
Mark Hadfield
m.hadfield@niwa.co.nz Ka puwaha et tai nei
http://katipo.niwa.co.nz/~hadfield Hoea tatou
National Institute for Water and Atmospheric Research (NIWA)
Re: _EXTRA inheritance crashing IDL [message #30267 is a reply to message #30208] Thu, 11 April 2002 13:28 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rob Preece (Rob.Preece@msfc.nasa.gov) writes:

> I have a *very* good reason for doing it this way (otherwise, why bother!
> ;) I have a set of keywords to pass on to an embedded plot routine, and I
> can't know at the time what their values will be. I have a plot zooming
> function in a widget (object) that simply calls the object's 'PLOT'
> method, passing new x and y ranges. The plot method does some stuff, and
> then hands it all off to the IDL (direct) PLOT routine, adding in the
> 'XRANGE' and 'YRANGE' keywords so that they can be overridden when the
> 'ZOOM' method is invoked. Very much like 'test1' in my sample code. Since
> I followed the documentation as Mark H. mentioned, is this a valid bug in
> IDL? How to proceed?

Yeah, I learned something new yesterday. :-(

It looks to me like you followed the documentation exactly. So it
looks like a bug to me. I'd contact RSI and see what they say.
And be sure to let us know.

> Maybe I'll just go for a beer (unfortunately, no good Colorado brews make
> it into Alabama!)...

Well, I'll buy you a Fat Tire if you are ever out
this way. :-)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Finding the Non-Matching elements in two vectors
Next Topic: Vector Field Plot on Irregular Grid

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

Current Time: Wed Oct 08 19:23:55 PDT 2025

Total time taken to generate the page: 0.00507 seconds