fascinating bug to do with apm and child processes...

Carsten Haitzler (The Rasterman) raster at openmoko.org
Wed May 14 14:12:00 CEST 2008

On Wed, 14 May 2008 13:06:01 +0100 Andy Green <andy at openmoko.com> babbled:

> Hash: SHA1
> Somebody in the thread at some point said:
> |        WNOHANG     return immediately if no child has exited.
> |
> | so under no circumstances should this ever hang... but oooh. it does. now
> | interestingly i attached to apm to see what it was doing.. and
> lo-and-behold,
> | it woke up and continued to execute then exited with sh reaping the
> child then
> | e reaping the sh and e waking up again:
> There's some process freezing step as part of entering suspend, I guess
> it is to do with that.  FWIW echo mem > /sys/power/state also the echo
> never returns until it comes back in resume.

sure - but the system never suspended - it stayed alive. that's why i could
debug :) the problem is a sigchld has been issued for a process that hasn't
fully exited and waitpid() is blocking even with WNOHANG. it should never block
- ever. doesn't matter what the child is doing. :) never hang. ever! :) the
problem is the freeze of the apm process propagates to all its parents - when i
do know that ecore (the lib for e handling this) is carefully written to avoid
such hangs. :) 

> Roh sent an amusing link once about the madness of suspending processes
> in Linux maybe he can dig it out and post it here.
> - -Andy
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
> iEYEARECAAYFAkgq1akACgkQOjLpvpq7dMoyvgCePYeqi2EGeXAwWgeJpQ8TiEAw
> k14An3438OCOZIsF1Npo9pGZRTzzwnFx
> =txG5

Carsten Haitzler (The Rasterman) <raster at openmoko.org>

More information about the openmoko-kernel mailing list