Bug 697340

Summary: dc ignores SIGINT.
Product: [Fedora] Fedora Reporter: Van de Bugger <van.de.bugger>
Component: bcAssignee: Ondrej Vasik <ovasik>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: rawhideCC: ovasik
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-08 13:56:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Van de Bugger 2011-04-17 21:59:18 UTC
Description of problem:

dc ignores SIGINT. Neither Ctrl+C nor "kill -s SIGINT <pid>" effects the running dc program.

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

dc (GNU bc 1.06.95) 1.3.95
bc-1.06.95-2.fc14.x86_64.rpm
Fedora 14 at x86_64

How reproducible:

Always.

Steps to Reproduce:

1. Install bc (usually it is installed by default).
2. Run dc.
3. Press Ctrl+C
  
Actual results:

$ dc
^C

(Program continues.)

Expected results:

Program exits.

Additional info:

bc, in contrast, respects SIGINT:

$ bc
bc 1.06.95
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
^C
(interrupt) Exiting bc.
$

Wrong behaviour of dc is a regression, but not recent one. Long time ago dc respected Ctrl+C and exited.

It is annoying a little bit. Sometime I wrongly type "dc" instead of "cd". Instead of changing directory dc starts. The first reaction is pressing Ctrl+C to interrupt it, but dc ignores Ctrl+C.

Comment 1 Ondrej Vasik 2011-04-18 06:09:55 UTC
Seems to be intentional - see http://www.gnu.org/software/bc/manual/dc-1.05/text/dc.txt - C-c is used to abort macros
that are looping, etc. - however given the fact that there is a sentence "Currently this is not true; `C-c' does exit." , fact that this change is not documented in man page and there was no upstream release of bc for 5 years, it should be safe to revert the behaviour - as you are right that this typo might happen to anyone.
I'll check the best way how to not break aborting macros and give C-c for quit back.

Comment 2 Ondrej Vasik 2011-09-08 13:56:30 UTC
Ok, changed to not mask SIGINT/C-c when running on stdin (so just accidently used dc command) ... Closing RAWHIDE.