Array has a corrupted descriptor [message #25164] |
Mon, 21 May 2001 06:00  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Hi,
I got an error sometimes in one of my routines only on AIX.
-- IDL> help,!version,/str
** Structure !VERSION, 7 tags, length=44:
ARCH STRING 'ibmr2'
OS STRING 'AIX'
OS_FAMILY STRING 'unix'
RELEASE STRING '5.4.1'
BUILD_DATE STRING 'Jan 16 2001'
MEMORY_BITS INT 32
FILE_OFFSET_BITS
INT = 32
The same routine works on linux and windows.
The error text is:
% Array has a corrupted descriptor: VAR
the calling sequence is something like this
var=function(x)
First I like to know what's this error is meaning.
It seems to me that's the RETURN statement won't work.
The result value of my function is good.
If it reachs the calling level of the function I got
this error.
Any ideas are welcome.
regards
Reimar
Reimar Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg1/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
http://www.fz-juelich.de/zb/text/publikation/juel3786.html
============================================================ ====== Array
has a corrupted descriptor
read something about linux / windows
http://www.suse.de/de/news/hotnews/MS.html
|
|
|
Re: Array has a corrupted descriptor [message #58695 is a reply to message #25164] |
Wed, 13 February 2008 03:02  |
zhouqiang.search
Messages: 6 Registered: February 2008
|
Junior Member |
|
|
On 12 Feb, 18:38, "Peter Mason" <peter.ma...@deleteme.csiro.au> wrote:
> zhouqiang.sea...@gmail.com wrote:
>
> <...>> IDL_DCOMPLEX *result = argv[2];
> <...>
>> result = complexarr(row , line)
>
> <...>
>
> Aside from the index-calc issue pointed out in the other post...
> You make a single-precision complex array (2 * 4 bytes per element) on the
> IDL side but you handle it as a double-precision one (2 * 8 bytes per
> element) on the C side. Your C code is going past the end of this array,
> tramping over things it shouldn't.
> In your C code, use IDL_COMPLEX instead of IDL_DCOMPLEX.
>
> Cheers
> Peter Mason
Hi , peter
I have fixed the problem this morning , just as you said , I took a
mistake about the data type.
Thanks for your reply. Because I am really new to use IDL , and I am
not very familiar about that ,
I think I need to work hard.
|
|
|
Re: Array has a corrupted descriptor [message #58697 is a reply to message #25164] |
Tue, 12 February 2008 15:38  |
Peter Mason
Messages: 145 Registered: June 1996
|
Senior Member |
|
|
zhouqiang.search@gmail.com wrote:
<...>
> IDL_DCOMPLEX *result = argv[2];
<...>
> result = complexarr(row , line)
<...>
Aside from the index-calc issue pointed out in the other post...
You make a single-precision complex array (2 * 4 bytes per element) on the
IDL side but you handle it as a double-precision one (2 * 8 bytes per
element) on the C side. Your C code is going past the end of this array,
tramping over things it shouldn't.
In your C code, use IDL_COMPLEX instead of IDL_DCOMPLEX.
Cheers
Peter Mason
|
|
|
|
Re: Array has a corrupted descriptor [message #58702 is a reply to message #25164] |
Tue, 12 February 2008 10:00  |
Foldy Lajos
Messages: 268 Registered: October 2001
|
Senior Member |
|
|
On Tue, 12 Feb 2008, zhouqiang.search@gmail.com wrote:
> HI , folks
>
> I try to complete a program with IDL invoking some function from
> C ,it works well when I passing a float , double
> array , and return a same type with input . Now there is a problem
> that it didn't work while passing a complex array.
> And the error "array has a corrupted descriptor" every time. I am a
> newer with IDL , and I don't know too much
> about that , if anyone can help me, please accept my wonderful
> appreciate.
>
> -----------------------c program-----------------------
> DLLIMPORT void array_test(int argc, void *argv[])
> {
> int nr = *(int *) argv[0];
> int ni = *(int *) argv[1];
>
> // int *result = argv[2];
> IDL_DCOMPLEX *result = argv[2];
> int i , j;
> for(i = 0;i< ni ; i++)
> {
> for(j=0;j<nr;j++)
> {
>
> result[i*ni+j].r = 5 ;
> result[i*ni+j].i = 10 ;
^^^^^^
Try i*nr+j
regards,
lajos
> }
> }
>
> }
>
> ----------------IDL program---------------------
>
>
> function test1 , row , line
> ; result= lonarr(row,line)
> result = complexarr(row , line)
> s = call_external('C:\_test\test3\Project3.dll', 'array_test',row ,
> line , result)
> return, result
> end
>
> pro test
> ;p=lonarr(5,5)
> p = complexarr(5,5)
> p = test1(5,5)
> print , p
> end
>
|
|
|