neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.7k stars 1.73k forks source link

xrdp segmentation fault + xrdp session hangs + keyboard layout problems #352

Closed beljaeff closed 6 years ago

beljaeff commented 8 years ago

Hi,

I use xrdp+x11rdp on Gentoo Linux (VirtualBox environment) with LXDE desktop and there are some problems: ***). xrdp segmentation fault. It happens when I try to connect to already opened session from Windows 7. Previous connect to this session was from Windows XP or from Linux (xfreerdp, remmina, rdesktop, vinagre).

dmesg (here all segfaults):

[Пн мар 21 10:47:37 2016] xrdp[24962]: segfault at d3a4b ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 10:48:00 2016] xrdp[25006]: segfault at 62603 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 10:52:04 2016] xrdp[25424]: segfault at 70597 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 14:10:32 2016] xrdp[11683]: segfault at 247c23 ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 15:43:52 2016] xrdp[20080]: segfault at 26d36d ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 17:10:22 2016] xrdp[25120]: segfault at 70597 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 17:12:56 2016] xrdp[25284]: segfault at 70597 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Пн мар 21 21:19:09 2016] xrdp[4199]: segfault at f8bbb ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 09:58:52 2016] xrdp[5014]: segfault at 74bcd ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 10:03:35 2016] xrdp[5474]: segfault at 12f45f ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 10:34:08 2016] xrdp[8454]: segfault at 986a5 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 17:31:32 2016] xrdp[14032]: segfault at 986a5 ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 17:35:30 2016] xrdp[14612]: segfault at 2be5c3 ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 17:50:20 2016] xrdp[15976]: segfault at 1056bf ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Вт мар 22 22:52:24 2016] xrdp[10382]: segfault at ffffffffffffffff ip 0000000000405d10 sp 00007ffe18bb98a0 error 5 in xrdp[400000+1c000] [Вт мар 22 23:18:33 2016] xrdp[12909]: segfault at ffffffffffffffff ip 0000000000405d10 sp 00007ffe18bb98a0 error 5 in xrdp[400000+1c000] [Ср мар 23 11:54:27 2016] xrdp[15017]: segfault at 1ed7bb ip 0000000000405c30 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Ср мар 23 13:34:18 2016] xrdp[24048]: segfault at 1235df ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Ср мар 23 21:28:03 2016] xrdp[1957]: segfault at 4d6c27 ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Чт мар 24 10:32:50 2016] xrdp[9839]: segfault at 12cedb ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Чт мар 24 10:44:14 2016] xrdp[10955]: segfault at 12dbeb ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Чт мар 24 14:48:29 2016] xrdp[1848]: segfault at 136e47 ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Чт мар 24 14:49:51 2016] xrdp[2053]: segfault at 37c17 ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Чт мар 24 15:58:01 2016] xrdp[19742]: segfault at 83fdb ip 0000000000405d10 sp 00007ffe18bb98a0 error 4 in xrdp[400000+1c000] [Сб мар 26 10:41:38 2016] xrdp[32378]: segfault at ffffffffffffffff ip 0000000000405c30 sp 00007f9e21ffa9a0 error 5 in xrdp[400000+1c000]

xrdp-sesman.log (last segfault):

[20160326-10:41:33] [INFO ] A connection received from: 127.0.0.1 port 59986 [20160326-10:41:33] [INFO ] scp thread on sck 8 started successfully [20160326-10:41:33] [INFO ] ++ reconnected session: username natalie, display :13.0, session_pid 19958, ip 185.82.177.109:31125 - socket: 20 [20160326-10:41:33] [INFO ] An established connection closed to endpoint: 127.0.0.1:59986 - socket: 8 [20160326-10:41:33] [INFO ] ++ terminated session: username natalie, display :13.0, session_pid 19958, ip 185.82.177.109:27403 - socket: 10

xrdp.log (last segfault) [20160326-10:41:19] [INFO ] A connection received from: 185.82.177.109 port 62816 [20160326-10:41:19] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 16 [20160326-10:41:19] [INFO ] A connection received from: 185.82.177.109 port 31125 [20160326-10:41:19] [DEBUG] MCS_CJRQ - channel join request received [20160326-10:41:19] [DEBUG] MCS_CJRQ - channel join request received [20160326-10:41:19] [DEBUG] MCS_CJRQ - channel join request received [20160326-10:41:19] [DEBUG] MCS_CJRQ - channel join request received [20160326-10:41:20] [DEBUG] xrdp_000049cc_wm_login_mode_event_000019c4 [20160326-10:41:20] [WARN ] local keymap file for 0x0409 found and dosen't match built in keymap, using local keymap file [20160326-10:41:33] [DEBUG] returnvalue from xrdp_mm_connect 0 [20160326-10:41:33] [INFO ] lib_mod_log_peer: xrdp_pid=18892 connected to X11rdp_pid=19960 X11rdp_uid=1001 X11rdp_gid=1001 client_ip=185.82.177.109 client_port=31125 [20160326-10:41:34] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160326-10:41:34] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 23 [20160326-10:41:35] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160326-10:41:36] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 23 [20160326-10:41:37] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160326-10:41:37] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 23 [20160326-10:41:38] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160326-10:41:38] [ERROR] xrdp_mm_connect_chansrv: error intrans_connect chan [20160326-10:41:38] [INFO ] An established connection closed to endpoint: 127.0.0.1:3350 - socket: 21

If I set fork=no in xrdp.ini xrdp service crashes after segfault, otherwise session ends and I have to begin new session.

***) rdp session hangs (rdp client stop updating its window). I reopen client and try to reconnect to session. I enter login and password and get a black screen (but mouse cursor changes). Interesting thing - after segfault with another session (described above) xrdp service dies (because fork=no), but this hanged session remains alive.

***). keyboard layout problem exactly as #337 . I tried to create file xrdp_keyboard.ini like in the #337, but it dont helps. As a workaround I wrote some shell scripts and put it in lxde autostart, but I dont think that it is a proper way.

Version information (all from gentoo portage): x11-base/xorg-server-1.16.4-r5:0/1.16.1::gentoo USE="glamor nptl suid udev xorg -dmx -doc -ipv6 -kdrive -minimal (-selinux) -static-libs -systemd -tslib -unwind -wayland -xnest -xvfb" net-misc/x11rdp-0.8.0.1.9.5::gentoo USE="nptl" x11-base/xorg-x11-7.4-r2::gentoo net-misc/xrdp-0.8.0-r1::gentoo USE="fuse jpeg pam -debug -kerberos -pulseaudio"

kernel is Linux gentoo-ts 4.3.6-ck #3 SMP PREEMPT Mon Mar 7 14:27:17 MSK 2016 x86_64 Intel(R) Core(TM) i5-3570T CPU @ 2.30GHz GenuineIntel GNU/Linux

lrocket commented 8 years ago

i am having the same problem. i posted what i observed in the google group. i think i didn't find anything in kern.log related to this but i will check again if my case is also related to segfaults.

@beljaeff, are you using the latest revision? i was hoping that the update to sesman threads was fixing that, i wasn't able to check that yet.

beljaeff commented 8 years ago

@lrocket, I use 0.8.0. I look at logs listed here https://groups.google.com/d/msg/xrdp-devel/61fhiBanrSU/uuFRm9tzAwAJ and did not find anything related to segfaults too.

Yesterday was another one segfault and I see it only with dmesg:

[Вт мар 29 13:55:57 2016] xrdp[9551]: segfault at 13562f ip 0000000000405d10 sp 00007ffc7caeb090 error 4 in xrdp[400000+1c000]

xrdp.log: [20160329-13:55:45] [INFO ] A connection received from: 217.197.121.34 port 6664 [20160329-13:55:45] [INFO ] An established connection closed to endpoint: 217.197.121.34:6664 - socket: 8 [20160329-13:55:45] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7 [20160329-13:55:45] [INFO ] An established connection closed to endpoint: 217.197.121.34:6664 - socket: 8 [20160329-13:55:45] [INFO ] A connection received from: 217.197.121.34 port 6665 [20160329-13:55:45] [INFO ] An established connection closed to endpoint: 217.197.121.34:6665 - socket: 8 [20160329-13:55:45] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 7 [20160329-13:55:46] [DEBUG] MCS_CJRQ - channel join request received [20160329-13:55:46] [DEBUG] MCS_CJRQ - channel join request received [20160329-13:55:46] [DEBUG] MCS_CJRQ - channel join request received [20160329-13:55:46] [DEBUG] MCS_CJRQ - channel join request received [20160329-13:55:46] [DEBUG] xrdp_0000254f_wm_login_mode_event_00000001 [20160329-13:55:46] [WARN ] local keymap file for 0x0409 found and dosen't match built in keymap, using local keymap file [20160329-13:55:53] [DEBUG] returnvalue from xrdp_mm_connect 0 [20160329-13:55:53] [INFO ] lib_mod_log_peer: xrdp_pid=9551 connected to X11rdp_pid=28341 X11rdp_uid=1001 X11rdp_gid=1001 client_ip=217.197.121.34 client_port=6665 [20160329-13:55:54] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160329-13:55:54] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12 [20160329-13:55:55] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160329-13:55:55] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12 [20160329-13:55:56] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160329-13:55:56] [INFO ] An established connection closed to endpoint: NULL:NULL - socket: 12 [20160329-13:55:57] [ERROR] xrdp_mm_connect_chansrv: connect failed trying again... [20160329-13:55:57] [ERROR] xrdp_mm_connect_chansrv: error intrans_connect chan

xrdp-sesman.log: [20160329-13:55:53] [INFO ] A connection received from: 127.0.0.1 port 35492 [20160329-13:55:53] [INFO ] scp thread on sck 8 started successfully [20160329-13:55:53] [INFO ] ++ reconnected session: username natalie, display :11.0, session_pid 28339, ip 217.197.121.34:6665 - socket: 8 [20160329-13:55:53] [INFO ] An established connection closed to endpoint: 127.0.0.1:35492 - socket: 8

And yesterday evening was another one session hang. Yesterday morning I opened this session with xfreerdp - all was nice. I did some reconnects to this session with xfreerdp - no problem. But when I tried to reconnect to session using MS RD client from my android phone, it shows "rdp protocol error" and closes. Then I tried to use another rdp client app from my phone - it connects to xrdp (show me login/password window), but after I entered login and password I got black screen. I tried to reconnect to the session using ms rdp client (Windows 7) and got black screen too. I don't see anything strange in xrdp logs

lrocket commented 8 years ago

today i tried current devel revision of xrdp and got immediately a hanging session. i then tried your suggestion and used xfreerdp and couldnt connect either. so it looks like im having a different problem than you.

metalefty commented 6 years ago

Please create new issues if the issue continues with the latest version. Make sure to report one github issue per one issue.