Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#17 display.close hangs

closed-fixed
nobody
None
5
2006-07-19
2005-06-13
Tim Freeman
No

This two-line program hangs:

from Xlib import display
display.Display().close()

The workaround is to let your program exit without
closing the display.
In this case, I think it is important to explicitly
flush the connection.

Discussion

  • Mike Grant
    Mike Grant
    2006-07-19

    Logged In: YES
    user_id=1175208

    Fixed in CVS.

    The problem was that the flush operation would block in the
    send_and_recv function. It would wait indefinitely for the
    socket to have some data to read. If the send buffer was
    empty (ie. no new requests to generate responses) and the
    xserver had nothing to say, then this would block forever.
    Two flush() calls or the code above would produce this
    condition.

    Fix was to make it timeout instantly like the "receive
    anything you can, then return" mode of operation.

     
  • Mike Grant
    Mike Grant
    2006-07-19

    • status: open --> closed-fixed
     
  • Mike Grant
    Mike Grant
    2006-07-22

    Logged In: YES
    user_id=1175208

    Fixed in CVS.

    The problem was that the flush operation would block in the
    send_and_recv function. It would wait indefinitely for the
    socket to have some data to read. If the send buffer was
    empty (ie. no new requests to generate responses) and the
    xserver had nothing to say, then this would block forever.
    Two flush() calls or the code above would produce this
    condition.

    Fix was to make it timeout instantly like the "receive
    anything you can, then return" mode of operation.