After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 330960 - gnome-pty-helper hangs on gnome-terminal shutdown
gnome-pty-helper hangs on gnome-terminal shutdown
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-13 07:36 UTC by Colin Gibbs
Modified: 2006-04-12 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't do the cleanup from the signal handler (1.09 KB, patch)
2006-02-13 07:38 UTC, Colin Gibbs
none Details | Review

Description Colin Gibbs 2006-02-13 07:36:15 UTC
Here is where it's stuck:
  • #0 __lll_mutex_lock_wait
    from /lib/tls/libc.so.6
  • #1 _L_mutex_lock_51
    from /lib/tls/libc.so.6
  • #2 ??
    from /lib/tls/libc.so.6
  • #3 ??
  • #4 setutxent
    from /lib/tls/libc.so.6
  • #5 setutxent
    from /lib/tls/libc.so.6
  • #6 update_utmp
    at gnome-utmp.c line 159
  • #7 write_logout_record
    at gnome-utmp.c line 257
  • #8 shutdown_pty
    at gnome-pty-helper.c line 238
  • #9 shutdown_helper
    at gnome-pty-helper.c line 249
  • #10 exit_handler
    at gnome-pty-helper.c line 661
  • #11 <signal handler called>
  • #12 __read_nocancel
    from /lib/tls/libc.so.6
  • #13 internal_getut_r
    from /lib/tls/libc.so.6
  • #14 pututline_file
    from /lib/tls/libc.so.6
  • #15 pututline
    from /lib/tls/libc.so.6
  • #16 pututxline
    from /lib/tls/libc.so.6
  • #17 update_utmp
    at gnome-utmp.c line 160
  • #18 write_logout_record
    at gnome-utmp.c line 257
  • #19 shutdown_pty
    at gnome-pty-helper.c line 238
  • #20 main
    at gnome-pty-helper.c line 555

So what happens is when gnome-terminal closes it tells gnome-pty-helper to write  logout records then sends the SIGTERM. If gnome-pty-helper is in the middle of writing those records when the signal handler is invoked, you get a hang when libc tries to reenter the utx routines.
Comment 1 Colin Gibbs 2006-02-13 07:38:57 UTC
Created attachment 59237 [details] [review]
Don't do the cleanup from the signal handler

Wait until return from the signal handler to clean up and terminate.
Comment 2 Behdad Esfahbod 2006-04-12 09:50:24 UTC
Well, believe it or not!  I already committed a patch VERY similar to yours on the same date that you reported and attached this patch!!!  I never saw your report until tonight!  I just did it because I saw a race condition in there when looking at gnome-pty-helper to fix bug #331056.

Very very weird...

Here is the what I committed:

  http://cvs.gnome.org/viewcvs/vte/gnome-pty-helper/gnome-pty-helper.c?r1=1.9&r2=1.10

Note that I kept one of the shutdown_helper calls, the one that should exit(1), but you change it and return 0;