Freerdp: ERRINFO_INVALID_INPUT_PDU_MOUSE and exit on middle mouse button click

Created on 6 Dec 2018  路  18Comments  路  Source: FreeRDP/FreeRDP

Describe the bug

When connected to any client, if I use the middle mouse button, the program forcibly disconnects from the remote host.

[10:43:01:915] [8258:8259] [INFO][com.freerdp.core] - ERRINFO_INVALID_INPUT_PDU_MOUSE (0x000010D0):(a) A Slow-Path Mouse Event (section 2.2.8.1.1.3.1.1.3) or Extended Mouse Event (section 2.2.8.1.1.3.1.1.4) has been received with an invalid pointerFlags field.
(b) A Fast-Path Mouse Event (section 2.2.8.1.2.2.3) or Fast-Path Extended Mouse Event (section 2.2.8.1.2.2.4) has been received with an invalid pointerFlags field.
[10:43:01:917] [8258:8259] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 104: Connection reset by peer
[10:43:01:917] [8258:8259] [ERROR][com.freerdp.core] - freerdp_check_fds() failed - 0
[10:43:01:917] [8258:8259] [ERROR][com.freerdp.client.x11] - Failed to check FreeRDP file descriptor

I can live without it, but it would be nice to have a work-around that doesn't close the connection.

To Reproduce
Steps to reproduce the behavior:

  1. open a connection from linux to a local windows VM.
  2. click the middle mouse button

Expected behavior
Either nothing should happen, or the middle mouse button should be passed through to the remote host.

** Application details

  • Version of FreeRDP
    This is FreeRDP version 2.0.0-dev (git n/a)
  • Command line used
xfreerdp /size:1724x960 /v:davek-win /sec:rdp /u:davek -grab-keyboard
  • output of /buildconfig
This is FreeRDP version 2.0.0-dev (git n/a)
Build configuration: BUILD_TESTING=OFF BUILTIN_CHANNELS=ON HAVE_AIO_H=1 HAVE_EVENTFD_H=1 HAVE_EXECINFO_H=1 HAVE_FCNTL_H=1 HAVE_INTTYPES_H=1 HAVE_JOURNALD_H=TRUE HAVE_MATH_C99_LONG_DOUBLE=1 HAVE_POLL_H=1 HAVE_PTHREAD_MUTEX_TIMEDLOCK=ON HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB=1 HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL= HAVE_SYSLOG_H=1 HAVE_SYS_FILIO_H= HAVE_SYS_MODEM_H= HAVE_SYS_SELECT_H=1 HAVE_SYS_SOCKIO_H= HAVE_SYS_STRTIO_H= HAVE_TIMERFD_H=1 HAVE_TM_GMTOFF=1 HAVE_UNISTD_H=1 HAVE_XI_TOUCH_CLASS=1 WITH_ALSA=ON WITH_CCACHE=ON WITH_CHANNELS=ON WITH_CLIENT=ON WITH_CLIENT_AVAILABLE=1 WITH_CLIENT_CHANNELS=ON WITH_CLIENT_CHANNELS_AVAILABLE=1 WITH_CLIENT_COMMON=ON WITH_CLIENT_INTERFACE=OFF WITH_CUPS=ON WITH_DEBUG_ALL=OFF WITH_DEBUG_CAPABILITIES=OFF WITH_DEBUG_CERTIFICATE=OFF WITH_DEBUG_CHANNELS=OFF WITH_DEBUG_CLIPRDR=OFF WITH_DEBUG_DVC=OFF WITH_DEBUG_KBD=OFF WITH_DEBUG_LICENSE=OFF WITH_DEBUG_MUTEX=OFF WITH_DEBUG_NEGO=OFF WITH_DEBUG_NLA=OFF WITH_DEBUG_NTLM=OFF WITH_DEBUG_RAIL=OFF WITH_DEBUG_RDP=OFF WITH_DEBUG_RDPDR=OFF WITH_DEBUG_RDPEI=OFF WITH_DEBUG_REDIR=OFF WITH_DEBUG_RFX=OFF WITH_DEBUG_RINGBUFFER=OFF WITH_DEBUG_SCARD=OFF WITH_DEBUG_SND=OFF WITH_DEBUG_SVC=OFF WITH_DEBUG_SYMBOLS=OFF WITH_DEBUG_THREADS=OFF WITH_DEBUG_TIMEZONE=OFF WITH_DEBUG_TRANSPORT=OFF WITH_DEBUG_TSG=OFF WITH_DEBUG_TSMF=OFF WITH_DEBUG_WND=OFF WITH_DEBUG_X11=OFF WITH_DEBUG_X11_CLIPRDR=OFF WITH_DEBUG_X11_LOCAL_MOVESIZE=OFF WITH_DEBUG_XV=OFF WITH_DIRECTFB=OFF WITH_EVENTFD_READ_WRITE=1 WITH_FFMPEG=OFF WITH_GFX_H264=OFF WITH_GPROF=OFF WITH_GSM=OFF WITH_GSTREAMER_0_10=OFF WITH_GSTREAMER_1_0=ON WITH_IPP=OFF WITH_JPEG=ON WITH_KRB5=OFF WITH_LIBRARY_VERSIONING=ON WITH_LIBSYSTEMD=ON WITH_MACAUDIO=OFF WITH_MACAUDIO=OFF WITH_MACAUDIO_AVAILABLE=0 WITH_MANPAGES=ON WITH_MBEDTLS=OFF WITH_OPENH264=OFF WITH_OPENSLES=OFF WITH_OPENSSL=ON WITH_OSS=ON WITH_PAM=ON WITH_PCSC=ON WITH_PROFILER=OFF WITH_PULSE=ON WITH_SAMPLE=OFF WITH_SANITIZE_ADDRESS=OFF WITH_SANITIZE_ADDRESS_AVAILABLE=1 WITH_SANITIZE_LEAK=OFF WITH_SANITIZE_LEAK_AVAILABLE=1 WITH_SERVER=ON WITH_SERVER_CHANNELS=ON WITH_SERVER_INTERFACE=ON WITH_SMARTCARD_INSPECT=OFF WITH_SSE2=ON WITH_THIRD_PARTY=OFF WITH_VALGRIND_MEMCHECK=OFF WITH_VALGRIND_MEMCHECK_AVAILABLE=1 WITH_WAYLAND=ON WITH_X11=ON WITH_X264=OFF WITH_XCURSOR=ON WITH_XDAMAGE=ON WITH_XEXT=ON WITH_XFIXES=ON WITH_XI=ON WITH_XINERAMA=ON WITH_XKBFILE=ON WITH_XRANDR=ON WITH_XRENDER=ON WITH_XSHM=ON WITH_XTEST=ON WITH_XV=ON WITH_ZLIB=ON
Build type:          RELWITHDEBINFO
CFLAGS:              -g -O2 -fdebug-prefix-map=/build/freerdp2-jffv_t/freerdp2-2.0.0~git20170725.1.1648deb+dfsg1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Wall -Wno-unused-result -Wno-unused-but-set-variable -Wno-deprecated-declarations -fvisibility=hidden -Wimplicit-function-declaration -Wredundant-decls -g -msse2
Compiler:            GNU, 7.3.0
Target architecture: x64
  • OS version connecting to
    windows 7

Desktop (please complete the following information):

  • OS: ubuntu 18.04
fixed-waiting-test waiting-feedback

All 18 comments

Could you check if it works with current nightlies?
Working with these daily (and remmina uses them too) so this seems to be already resolved.

https://ci.freerdp.com/job/freerdp-nightly-binaries/ you find the nightly builds for testing there.

I will check.

nightly builds will not run for me, as installed by apt.

/opt/freerdp-nightly/bin/xfreerdp --help
==20631==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

I tried fudging LD_LIBRARY_PATH with /opt/freerdp-nightly/lib/ but that didn't work. I'll try the LD_PRELOAD var.

After specifying the environment, it fails with the same error on middle click:

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libasan.so.4 /opt/freerdp-nightly/bin/xfreerdp /size:1724x960 /v:davek-win /sec:rdp /u:davek -grab-keyboard
[06:37:42:187] [20880:20881] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr
[06:37:42:189] [20880:20881] [ERROR][com.freerdp.client.x11] - Mouse physical button 1 is mapped to logical button 0
[06:37:42:290] [20880:20881] [INFO][com.freerdp.gdi] - Local framebuffer format  PIXEL_FORMAT_BGRX32
[06:37:42:290] [20880:20881] [INFO][com.freerdp.gdi] - Remote framebuffer format PIXEL_FORMAT_RGB16
[06:37:42:307] [20880:20881] [INFO][com.winpr.clipboard] - initialized POSIX local file subsystem
[06:37:47:304] [20880:20881] [INFO][com.freerdp.core] - ERRINFO_INVALID_INPUT_PDU_MOUSE (0x000010D0):(a) A Slow-Path Mouse Event (section 2.2.8.1.1.3.1.1.3) or Extended Mouse Event (section 2.2.8.1.1.3.1.1.4) has been received with an invalid pointerFlags field.
(b) A Fast-Path Mouse Event (section 2.2.8.1.2.2.3) or Fast-Path Extended Mouse Event (section 2.2.8.1.2.2.4) has been received with an invalid pointerFlags field.
[06:37:47:304] [20880:20881] [ERROR][com.freerdp.core.transport] - BIO_read returned a system error 104: Connection reset by peer

This is FreeRDP version 2.0.0-dev5 (fc12b9336)

@ddombrowsky Ok, the line [06:37:42:189] [20880:20881] [ERROR][com.freerdp.client.x11] - Mouse physical button 1 is mapped to logical button 0 is interesting.
You have some local mouse button mapping magic activated?

@akallabeth I use a logi marble mouse, with a defined button mapping, yes. I use xinput to map the left "page down" button to the middle button.

xinput set-button-map "Logitech USB Trackball" 1 0 3 4 5 6 7 2 9

@ddombrowsky Are you sure a button id of 0 is allowed? This seems to cause the problems.

@akallabeth yes. From the manpage:

      --set-button-map device map_button_1 [map_button_2 [...]]
               Change the button mapping of device. The buttons are specified in physical order (starting with button 1) and are mapped to the logical button provided. 0 disables a
               button. The default button mapping for a device is 1 2 3 4 5 6 etc.

I also tried mapping it to "8" and that fails with a similar error message.

@ddombrowsky would you test with xfreerdp without the mapping? That could help to pin down the problem.

@bmiklautz Yes, if I change the xinput mapping to default, xfreerdp does not disconnect. The button defaults to the "back" button and works as designed (which, in my opinion is a bug not a feature, but that's my complaint to logitech). Without the mapping I have no middle mouse button, so I can't test that.

@ddombrowsky I've checked and the mouse button remapping code in xfreerdp was not really working for all butttons.
Extended that and ignoring all unmapped buttons now.

@ddombrowsky @akallabeth 's fix is already merged and should be in tomorrows nightly build. Would nice if you can verify if your problem is fixes with it and close the issue.

Fix was merged and is working here.
Reopen if still not fixed.

I can confirm this fixed. The button now doesn't do anything, but that's better than a disconnect.

Thank you all for your help.

@ddombrowsky thx for the feedback.
The button you mean your second one set to 0? Isn't that what it is supposed to do as 0 stands for deactivated?

@akallabeth The logi marble mouse has no "middle" mouse button. You need to use software to decide which button to use (if any) as the middle one. On windows, there's a separate hook in the driver (I think). On linux, which I use, it's an xinput setting which tells X11 to return the code for button "2" when button 8 is clicked. I'm not sure why that code isn't being sent through to xfreerdp when it works in all other programs.
A very specific use case, I understand. It really affects only the universe of people using this specific mouse on linux, which is probably just me :)

@akallabeth Sure enough, right after I posted that, I tried +unmap-buttons which does exactly what I was looking for. Now that the disconnect is fixed, that flag works and everything is right with the world!

Was this page helpful?
0 / 5 - 0 ratings