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

Home » Public Forums » archive » Strange bug in IDL or AIX
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
Strange bug in IDL or AIX [message #231] Mon, 03 February 1992 02:10
dov is currently offline  dov
Messages: 4
Registered: February 1992
Junior Member
I have encountered a very strange bug. I don't know if it belongs
to IDL or AIX. It occurs when I use call_external from IDL.

Here is my idl program bug.pro:

--
1: a=call_external('./bug', ' ')
2:
3: end
--

And here is my external routine bug.c:

--
1: #include <math.h>
2:
3: bugsub(double *r)
4: {
5: *r= sqrt(5.0);
6: }
7:
8: bug(int argc, void *argv[])
9: {
10: }
--

I compile and link the c program with the sequence of commands

cc -O -c bug.c
ld -e bug -o bug bug.o -lm -lc

and then I try to run the program from idl. Here a copy of
idl's output:

IDL> .run bug
% Compiled module: $MAIN$.
% CALL_EXTERNAL: Error loading sharable executable.
Symbol: <not relevant>, File = ./bug

Exec format error
% Execution halted at $MAIN$ <bug2.pro( 1)> (CALL_EXTERNAL).
IDL>

But here comes the strange part. There are several ways this bug can
dissappear. If I change line 5 of bug.c to read:

5: *r=sin(5.0);

the bug dissappears!

The output from idl follows:

IDL> .run bug
% Compiled module: $MAIN$.
IDL>

Or if line 3 and 5 are changed to

3: bugsub(double r)
5: r=sqrt(5.0)

the bug also doesn't appear.

Neither does it appear if line 3 and 4 are changed to (the only
workaround of the bug that I have found...)

3: bugsub(double *rr)
4: { double *r; r=rr;

Does anybody have any idea what is going on here? Where is the bug?
Why is there a difference between sqrt() and sin()?

--
___ ___
/ o \ o \
Dov Grobgeld ( o o ) o |
The Weizmann Institute of Science, Israel \ o /o o /
"Where the tree of wisdom carries oranges" | | | |
_| |_ _| |_
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: MAP_SET for astronomy?
Next Topic: What is IDL.

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

Current Time: Wed Oct 08 15:31:39 PDT 2025

Total time taken to generate the page: 0.00609 seconds