Bug 4847 - rdesktop freezes after reconnecting
Summary: rdesktop freezes after reconnecting
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: | rdesktop (deprecated) (show other bugs)
Version: 4.1.0
Hardware: PC Linux Ubuntu
: P2 Normal
Target Milestone: 4.2.0
Assignee: Henrik Andersson
URL:
Keywords: astrand_tester, prosaic
Depends on:
Blocks:
 
Reported: 2013-10-15 09:51 CEST by Karl Mikaelsson
Modified: 2014-05-05 13:15 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Karl Mikaelsson cendio 2013-10-15 09:51:24 CEST
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 Henrik Andersson cendio 2013-10-15 11:36:22 CEST
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 Karl Mikaelsson cendio 2013-10-15 12:35:26 CEST
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 Henrik Andersson cendio 2014-02-07 16:35:17 CET
Fixed in commit r1785.
Comment 4 Henrik Andersson cendio 2014-02-07 16:44:15 CET
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 Henrik Andersson cendio 2014-02-07 16:56:01 CET
Fixed in vendor drop 28387.
Comment 6 Peter Åstrand cendio 2014-05-05 13:15:57 CEST
(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.

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