Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 159363 - gnome-pty-helper doesn't clean up gnome-terminals' utmp/wtmp entries when killed
Summary: gnome-pty-helper doesn't clean up gnome-terminals' utmp/wtmp entries when killed
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: vte
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact:
Whiteboard: RHEL3U7NAK
Depends On:
Blocks: 170445
TreeView+ depends on / blocked
Reported: 2005-06-01 22:32 UTC by David Lehman
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-03-24 12:14:39 UTC
Target Upstream Version:

Attachments (Terms of Use)
Catch SIGHUP and SIGTERM so we can clean up login records (deleted)
2005-06-01 22:32 UTC, David Lehman
no flags Details | Diff

System ID Priority Status Summary Last Updated
GNOME Bugzilla 312373 None None None Never

Description David Lehman 2005-06-01 22:32:16 UTC
Created attachment 115067 [details]
Catch SIGHUP and SIGTERM so we can clean up login records

Comment 1 David Lehman 2005-06-01 22:32:16 UTC
Description of problem:
The utmp entries of gnome-terminals run under vnc don't get cleaned up if the
vnc session is killed via 'vncserver -kill <display>'. This is because vncserver
doesn't just kill the gnome-terminals as a user would, but rather kills all
child processes, which includes gnome-pty-helper. gnome-pty-helper just dies,
leaving the stale utmp/wtmp entries to potentially confuse subsequent users of
'/bin/who -u', which isn't supposed to show entries for dead processes.

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

How reproducible:

Steps to Reproduce:
(This occurs naturally when a vncserver running gnome-terminals is killed using
'vncserver -kill <display number>' but the below process is much simpler)
1. start a gnome-terminal (note the tty)
2. kill both the gnome-terminal and gnome-pty-helper with SIGHUP
3. check 'who -u' output
Actual results:
The entry for the gnome-terminal is still there although the terminal is gone

Expected results:
No 'who -u' output for dead gnome-terminal

Additional info:
I've seen the gnome-terminal get SIGPIPE and as a result send SIGTERM to
gnome-pty-helper and I've also seen gnome-pty-helper get SIGHUP from (I guess)

Comment 2 Bastien Nocera 2005-08-02 15:08:25 UTC
Pushed upstream:

Comment 3 Bastien Nocera 2005-08-05 08:27:53 UTC
Patch was committed to HEAD upstream.

Comment 5 Ray Strode [halfline] 2005-10-24 17:10:08 UTC
Hi guys,

That patch looks a little off.  shutdown_helper() probably can't be called
legally from a signal handler.  If it can't then the patch could lead to all
sorts of weirdnesses like segfaults, process lock ups, etc.

Comment 6 Bastien Nocera 2005-10-24 17:34:56 UTC
And some sucker committed that upstream already ;)

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