Bug 4861 - tlclient.exe still does not run correctly on Wine
Summary: tlclient.exe still does not run correctly on Wine
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Client platforms (show other bugs)
Version: 4.1.0
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Peter Åstrand
URL:
Keywords:
Depends on: 3929
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-21 12:39 CEST by Peter Åstrand
Modified: 2020-06-16 12:42 CEST (History)
0 users

See Also:
Acceptance Criteria:


Attachments
tlclient.log (4.97 KB, text/x-log)
2013-10-21 12:40 CEST, Peter Åstrand
Details
Use own implementation of vasprintf (716 bytes, patch)
2015-10-28 16:13 CET, Peter Åstrand
Details

Description Peter Åstrand cendio 2013-10-21 12:39:19 CEST
Continuation of bug 3929. Although the reported problem has fixed, there's some other problem, perhaps introduced by bugg 4693. The session terminates directly, seems to be a SSH problem. Happens on CentOS 6.
Comment 1 Peter Åstrand cendio 2013-10-21 12:40:38 CEST
Created attachment 496 [details]
tlclient.log

Command line was:

wine /home/astrand/tlbuilder-ctc/client-bundle/client-windows/tl-4.1.0post-client-windows/tlclient.exe 

This is build 4122.
Comment 2 Peter Åstrand cendio 2014-05-06 16:18:21 CEST
Build 4346 works with Wine on CentOS6 if you run without encryption, and all local devices disabled. With encryption, I get this in tlclient.log:

2014-05-06T16:15:14: ssh[E]: fcntl(4, F_GETFL, 0): Lyckades.
2014-05-06T16:15:14: ssh[E]: fcntl(4, F_GETFL, 0): Unknown error 10009
Comment 3 Peter Åstrand cendio 2014-10-14 08:56:15 CEST
(In reply to comment #2)
> Build 4346 works with Wine on CentOS6 if you run without encryption, and all
> local devices disabled. With encryption, I get this in tlclient.log:
> 
> 2014-05-06T16:15:14: ssh[E]: fcntl(4, F_GETFL, 0): Lyckades.
> 2014-05-06T16:15:14: ssh[E]: fcntl(4, F_GETFL, 0): Unknown error 10009

Windows/MinGW does not have fcntl or F_GETFL. Instead, compat functions are implemented in win32-misc.c. The fact that the call fails but that "Lyckades" is printed could mean that the wrapper does not update errno correctly. 

However, the main problem is likely that Wine does not implement GetNamedPipeHandleState(), which is what the wrapper uses. And indeed, according to:

https://www.winehq.org/announce/1.7.25
      kernel32: Implement GetNamedPipeHandleState.

So with a bit of luck, the client runs on Wine 1.7.25 or newer.
Comment 4 Peter Åstrand cendio 2014-10-14 12:37:22 CEST
(In reply to comment #3)

> 
> So with a bit of luck, the client runs on Wine 1.7.25 or newer.

Tested. SSH works better now, communication with VSM server etc works. However, vncviewer never creates any window. I also get this in tlclient.log:

...
014-10-14T12:34:41: Given host key matches one in the acceptable list.
2014-10-14T12:34:42: ssh[E]: NEXT AUTHMETHOD: none
2014-10-14T12:34:42: ssh[E]: AUTH FAILURE
2014-10-14T12:34:42: ssh[E]: NEXT AUTHMETHOD: password
2014-10-14T12:34:42: ssh[E]: PASSWORD: astrand eudemo.thinlinc.com
2014-10-14T12:34:42: ssh[E]: AUTH SUCCESS
2014-10-14T12:34:42: ssh[E]: CONNECTED
2014-10-14T12:34:42: ssh[E]: THINLINC-LOGIN: HELLO 4.2.0
2014-10-14T12:34:42: ssh[E]: channel 2: chan_shutdown_read: close() failed for fd -1: Ogiltig referens.
2014-10-14T12:34:42: ssh[E]: 
2014-10-14T12:34:42: ssh[E]: COMMAND_EXITSTATUS: 0
2014-10-14T12:34:42: VNC command: Z:\home\astrand\tlbuilder-ctc\client-bundle\client-windows\tl-4.3.0-client-windows\vncviewer -RemoteResize=1 -FullScreen -FullScreenAllMonitors=1 -FullscreenSystemKeys=1 -FullColour=1 -LowColourLevel=2 -AutoSelect=1 -CustomCompressLevel=0 -CompressLevel=2 -QualityLevel=8 -MenuKey=F8 -PasswordFile=C:\users\astrand\Temp\vnc237c.tmp -Shared=1 -DesktopSize=3200x1200 -geometry=3192x1142+4+54 127.0.0.1::35118
2014-10-14T12:34:43: vncviewer[E]: 
2014-10-14T12:34:43: vncviewer[E]: ThinLinc Client 32-bit v4.3.0
2014-10-14T12:34:43: vncviewer[E]: Built on: 2014-10-14 01:36
2014-10-14T12:34:43: vncviewer[E]: Copyright (C) 1999-2014 TigerVNC Team and many others
2014-10-14T12:34:43: vncviewer[E]: See included EULA.txt for licensing details.
2014-10-14T12:34:43: vncviewer[E]: See http://www.cendio.com for information on ThinLinc.
2014-10-14T12:34:43: vncviewer[E]: 
2014-10-14T12:34:43: vncviewer[E]: Tue Oct 14 12:34:43 2014
2014-10-14T12:34:43: vncviewer[E]:  CConn:       ansluten till värd 127.0.0.1 port 35118
2014-10-14T12:34:43: vncviewer[E]:  CConnection: Server supports RFB protocol version 3.8
2014-10-14T12:34:43: vncviewer[E]:  CConnection: Using RFB protocol version 3.8

When running strace on vncviewer.exe, I can see that it's stuck in a tight loop:

clock_gettime(0x4 /* CLOCK_??? */, {4314166, 567222572}) = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0
write(3, "|\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0
writev(3, [{"\30\0\0\0000\0\0\0\0\0\0\0\2\0\0\0 \363\177\0\0\0\0\0\360\330\377\377\377\377\377\377"..., 64}, {"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 40}, {"\1\0\0\0d\0\0\0", 8}], 3) = 112
read(4, "\3\1\0\0\0\0\0\0\"\220E\276\232\347\317\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
read(6, " \363\177\0\0\0\0\0\2\1\0\0\0\0\0\0", 16) = 16
sched_yield()                           = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0
write(3, "\202\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\0\0\0\0"..., 64) = 64
read(4, "\3\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
clock_gettime(0x4 /* CLOCK_??? */, {4314166, 568548501}) = 0
sched_yield()                           = 0
rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
dup(13)                                 = 14
rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
dup(13)                                 = 15
gettimeofday({1413283002, 24666}, NULL) = 0
poll([{fd=14, events=POLLIN}, {fd=15, events=POLLHUP}], 2, 0) = 0 (Timeout)
close(14)                               = 0
getsockopt(15, SOL_SOCKET, SO_ERROR, [36020378883063808], [4]) = 0
close(15)                               = 0
clock_gettime(0x4 /* CLOCK_??? */, {4314166, 568836204}) = 0
Comment 5 Peter Åstrand cendio 2015-10-28 16:11:44 CET
Tested with wine on CentOS 6:

4.3.0:
SSH works. Pulseaudio crashes. vncviewer does not create any window. 


4.4.0:
2015-10-28T15:27:41: Log file created
2015-10-28T15:27:41: ThinLinc client release 4.4.0 build 4775
2015-10-28T15:27:41: Unable to open HKLM registry key.
2015-10-28T15:27:41: SSH command: Z:\home\astrand\tl-4.4.0-clients\client-windows\tl-4.4.0-client-windows\ssh.exe -N -o GlobalKnownHostsFile=nul -o UserKnownHostsFile=nul -o PubkeyAuthentication=no -o CheckHostIP=no -o NumberOfPasswordPrompts=1 astrand@eudemo.thinlinc.com -p 22 thinlinc-login master
2015-10-28T15:27:41: ssh[E]: xasprintf: could not allocate memory
2015-10-28T15:27:41: WinProcess: PostThreadMessage(WM_QUIT) to process 38 (unknown) failed
2015-10-28T15:27:44: Log file ended

4.5.0:
2015-10-28T15:31:46: Log file created
2015-10-28T15:31:46: ThinLinc client release 4.5.0 build 4927
2015-10-28T15:31:46: Unable to open HKLM registry key.
2015-10-28T15:31:46: SSH command: Z:\home\astrand\tlbuilder-ctc\client-bundle\client-windows\tl-4.5.0-client-windows\ssh.exe -N -o GlobalKnownHostsFile=nul -o UserKnownHostsFile=nul -o PubkeyAuthentication=no -o CheckHostIP=no -o NumberOfPasswordPrompts=1 astrand@eudemo.thinlinc.com -p 22 thinlinc-login master
2015-10-28T15:31:46: ssh[E]: xasprintf: could not allocate memory
2015-10-28T15:31:46: WinProcess: PostThreadMessage(WM_QUIT) to process 38 (unknown) failed
2015-10-28T15:31:48: Log file ended

Note that xasprintf in xmalloc.c has not been touched since 2007-07-06, so something else must matter.
Comment 6 Peter Åstrand cendio 2015-10-28 16:13:47 CET
Created attachment 652 [details]
Use own implementation of vasprintf

With this patch, SSH works. vncviewer still has the same problem as before.
Comment 7 Pierre Ossman cendio 2020-06-16 12:42:57 CEST
This is just for our testing during development, so not a high priority.

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