Bug 177366 - tcsh scripts do not allow programs to run sigint handlers with Ctrl-C
Summary: tcsh scripts do not allow programs to run sigint handlers with Ctrl-C
Alias: None
Product: Fedora
Classification: Fedora
Component: tcsh (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: All Linux
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact: Bill Huang
Depends On:
Blocks: 884937 1330850
TreeView+ depends on / blocked
Reported: 2006-01-10 03:14 UTC by Davyd
Modified: 2016-04-27 06:54 UTC (History)
0 users

Fixed In Version: 6.14-6.fc5.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 884937 (view as bug list)
Last Closed: 2006-03-20 19:33:37 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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-10 03:14 UTC, Davyd
no flags Details
testrl.csh (131 bytes, text/plain)
2006-01-10 03:16 UTC, Davyd
no flags Details
trimmed strace.log from 6.14 (19.49 KB, text/plain)
2006-01-10 03:23 UTC, Davyd
no flags Details
trimmer strace.log from 6.12 (18.19 KB, text/plain)
2006-01-10 03:26 UTC, Davyd
no flags Details

Description Davyd 2006-01-10 03:14:33 UTC
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):

How reproducible:

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-10 03:14:33 UTC
Created attachment 122981 [details]

Comment 2 Davyd 2006-01-10 03:16:12 UTC
Created attachment 122982 [details]

Run (from csh or bash) with ./testrl.csh

Comment 3 Davyd 2006-01-10 03:23:00 UTC
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-10 03:26:03 UTC
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-10 03:28:19 UTC
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 10:24:07 UTC
(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 05:39:45 UTC
Please test tcsh-6.14-1.fc4.1 in Fedora Core testing updates repository.

Comment 8 Fedora Update System 2006-03-20 16:33:40 UTC
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 19:33:37 UTC
Thanks for your report.

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