Bug 676

Summary: Sudo 1.8.11 doesn't reap it's children
Product: Sudo Reporter: ftigeot
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal CC: joris
Priority: low    
Version: 1.8.11   
Hardware: PC   
OS: Other   
Attachments: Make sure SIGCHLD is not treated as a user-generate signal

Description ftigeot 2014-11-04 00:05:41 MST
OS: DragonFly BSD 4.0-RC and 4.1

Sudo 1.8.11 fails to reap it's child processes, leaving zombies and never returning to the original prompt. Sudo then fails to listen to term signals, requiring kill signals to take them down. This affects the latest version of sudo in the packages and tested on the 4.0 RC. To be clear, sudo commands will be invoked successfully, but the prompt will not be returned.

How to reproduce:

* run sudo /bin/sh
* try to exit the new /bin/sh shell

This bug had originally been reported in the DragonFly bug tracker by  zcrownover :
http://bugs.dragonflybsd.org/issues/2728
Comment 1 Todd C. Miller 2014-11-04 08:10:04 MST
This sounds similar to Bug 657.  Somehow sudo is either not receiving SIGCHLD or there is a problem with the event loop.

If you could ktrace the sudo process that might give me enough information to track down the problem.
Comment 2 Todd C. Miller 2014-11-04 09:18:30 MST
*** Bug 677 has been marked as a duplicate of this bug. ***
Comment 3 Todd C. Miller 2014-11-04 09:19:37 MST
Created attachment 435 [details]
Make sure SIGCHLD is not treated as a user-generate signal

Please try the attached patch.
Comment 4 joris 2014-11-04 09:44:38 MST
Sorry i missed  this bug and opened a new one.

The attached patch fix the issue.
Comment 5 ftigeot 2014-11-05 08:58:21 MST
Thank you for the patch, it effectively fixes the issue.

The fixes have been pushed to DragonFly's DeltaPorts repository.
https://github.com/DragonFlyBSD/DeltaPorts/commit/81a01d411a95b21341361e0d30d4a571edf5f610

Hopefully a new sudo release will include them in the future and we will be able to remove the local patches.
Comment 6 Todd C. Miller 2014-11-16 07:03:37 MST
This fix will be included in sudo 1.8.12, currently in beta.
Comment 7 Todd C. Miller 2015-02-09 15:12:17 MST
Fixed in sudo 1.8.12, available now.