[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Keyword DLM crashes with IDL 5.2?
I think I have figured out the answer to my own question...
replace: IDL_KWGetParams(argc,inargv,argk,kw_err,NULL,1)
with: IDL_KWGetParams(argc,inargv,argk,kw_err,argv,1)
^^^^
or any other valid IDL_VPTR pointer array.
From the EDG...
Plain_args is defined as an array of IDL_VPTR into which the
IDL_VPTRs of the positional arguments will be copied. This array must
have enough elements to hold the maximum possible number of positional
arguments as defined in IDL_SYSFUN_DEF2...
Reading the above suggests I need a finite array dimension as I am
expecting to pass 2 plain arguments. The root of my problem was in the
EDG Example code they pass a NULL and I assumed I should do the same. It
is somewhat surprising that it worked in IDL 5.3 and I didn't notice any
bizarre behavior...
Cheers,
Randall
On Mon, 30 Apr 2001, Randall Skelton wrote:
> Date: Mon, 30 Apr 2001 17:29:21 +0100
> From: Randall Skelton <rhskelto@atm.ox.ac.uk>
> Newsgroups: comp.lang.idl-pvwave
> Subject: Keyword DLM crashes with IDL 5.2?
>
> Hi all,
>
> I am trying to port a DLM that works in IDL 5.4/5.3 to work with IDL 5.2.
> As a demonstration of my problem I have modified the file testmodule.c to
> include a simple procedure called 'testr' that takes a keyword and
> distributed it below. It compiles under unix with:
>
> gcc -Wall -Wimplicit -fpic -shared -I/usr/local/PACK/idl-5.3/external
> testmodule.c -o testmodule.so
>
> Execution in IDL is:
>
> IDL> testr, 1, a, ERROR=b
> % Loaded DLM: TESTMODULE.
> IDL> print, a, b
> 10 0
>
> This routine compiles and works just fine under IDL 5.3, but it seg-faults
> during execution with IDL 5.2. Without the keywords, the procedure works
> fine, and I can trace the fault to calling 'IDL_KWGetParams' in IDL 5.2.
> I've read the relevant sections of the EDG at least twice over and after
> an afternoon of fiddling, I cannot find the bug. Any and all help is
> greatly appreciated!
>
> Randall
>