#system() hangs, child is defunct

Hi all,

I am trying to track down the source of an intermittent and tricky
problem. The ruby version is 1.8.6 patchlevel 287. The OS is virtualized
Gentoo, using the free Express image provided by Engine Y., so the
system should be reasonably sane.

The problem is that a rake task hangs indefinitely. Attaching gdb to the
ruby process, and getting a backtrace, I can see that it is hanging on a
#system() call. The system call is used to invoke another Ruby process,
but that Ruby child process has completed as expected, and is listed as
.

If I understand correctly, this means that the parent Ruby process has
failed to acknowledge that the child has exited. Could this be caused by
errors in the parent’s Ruby code?

If anyone is familiar, the offending call takes place in
rspec-1.2.8/lib/spec/rake/spectask.rb:176

Unfortunately, the issue is intermittent (it only hangs in some 20-30%
of cases) and I have no idea of how to narrow it down any further. Any
advice on how to proceed?

best regards,
Tor Erik

Unfortunately, the issue is intermittent (it only hangs in some 20-30%
of cases) and I have no idea of how to narrow it down any further. Any
advice on how to proceed?

Try 1.8.7 or 1.8.x SVN trunk?
-r

The thing is that this is a test setup, so we want to keep it just like
production. I tried running the VM under VirtualBox instead of VMware
Server, which seemed to make the problem go away for now. I would still
like to know what was going on though.

Tor Erik L. wrote:

The thing is that this is a test setup, so we want to keep it just like
production. I tried running the VM under VirtualBox instead of VMware
Server, which seemed to make the problem go away for now. I would still
like to know what was going on though.

Looks like your next step might be to try and trudge through the code
for #system
or switch ruby versions, perhaps–1.9 seems more stable for me than
others.
-r