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

Home » Public Forums » archive » Re: Keyword DLM crashes with IDL 5.2?
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
Re: Keyword DLM crashes with IDL 5.2? [message #24883] Mon, 30 April 2001 09:53 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Randall Skelton <rhskelto@atm.ox.ac.uk> writes:

> 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
...

Are you trying to run the same compiled DLM in both IDL 5.2 and 5.3?
Others can correct me if I'm wrong, but I believe that binary DLMs are
not guaranteed to be compatible between IDL versions. The problem is
that structure definitions and other binary interfaces change between
versions.

If you recompiled it for IDL 5.2 then that's a different story!

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: Keyword DLM crashes with IDL 5.2? [message #24884 is a reply to message #24883] Mon, 30 April 2001 09:57 Go to previous message
Randall Skelton is currently offline  Randall Skelton
Messages: 169
Registered: October 2000
Senior Member
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
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Keyword DLM crashes with IDL 5.2?
Next Topic: how to speed up multiple regressions?

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

Current Time: Wed Oct 08 19:41:53 PDT 2025

Total time taken to generate the page: 0.00632 seconds