Menu

#1684 Can't catch loss of X server displaying slave toplevel

obsolete: 8.3.4
open
4
2005-12-01
2004-03-25
John Seal
No

If a Tcl app on one host is displaying a slave toplevel
on another host, and the remote host logs out (thus
yanking the X server out from under the window), then
the Tcl app dies with XIO error 131 (Connection reset
by peer). Any WM_DELETE_WINDOW protocol or <Configure>
binding on the window does not fire. There does not
seem to be any way in Tcl to catch and handle this
event. I happened to be using ActiveTcl 8.3.4.1, but I
think it's an intrinisic Xlib problem that would affect
any version.

This was discussed on c.l.t and in the Tcl chatroom.

Discussion

  • Joe English

    Joe English - 2004-03-25

    Logged In: YES
    user_id=68433

    Notes:

    The root cause of the problem is that XSetFatalErrorHandler
    is Broken As Designed: the fatal error handler (which is
    called when the server connection is closed unexpectedly) is
    not allowed to return; and if it does, Xlib exit()s anyway.

    It *might* be possible to detect the loss of the server
    connection in the notifier prior to calling XNextEvent.
    Need to investigate further how to clean up the resources
    associated with the display if this occurs. I suspect it
    will be extraordinarily tricky, due to the complexity of
    Tk's shutdown logic.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-12-01
    • priority: 5 --> 4
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-12-01

    Logged In: YES
    user_id=72656

    Is WM_SAVE_YOURSELF something the user can use here?

     
MongoDB Logo MongoDB