xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.

Opened 5 years ago

Closed 4 years ago

Last modified 16 months ago

#1633 closed defect (fixed)

protocol queue deadlock on close

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: major Milestone: 2.4
Component: network Version: trunk
Keywords: Cc:


Was easily triggered with the RFB adaptor (#1620) and an ultravnc client.
Shows up as this gdb backtrace:

Traceback (most recent call first):
  Waiting for the GIL
  File "/usr/lib64/python2.7/threading.py", line 340, in wait
  File "/usr/lib64/python2.7/Queue.py", line 126, in put
  File "/usr/lib64/python2.7/site-packages/xpra/server/rfb/rfb_protocol.py", line 242, in raw_write
  File "/usr/lib64/python2.7/site-packages/xpra/server/rfb/rfb_protocol.py", line 233, in send
  File "/usr/lib64/python2.7/site-packages/xpra/server/rfb/rfb_source.py", line 88, in send
  File "/usr/lib64/python2.7/site-packages/xpra/server/rfb/rfb_source.py", line 74, in damage
  File "/usr/lib64/python2.7/site-packages/xpra/server/server_base.py", line 3054, in _damage
    ss.damage(wid, window, x, y, width, height, options)
  File "/usr/lib64/python2.7/site-packages/xpra/server/rfb/rfb_server.py", line 152, in _process_rfb_FramebufferUpdateRequest
    self._damage(model, x, y, w, h)
  File "/usr/lib64/python2.7/site-packages/xpra/gtk_common/gtk_util.py", line 423, in gtk_main
  File "/usr/lib64/python2.7/site-packages/xpra/server/gtk_server_base.py", line 64, in do_run
  File "/usr/lib64/python2.7/site-packages/xpra/server/server_core.py", line 479, in run
  File "/usr/lib64/python2.7/site-packages/xpra/server/server_base.py", line 881, in run
    return ServerCore.run(self)
  File "/usr/lib64/python2.7/site-packages/xpra/scripts/server.py", line 1000, in run_server
    e = app.run()
  File "/usr/lib64/python2.7/site-packages/xpra/scripts/main.py", line 1469, in run_mode
    return run_server(error_cb, options, mode, script_file, args, current_display)
  File "/usr/lib64/python2.7/site-packages/xpra/scripts/main.py", line 177, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/usr/bin/xpra", line 15, in <module>
    sys.exit(main(sys.argv[0], sys.argv))

We're waiting for the queue to be empty to add a packet to it, but the queue has been flushed already and we've put the None packet in there and the IO thread has terminated (leaving the None packet in there). And so the queue will never be emptied again and this thread will wait forever - and since we call the RFB code in the main thread... that's even worse here.

Change History (4)

comment:1 Changed 5 years ago by Antoine Martin

Status: newassigned

r16796 takes the lazy approach of allowing 2 items in the write queue.

I am keeping this ticket open because:

  • a cleaner solution would be better
  • it may be possible to trigger a similar deadlock using the regular protocol class: if not now, later since this behaviour is not obvious

comment:2 Changed 5 years ago by Antoine Martin

Milestone: 2.2future

meh - fixing this is hard

comment:3 Changed 4 years ago by Antoine Martin

Milestone: future2.4
Resolution: fixed
Status: assignedclosed

See ticket:1948#comment:1, and in particular r20355.

comment:4 Changed 16 months ago by migration script

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1633

Note: See TracTickets for help on using tickets.