Bug 4452 - Silence SSL errors during shutdown of rdesktop
Summary: Silence SSL errors during shutdown of rdesktop
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: | rdesktop (deprecated) (show other bugs)
Version: 3.4.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.1.0
Assignee: Henrik Andersson
URL:
Keywords: ossman_tester
Depends on:
Blocks:
 
Reported: 2012-10-30 13:56 CET by Peter Åstrand
Modified: 2013-06-20 16:51 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Peter Åstrand cendio 2012-10-30 13:56:46 CET
Problem #3 from bug 4347. Currently, if you are running in SSL mode, you will get a warning after logout/disconnect:

ERROR: SSL_read: 5 (Förbindelse borttagen av partnern)
ERROR: SSL_write: 5 (Brutet rör)

This is harmless, since the return code is zero. It is however somewhat ugly and confusing, so this should be silenced.
Comment 1 Henrik Andersson cendio 2012-11-22 12:37:13 CET
This issue does only occur on Win2003 Terminal Server in the following
codepath of rdesktop:

(gdb) r
Starting program: /home/hean01/Development/upstream/rdesktop.git/rdesktop 10.47.254.170 -u administrator -p Vogh7Grot
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Autoselected keyboard map en-us
Connection established using SSL.
WARNING: Remote desktop does not support colour depth 24; falling back to 16
bt
ERROR: SSL_read: 5 (Connection reset by peer)

Program received signal SIGPIPE, Broken pipe.
0x000000334500e030 in __write_nocancel () at ../sysdeps/unix/syscall-template.S:82
82	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
Missing separate debuginfos, use: debuginfo-install libXcursor-1.1.13-1.fc17.x86_64 libXfixes-5.0-2.fc17.x86_64 pcsc-lite-libs-1.8.3-1.fc17.x86_64
(gdb) bt
#0  0x000000334500e030 in __write_nocancel () at ../sysdeps/unix/syscall-template.S:82
#1  0x000000334dcaff15 in sock_write (b=0xa253f0, in=0xa2f723 "\027\003\001", inl=32) at bss_sock.c:158
#2  0x000000334dcadcf9 in BIO_write (b=0xa253f0, in=0xa2f723, inl=32) at bio_lib.c:247
#3  0x000000383aa24fc2 in ssl3_write_pending (s=s@entry=0xa24ff0, type=type@entry=23, buf=<optimized out>, len=<optimized out>) at s3_pkt.c:837
#4  0x000000383aa25444 in do_ssl3_write (s=s@entry=0xa24ff0, type=type@entry=23, buf=buf@entry=0xa05750 "\003", len=<optimized out>, create_empty_fragment=create_empty_fragment@entry=0) at s3_pkt.c:809
#5  0x000000383aa255b3 in ssl3_write_bytes (s=0xa24ff0, type=23, buf_=0xa05750, len=<optimized out>) at s3_pkt.c:604
#6  0x000000000041ca54 in tcp_send (s=0x6c7970) at tcp.c:130
#7  0x000000000041d5da in iso_send_msg (code=code@entry=128 '\200') at iso.c:48
#8  0x000000000041db6e in iso_disconnect () at iso.c:346
#9  0x000000000041e225 in mcs_disconnect () at mcs.c:358
#10 0x000000000041f705 in sec_disconnect () at secure.c:913
#11 0x0000000000422015 in rdp_disconnect () at rdp.c:1666
#12 0x0000000000407a5e in main (argc=<optimized out>, argv=<optimized out>) at rdesktop.c:1026
Comment 2 Henrik Andersson cendio 2012-11-22 14:40:47 CET
Verified that this is a problem when using plain RDP too,
there is no proper handling of disconnects and when rdp
loop exists it will try send data on a closed socket.

I could produce this case by connect using plain rdp and
then disconnect network cabel from server while producing
rdp traffic.
Comment 3 Henrik Andersson cendio 2012-11-26 07:56:55 CET
Fixed in upstream commit r1681
Comment 4 Henrik Andersson cendio 2012-12-04 07:45:16 CET
Vendordrop r26147 brings the changes for this bug.

Testcase is descibed in comment #2.
Comment 5 Pierre Ossman cendio 2013-06-11 20:14:52 CEST
The test case in comment #2 results in:

[tluser@dhcp-254-223 ~]$  tl-run-rdesktop   
Connecting to RDP server WIN-FGI326MKOI9...
PRINTER PRN1 to nearest driver HP Color LaserJet 8500 PS
PRINTER PRN2 to thinlocal driver HP Color LaserJet 8500 PS
Autoselected keyboard map en-gb
Failed to negotiate protocol, retrying with plain RDP.
WARNING: Remote desktop does not support colour depth 24; falling back to 16
ERROR: send: No route to host
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: send: Broken pipe

And eventually:

ERROR: send: Broken pipe
ERROR: send: Broken pipe
ERROR: Connection closed
ERROR: connect: No route to host
Failed to connect, retry in 4 secs...
ERROR: connect: No route to host
Failed to connect, retry in 4 secs...
ERROR: connect: No route to host
Failed to connect, retry in 4 secs...
ERROR: connect: No route to host
Failed to connect, retry in 4 secs...
ERROR: connect: No route to host
Failed to connect, retry in 4 secs...
Comment 6 Pierre Ossman cendio 2013-06-11 20:16:26 CEST
The original problem doesn't seem to happen though. Disconnecting a TLS session does not result in any extra errors.
Comment 7 Henrik Andersson cendio 2013-06-13 13:02:42 CEST
(In reply to comment #5)
> The test case in comment #2 results in:
> 
> [tluser@dhcp-254-223 ~]$  tl-run-rdesktop   
> Connecting to RDP server WIN-FGI326MKOI9...
> PRINTER PRN1 to nearest driver HP Color LaserJet 8500 PS
> PRINTER PRN2 to thinlocal driver HP Color LaserJet 8500 PS
> Autoselected keyboard map en-gb
> Failed to negotiate protocol, retrying with plain RDP.
> WARNING: Remote desktop does not support colour depth 24; falling back to 16
> ERROR: send: No route to host
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> 
> And eventually:
> 
> ERROR: send: Broken pipe
> ERROR: send: Broken pipe
> ERROR: Connection closed
> ERROR: connect: No route to host
> Failed to connect, retry in 4 secs...
> ERROR: connect: No route to host
> Failed to connect, retry in 4 secs...
> ERROR: connect: No route to host
> Failed to connect, retry in 4 secs...
> ERROR: connect: No route to host
> Failed to connect, retry in 4 secs...
> ERROR: connect: No route to host
> Failed to connect, retry in 4 secs...

Fixed upstream in r1711, will vendor drop soon.
Comment 8 Henrik Andersson cendio 2013-06-14 15:09:12 CEST
(In reply to comment #7)
> (In reply to comment #5)
> > The test case in comment #2 results in:
> > 
> > [tluser@dhcp-254-223 ~]$  tl-run-rdesktop   
> > Connecting to RDP server WIN-FGI326MKOI9...
> > PRINTER PRN1 to nearest driver HP Color LaserJet 8500 PS
> > PRINTER PRN2 to thinlocal driver HP Color LaserJet 8500 PS
> > Autoselected keyboard map en-gb
> > Failed to negotiate protocol, retrying with plain RDP.
> > WARNING: Remote desktop does not support colour depth 24; falling back to 16
> > ERROR: send: No route to host
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > 
> > And eventually:
> > 
> > ERROR: send: Broken pipe
> > ERROR: send: Broken pipe
> > ERROR: Connection closed
> > ERROR: connect: No route to host
> > Failed to connect, retry in 4 secs...
> > ERROR: connect: No route to host
> > Failed to connect, retry in 4 secs...
> > ERROR: connect: No route to host
> > Failed to connect, retry in 4 secs...
> > ERROR: connect: No route to host
> > Failed to connect, retry in 4 secs...
> > ERROR: connect: No route to host
> > Failed to connect, retry in 4 secs...
> 
> Fixed upstream in r1711, will vendor drop soon.

Vendordrop in commit r27523.
Comment 9 Pierre Ossman cendio 2013-06-19 12:21:36 CEST
Still getting a whole bunch of SSL errors in the timeout case. This time it seems like they're from OpenSSL though, so we might have to live with them:

[tluser@dhcp-254-223 Desktop]$ /opt/thinlinc/bin/rdesktop WIN-FGI326MKOI9
Autoselected keyboard map en-gb
warning: unable to open /etc/gssapi_mech.conf: errno 2 (No such file or directory)
WARNING: CredSSP: System doesn't have support for desired authentication mechanism.
Connection established using SSL.
WARNING: Remote desktop does not support colour depth 24; falling back to 16
ERROR: SSL_write: 5 (No route to host)
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
140359017301696:error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry:s3_pkt.c:866:
Disconnected due to network error, retrying to reconnect for 70 minutes.
ERROR: send: Connection reset by peer

Opening for discussion.
Comment 10 Henrik Andersson cendio 2013-06-20 16:08:41 CEST
Needs retesting
Comment 11 Pierre Ossman cendio 2013-06-20 16:51:26 CEST
Seems to be fixed in the new code.

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