www.cendio.com
Bug 4847 - rdesktop freezes after reconnecting
: rdesktop freezes after reconnecting
Status: CLOSED FIXED
: ThinLinc
rdesktop
: 4.1.0
: PC Linux Ubuntu
: P2 Normal
: 4.2.0
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2013-10-15 09:51 by
Modified: 2014-05-05 13:15 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From cendio 2013-10-15 09:51:24
Reproduced on two Ubuntu 12.04 machines, virtual and physical.

Windows server: 2003 R2 x64, fully patched.

How to reproduce:

1) rdesktop 10.47.foo.bar

   log in, start task manager, switch to the graph view

2) iptables -A OUTPUT -j REJECT -p tcp -d 10.47.foo.bar --reject-with tcp-reset

   wait a few moments, move your mouse pointer inside rdesktop to force
   some traffic, watch it go into the reconnect loop

3) iptables -F OUTPUT

   flush the iptables rule you just set up. rdesktop should now to into
   the reconnection phase. with a working client/server combination,
   you should see the rdesktop flash a fraction of a second, then resume
   operation with your session as you left it.

What actually happens is that rdesktop reconnects, but seems to get out of sync
with the server. After some initial handshaking, 60 seconds elapses and we get
an error.

> Failed to negotiate protocol, retrying with plain RDP.
> WARNING: Remote desktop does not support colour depth 24; falling back to 16
> ERROR: recv: Connection reset by peer
> Disconnected due to network error, retrying to reconnect for 70 minutes.
> Failed to negotiate protocol, retrying with plain RDP.
> NOT IMPLEMENTED: PDU 2
> ERROR: recv: Connection reset by peer

Amazingly, this does not seem to be a regression.

| Distribution | rdesktop version | Windows server      | Result |
|--------------+------------------+---------------------+--------|
| Ubuntu 12.04 | tl-4.1.0         | 2003VM (RDP)        | FAIL   |
| Ubuntu 12.04 | tl-4.1.1         | 2003VM (RDP)        | FAIL   |
| Fedora 19    | tl-4.1.1         | 2003VM (RDP)        | FAIL   |
| Ubuntu 12.04 | tl-4.1.1         | 2003VM (SSL)        | FAIL   |
| Ubuntu 12.04 | rdesktop-svn     | 2003VM (RDP)        | FAIL   |
|--------------+------------------+---------------------+--------|
| Ubuntu 12.04 | tl-4.1.0         | 2003 (Trouble, RDP) | OK     |
| Ubuntu 12.04 | tl-4.1.1         | 2003 (Trouble)      | OK     |
------- Comment #1 From cendio 2013-10-15 11:36:22 -------
The following patch fixes the problem:

Index: secure.c
===================================================================
--- secure.c    (revision 1748)
+++ secure.c    (working copy)
@@ -921,5 +921,6 @@
     g_sec_encrypt_use_count = 0;
     g_sec_decrypt_use_count = 0;
     g_licence_error_result = 0;
+    g_licence_issued = 0;
     mcs_reset_state();
 }
------- Comment #2 From cendio 2013-10-15 12:35:26 -------
A more complete tests table:

| Distribution | rdesktop version | Windows server      | Result  |
|--------------+------------------+---------------------+---------|
| Ubuntu 12.04 | tl-4.1.0         | 2003VM (RDP)        | FAIL    |
| Ubuntu 12.04 | tl-4.1.1         | 2003VM (RDP)        | FAIL    |
| Fedora 19  * | tl-4.1.1         | 2003VM (RDP)        | FAIL    |
| Fedora 19 ** | tl-4.1.1         | 2003VM (RDP)        | OK      |
| Ubuntu 12.04 | tl-4.1.1         | 2003VM (SSL)        | FAIL    |
| Ubuntu 12.04 | rdesktop-svn     | 2003VM (RDP)        | FAIL    |
| Fedora 19 ** | rdesktop-svn     | 2003VM (RDP)        | OK      |
|--------------+------------------+---------------------+---------|
| Ubuntu 12.04 | tl-4.1.0         | 2003 (Trouble, RDP) | OK      |
| Ubuntu 12.04 | tl-4.1.1         | 2003 (Trouble, RDP) | OK      |
| Fedora 19  * | tl-4.1.1         | 2003 (Trouble, RDP) | OK      |
| Fedora 19 ** | rdesktop-svn     | 2003 (Trouble, RDP) | OK      |
|--------------+------------------+---------------------+---------|
| Ubuntu 12.04 | tl-4.1.1         | 2008VM (SSL)        | FAIL    |
| Fedora 19  * | tl-4.1.1         | 2008VM (SSL)        | FAIL    |
| Fedora 19 ** | tl-4.1.1         | 2008VM (SSL)        | FAIL*** |
| Fedora 19 ** | rdesktop-svn     | 2008VM (SSL)        | FAIL*** |

  *: aperture, Karls workstation
 **: hean01-desktop, Henriks workstation
***: Failed but worked yesterday
------- Comment #3 From cendio 2014-02-07 16:35:17 -------
Fixed in commit r1785.
------- Comment #4 From cendio 2014-02-07 16:44:15 -------
Final tests has been performed to test reconnection in three ways:

Pending size reconnect, network error, server redirection on each 2003R2,
2008R2 and 2012R2 works as expected.

Tester should test the above combinations which also includes test cases for
bugs following bugs: 4938, 4920, 4911, 2835
------- Comment #5 From cendio 2014-02-07 16:56:01 -------
Fixed in vendor drop 28387.
------- Comment #6 From cendio 2014-05-05 13:15:57 -------
(In reply to comment #4)
> Final tests has been performed to test reconnection in three ways:
> 
> Pending size reconnect,

Tested on SLED11, using command line:

tl-run-rdesktop -g 50%

Then resizing TL session. Tested with Windows 2012R2 and 2008R2. 

> network error, 

Tested on bug 2835. 

> server redirection on each 2003R2,
> 2008R2 and 2012R2 works as expected.

Tested on bug 4362.