[email protected]
[Top] [All Lists]

Bug#481578: marked as forwarded (unhide: Ignoring SIGCHLD gives tons of

Subject: Bug#481578: marked as forwarded unhide: Ignoring SIGCHLD gives tons of false positives
From: Debian Bug Tracking System
Date: Sun, 18 May 2008 00:36:03 +0000
Your message dated Sun, 18 May 2008 12:34:23 +1200
with message-id <[email protected]>
has caused the   report #481578,
regarding unhide: Ignoring SIGCHLD gives tons of false positives
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
481578: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481578
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Subject: unhide: Ignoring SIGCHLD gives false positives
From: Francois Marier
Date: Sun, 18 May 2008 12:34:23 +1200
Hello Yago,

Here's a problem that a Debian user has encountered with unhide reporting
too many hidden processes.

He attached a simple patch for it and it looks reasonable to me. Can you see
anything wrong with it? Is there any reason why I should avoid making that
change?

You will find the patch and the strace output attached to this email.

Cheers,
Francois

----- Forwarded message from Johan Walles <[email protected]> -----

"unhide sys" works like this:
* Do a syscall on a PID.
* If that PID exists:
 * Launch ps using popen()
 * Verify that the PID is listed
 * Close the popen()ed stream with pclose()
 * pclose() implicitly calls wait() to make sure the ps process has finished.

However, since the main() function does signal(SIGCHLD, SIG_IGN), the wait()
call will just return ECHILD, regardless of whether ps has finished or not.

Then, the next syscall finds the ps process that is still alive.  But before
launching the next ps process, the previous one dies.  And we have a hidden
process!

Since this is a race, it behaves erratically, but I sometimes get a list of
over 20 hidden processes this way.  This got much more obvious after
upgrading from 2.6.22 to 2.6.24.

  Regards //Johan

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1-686 (SMP w/2 CPU cores)
Locale: LANG=sv_SE.UTF-8, LC_CTYPE=sv_SE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

----- End forwarded message -----

Attachment: sigchld.diff
Description: Text Data

Attachment: strace.txt
Description: Text document


--- End Message ---
<Prev in Thread] Current Thread [Next in Thread>
  • Bug#481578: marked as forwarded (unhide: Ignoring SIGCHLD gives tons of false positives), Debian Bug Tracking System <=