Bug 140202 - makewhatis trap (control-c, et. al) fails to exit (redux)
Summary: makewhatis trap (control-c, et. al) fails to exit (redux)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: man
Version: 3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-21 02:01 UTC by Dale Stimson
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-17 13:01:42 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dale Stimson 2004-11-21 02:01:36 UTC
This was originally reported in March 13, 2003 as bug # 61105.
It was fixed as recommended in rawhide and closed.  Subsequently, the
fix disappeared.

The problem still/again exists.

Reported against man-1.5o1-7 from FC3 errata, but I'm sure present
before that, probably ever since RHL 7.2.

----------------------------------------
Description of Problem:

If running /usr/bin/makewhatis manually, an attempt to terminate
its operation via SIGINT does not exit.  Instead, it just deletes
temp files and continues executing.

The culprit is the statement at line 57:
    trap "rm -rf $TMPFILEDIR" 0 1 2 3 15

If that statement is changed to the following, all is well:
    trap "{ rm -rf $TMPFILEDIR ; exit 255 ; }" 0 1 2 3 15

Version-Release number of selected component (if applicable):
man-1.5i2-6

How Reproducible:
Always

Steps to Reproduce:
1. /usr/sin/makewhatis
2. Let it run for a few seconds, then control-c.

Actual Results:
makewhatis does not exit.  It continues running but with its temp file
deleted.

Expected Results:
makewhatis should exit.  The temp files should be deleted.
This is what happens with the change I suggest above.

Comment 1 Ivana Varekova 2005-03-16 09:27:10 UTC
Thank you for your notice.
It was be fixed (in man-1.5p-2).
Ivana Varekova

Comment 2 Gilles Detillieux 2005-05-10 17:44:10 UTC
A better way of handling the traps would be as follows:

   trap "rm -rf $TMPFILEDIR" 0
   trap "exit 255" 1 2 3 15

That way, you don't force a 255 exit code when the program would otherwise exit
normally.  The rm command will be run whenever the script exits, whether a
normal exit or the exit resulting from the trap placed on the four signals above.

Comment 3 Ivana Varekova 2005-05-11 09:31:49 UTC
You are right your solvation is better, I change it in new version (1.5p-6). 
Thank you for your notice.
Ivana Varekova


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