[Sablevm-developer] Fixed(?) problem with exec()
Brought to you by:
egagnon
From: Grzegorz B. P. <ga...@de...> - 2004-03-04 04:52:02
|
Hi all, I need a confirmation, as I haven't touched this stuff yet and I might be just missing something. exec() is broken in current staging and 1.1.0. If you tried to run such a simple program: public class ExecTest { public static void main(String []args) { try { Process child = Runtime.getRuntime().exec("/bin/sleep 1"); child.waitFor(); } catch(Exception e) { System.out.println("Execution exception catched"); } System.out.println("Execution finished"); } } $ sablevm -Y ExecTest Java_java_lang_ProcessImpl_nativeWaitFor: No child processes Child did not exit normally. strace showed that waitpid() is called twice, second time after the child exited. So I scratched my head and after 3 minutes in src/libsablevm/java_lang_ProcessImpl.c in ..._nativeWaitFor i saw more less such thing: waitpid(pid, &status, 0); if (nonblocking) { waitpid(pid, &status, WNOHANG); } else { waitpid(pid, &status, 0); } Existence of the first waitpid makes no sense to me. I commented it out in just-uploaded sablevm Debian packages as it seemed to solve the problem. Am I missing anything or should it get to staging too? It's quite "grave" thing, I'd say. If it wasn't me who'd have to make the next release, I'd push for 1.1.1 ASAP :-/ Cheers, Grzegorz B. Prokopski -- Grzegorz B. Prokopski <ga...@de...> Debian GNU/Linux http://www.debian.org SableVM - LGPLed JVM http://www.sablevm.org Why SableVM ?!? http://devel.sablevm.org/wiki/WhySableVM |