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
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: vte
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ray Strode [halfline]
QA Contact:
URL:
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:
Environment:
Last Closed: 2006-03-24 12:14:39 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 312373 0 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):
vte-0.11.10-11

How reproducible:
Always

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)
vncserver.

Comment 2 Bastien Nocera 2005-08-02 15:08:25 UTC
Pushed upstream:
http://bugzilla.gnome.org/show_bug.cgi?id=312373

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.