W
Willem
Hi,
I'm having a weird problem involving threads and calls to system()
Note: it only fails on some systems, notably a Windows NT 2003 server.
The issue is that when I call system() in the main thread, everything works
like it should, but when I call it in a subthread, it fails with the
following message:
Can't spawn "cmd.exe": No such file or directory at test-bug.pl line 10.
foo
This is the test program as minimal as I could get it:
use warnings;
use strict;
use threads;
threads->create(\&tests)->join();
tests();
sub tests { system('echo foo') }
It fails on both perl 5.8.8 built for MSWin32-x86-multi-thread
and perl 5.10.x, using Activestate.
The value of $? seems to be 255<<8, so that's a return code
of -1 from the shell.
Piped open fails as well, as do backticks. Probably for the same reason.
Can anyone shed any light on this ? I've tried googling, but I haven't
found anything specific to threading.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
I'm having a weird problem involving threads and calls to system()
Note: it only fails on some systems, notably a Windows NT 2003 server.
The issue is that when I call system() in the main thread, everything works
like it should, but when I call it in a subthread, it fails with the
following message:
Can't spawn "cmd.exe": No such file or directory at test-bug.pl line 10.
foo
This is the test program as minimal as I could get it:
use warnings;
use strict;
use threads;
threads->create(\&tests)->join();
tests();
sub tests { system('echo foo') }
It fails on both perl 5.8.8 built for MSWin32-x86-multi-thread
and perl 5.10.x, using Activestate.
The value of $? seems to be 255<<8, so that's a return code
of -1 from the shell.
Piped open fails as well, as do backticks. Probably for the same reason.
Can anyone shed any light on this ? I've tried googling, but I haven't
found anything specific to threading.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT