Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1273500

Summary: Inconsistent state after SIGINT during eval
Product: Red Hat Enterprise Linux 7 Reporter: David Kaferad // Dee'Kej <deekej>
Component: tcshAssignee: David Kaferad // Dee'Kej <deekej>
Status: CLOSED ERRATA QA Contact: Iveta Wiedermann <isenfeld>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: bnater, isenfeld, ovasik, pandrade, qe-baseos-apps
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tcsh-6.18.01-10.el7 Doc Type: Bug Fix
Doc Text:
*tcsh* no longer in an inconsistent state after a command interruption Interrupting the "eval sleep 10" command left the *tcsh* shell in an incosistent state. Consequently, it was necessary to press the Ctrl+D key combination twice to successfully exit the shell. With this update, *tcsh* correctly exits after pressing Ctrl+D once.
Story Points: ---
Clone Of: 1219923 Environment:
Last Closed: 2016-11-04 01:46:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1219923    
Bug Blocks: 1203710, 1289025, 1295829, 1313485    

Description David Kaferad // Dee'Kej 2015-10-20 15:05:54 UTC
+++ This bug was initially created as a clone of Bug #1219923 +++

Description of problem (quoting cloned bug description):
--------------------------------------------------------

This was reported to upstream:

"""
Hi,

An user reported a problem, that apparently happens for quite
some time.

The user reports that interrupting this command:

eval sleep 10

would keep history in tcsh-6.14.00, but not in tcsh-6.18.01.
Actually, I believe the history not being logged is due to
http://pkgs.fedoraproject.org/cgit/tcsh.git/tree/tcsh-6.18.00-history-file-locking.patch

and the problem is another, as the inconsistent state
happens in all tcsh versions. Basically, when doeval()
calls process(), process() does not leave, so one needs
to ^D twice to get back to the consistent state.

The attached patch correct this condition, and based
on code I could read is correct, but I would like some
feedback on it.

Thanks,
Paulo
"""

-----------------

Version-Release number of selected component (if applicable):
tcsh-6.18.01-8.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. run 'tcsh'.
2. run command:
> eval sleep 10
3. press <Ctrl-C> during that time
4. press <Ctrl-D> to close the terminal

Actual results:
You have to press <Ctrl-D> once again to actually exit the terminal.

Expected results:
The 'tcsh' exits normally after first pressing of <Ctrl-D>.

--- Additional comment from Paulo Andrade on 2015-05-09 08:59:43 EDT ---

Update patch, as initially proposed patch would
break the shell (was exiting if pressing ^C),
while the idea was to just leave the inconsistent
state after ^C during eval.

--- Additional comment from FridolĂ­n PokornĂ˝ on 2015-05-13 08:31:13 EDT ---

Thanks for the report and provided patch!

It looks OK to me and it sounds reasonable to merge this patch, no fail noted in upstream testsuite as well.

--- Additional comment from David Kaspar [Dee'Kej] on 2015-10-20 07:12:21 EDT ---

Here is the mailing list conversation mentioned in the comment #0:
http://mx.gw.com/pipermail/tcsh-bugs/2015-May/000925.html

--- Additional comment from David Kaspar [Dee'Kej] on 2015-10-20 07:22:03 EDT ---

The conversation in the mailing list might be misleading to somebody - it might look like the patch was not accepted:

> And removed. This breaks the shell completely; a ^C makes it exit.
>
> christos

However, will small tweak, the patch was accepted by the upstream:
https://github.com/tcsh-org/tcsh/commit/5376dd911afa817a802aa736a69b3c0546b2b188

Comment 6 errata-xmlrpc 2016-11-04 01:46:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2260.html