Bug 177366 - tcsh scripts do not allow programs to run sigint handlers with Ctrl-C
tcsh scripts do not allow programs to run sigint handlers with Ctrl-C
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: tcsh (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Miloslav Trmač
Bill Huang
:
Depends On:
Blocks: 884937 1330850
  Show dependency treegraph
 
Reported: 2006-01-09 22:14 EST by Davyd
Modified: 2016-04-27 02:54 EDT (History)
0 users

See Also:
Fixed In Version: 6.14-6.fc5.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 884937 (view as bug list)
Environment:
Last Closed: 2006-03-20 14:33:37 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
testrl.c (771 bytes, text/plain)
2006-01-09 22:14 EST, Davyd
no flags Details
testrl.csh (131 bytes, text/plain)
2006-01-09 22:16 EST, Davyd
no flags Details
trimmed strace.log from 6.14 (19.49 KB, text/plain)
2006-01-09 22:23 EST, Davyd
no flags Details
trimmer strace.log from 6.12 (18.19 KB, text/plain)
2006-01-09 22:26 EST, Davyd
no flags Details

  None (edit)
Description Davyd 2006-01-09 22:14:33 EST
Description of problem:
A tcsh script (attached) does not allow for long running processes (test case
attached) to execute their signal handler, before pulling the rug out from
underneath them. This is not a problem in bash, nor is it a problem in tcsh 6.12.

Version-Release number of selected component (if applicable):
tcsh-6.14-1

How reproducible:
Always.

Steps to Reproduce:
1. Execute shell script ./testrl.csh
2. Ctrl-C
3. Attempt to use interrupt handler
  
Actual results:
Interrupt handler is started and then aborted.

Expected results:
Interrupt handler is able to run as it would in bash.

Additional info:
Adding 'onintr -' before the ./testrl in the script allows the interrupt handler
to execute as expected. This was not required previously, and breaks tcsh
compatibility. I checked for an 'onintr' statement in any config files from
Redhat 8, none were found.

Compile testrl.c with `gcc -o testrl testrl.c -lreadline -lhistory -lcurses`
Comment 1 Davyd 2006-01-09 22:14:33 EST
Created attachment 122981 [details]
testrl.c
Comment 2 Davyd 2006-01-09 22:16:12 EST
Created attachment 122982 [details]
testrl.csh

Run (from csh or bash) with ./testrl.csh
Comment 3 Davyd 2006-01-09 22:23:00 EST
Created attachment 122984 [details]
trimmed strace.log from 6.14

`strace -f -o /tmp/strace-tcsh-6.14.log ./testrl.csh`

It is worth noting that the signal handler behaves correctly inside strace.

The sleep() is on line 212.
Comment 4 Davyd 2006-01-09 22:26:03 EST
Created attachment 122985 [details]
trimmer strace.log from 6.12

strace -f -o /tmp/strace-tcsh-6.12.log /share/temp/tcsh testrl.csh

The sleep() is on line 181.

Notice here that "killed by SIGINT" is on line 261 (ie. the end) rather than,
215 (which is before the interrupt handler in the testrl binary).
Comment 5 Davyd 2006-01-09 22:28:19 EST
It is worth noting here that everything behaves normally if you send SIGINT to
testrl, ie. `killall -INT testrl`.
Comment 6 Miloslav Trmač 2006-01-11 05:24:07 EST
(I had some trouble identifying the failure, so for future reference:)
tcsh does not block SIGINT while waiting on children and can thus be killed
before the child process.

The example program SIGSEGV's on Ctrl+D in readline, but that is irrelevant.
Comment 7 Miloslav Trmač 2006-02-19 00:39:45 EST
Please test tcsh-6.14-1.fc4.1 in Fedora Core testing updates repository.
Comment 8 Fedora Update System 2006-03-20 11:33:40 EST
tcsh-6.14-6.fc5.1 has been pushed for FC5, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 9 Miloslav Trmač 2006-03-20 14:33:37 EST
Thanks for your report.

Note You need to log in before you can comment on or make changes to this bug.