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

Home » Public Forums » archive » SPAWN exit status different from shell exit status.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
SPAWN exit status different from shell exit status. [message #88872] Mon, 30 June 2014 07:04 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Hello,

I'm trying to run a compiled executable within IDL.

When I run the exe in a regular shell I get the following:

$ myexe

Program received signal SIGSEGV: Segmentation fault - invalid memory
reference.

Backtrace for this error:
#0 0x7FD97E7ADA77
#1 0x7FD97E7AE07E
#2 0x3000C3299F
#3 0x45EBBB in sub1_
#4 0x47688D in sub2_
#5 0x409A9F in sub3_
#6 0x42BABA in MAIN__ at myprog.f90:0
Segmentation fault (core dumped)


If I inspect the exit value I see:


$ echo $?
139


Now, if I do the same thing inside an IDL SPAWN command I get the following:

IDL> SPAWN, 'myexe', stdout, stderr, EXIT_STATUS = exit_stat

IDL> print, exit_stat
0

IDL> help, stderr
STDERR STRING = Array[11]

IDL> print, stderr, format='(a)'

Program received signal SIGSEGV: Segmentation fault - invalid memory
reference.

Backtrace for this error:
#0 0x7F39A545DA77
#1 0x7F39A545E07E
#2 0x3000C3299F
#3 0x45EBBB in sub1_
#4 0x47688D in sub2_
#5 0x409A9F in sub3_
#6 0x42BABA in MAIN__ at myprog.f90:0

So it's still failing but the exit_status is always 0 (i.e. successful)

I've tried the command with /SH and /NOSHELL and get the same result.

Does anyone have any idea why SPAWN is not setting the EXIT_STATUS
correctly?

cheers,

paulv

p.s.
IDL> print, !VERSION
{ x86_64 linux unix linux 8.3 Nov 15 2013 64 64}
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: CPU usage
Next Topic: Need to create a polygon shapefile from a binary mask... any functions that could help?

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

Current Time: Wed Oct 08 16:13:51 PDT 2025

Total time taken to generate the page: 0.00361 seconds