Bug 597928

Summary: shell suspend won't work
Product: [Fedora] Fedora Reporter: doug
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: aquini, djast, jeff, kdudka, maxamillion, ovasik, rhbugz, twaugh, vcrhonek
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: coreutils-8.12-6.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 681598 (view as bug list) Environment:
Last Closed: 2011-08-23 13:05:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
change to 1.22 file: properly propagate upstream stop signals in su none

Description doug 2010-05-31 02:50:46 UTC
Description of problem:


I've seen this in Fedora 13 and 11. I know that is used to work at least as far back as Fedora7, I'm not sure when it broke.

How reproducible:


Steps to Reproduce:
1. log in a user with tcsh shell
2. become root via su
3. type "suspend"
  
Actual results:

Nothing happens, you stay as root

Expected results:

It should do "Suspended (signal)" and put you back into your user shell

Additional info:

Comment 1 Tim Eliseo 2010-07-03 22:25:42 UTC
Created attachment 429307 [details]
change to 1.22 file: properly propagate upstream stop signals in su

This is actually not a bug with tcsh, but with /bin/su in coreutils. The following recent change broke the behavior of "suspend" in tcsh, and affects Fedora 11, 12, 13, and rawhide:

http://cvs.fedoraproject.org/viewvc/devel/coreutils/coreutils-pam.patch?r1=1.21&r2=1.22

The issue lies with su attempting to propagate stop signals from its child (tcsh) to itself, which will notify its parent (presumably another shell). The previous version (1.21) was incorrect in that it always sent itself a SIGSTOP regardless of what type of signal was received (the "suspend" command in tcsh sends a SIGTSTP). This worked because SIGSTOP can't be blocked (masked). The 1.22 version attempted to fix this by directly propagating the signal, but failed for SIGTSTP because it was blocked. My patch fixes both problems. The relevant code change is:

+  /* tcsh sends SIGTSTP to the process group, and so is already pending */
   kill(getpid(), WSTOPSIG(status));
+  if (WSTOPSIG(status) != SIGSTOP) {
+    sigemptyset(&blockset);
+    sigaddset(&blockset, WSTOPSIG(status));
+    sigprocmask(SIG_UNBLOCK, &blockset, &ourset);
+    /* signal taken here */
+    sigprocmask(SIG_SETMASK, &ourset, NULL);
+  }

Comment 2 Chris Osborn 2010-07-26 18:18:07 UTC
I've been having the same problem on both Fedora 12 and 13. So fare my workaround has been:

alias suspend kill -STOP $$

Comment 3 Fedora Admin XMLRPC Client 2010-11-01 11:16:32 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Vojtech Vitek 2011-04-14 15:08:32 UTC
Moving bz to coreutils component.

Comment 5 Bug Zapper 2011-06-02 12:42:48 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 6 Chris Osborn 2011-06-02 14:09:04 UTC
This bug still exists on Fedora 14

Comment 7 Ondrej Vasik 2011-08-23 13:05:00 UTC
Fixed in coreutils-8.12-6.fc17 .

Comment 8 Fedora Update System 2012-01-30 13:05:43 UTC
coreutils-8.12-6.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/coreutils-8.12-6.fc16

Comment 9 Fedora Update System 2012-02-08 22:59:48 UTC
coreutils-8.12-6.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.