[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with spawn on Linux
- Subject: Problems with spawn on Linux
- From: ftjec(at)uaf.edu
- Date: Wed, 15 Dec 1999 22:56:34 GMT
- Newsgroups: comp.lang.idl-pvwave
- Organization: Deja.com - Before you buy.
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:17753
Hello,
I am having problems with the spawn command on Linux. I am using the
unit parameter to spawn to obtain a pipe to the child process and use
this pipe to moniter the child's progress. The code I have works fine
on the sun I coded it for originally -- but on linux I get very
unpredictable results. Sometimes the process is spawned, yet no output
is generated, sometimes it works fine, and sometimes it crashes idl
completely with a "bus error" message.
Does anyone know of a solution to this problem?
Also any advice on the general state of idl on Linux would be greatly
apprecated.
Thanks --
Jay
ftjec@uaf.edu
I wrote a simple test program to trick this problem:
pro foo
tmpstr = "the quick brown fox jumped over the lazy dog"
unit = 69
on_ioerror, io_err
i = 0
while ( 1 eq 1 ) do begin
i = i + 1
print, "Working on " + string(i)
spawn, 'ls ', unit=unit, /SH
;-- EOF of a pipe appears to be always FALSE. Strange.
;-- Just used to check that output was generated.
while ( EOF(unit) eq 0) do begin
readf, unit, tmpstr, format='(a)'
print, tmpstr
end
goto, done
io_err:
free_lun, unit
done:
if ( i > 10 ) then goto, finished
end
Here is the output on the sun machine:
Working on 1
foo.pro
init
status_watch.pro
Working on 2
foo.pro
init
status_watch.pro
Working on 3
foo.pro
init
status_watch.pro
Working on 4
foo.pro
init
status_watch.pro
Working on 5
foo.pro
init
status_watch.pro
Working on 6
foo.pro
init
status_watch.pro
Working on 7
foo.pro
init
status_watch.pro
Working on 8
foo.pro
init
status_watch.pro
Working on 9
foo.pro
init
status_watch.pro
Working on 10
foo.pro
init
status_watch.pro
Working on 11
foo.pro
init
status_watch.pro
On the linux box -- Note that everything after the 4th spawn is just
failing and not generating any output. It always appears to fail, but
not always at the same spot. Some times idl just crashes and dumps me
back to my shell.
Working on 1
foo.pro
init
status_watch.pro
Working on 2
foo.pro
init
status_watch.pro
Working on 3
foo.pro
init
status_watch.pro
Working on 4
foo.pro
init
status_watch.pro
Working on 5
Working on 6
Working on 7
Working on 8
Working on 9
Working on 10
Working on 11
Sent via Deja.com http://www.deja.com/
Before you buy.