Bug 489097 - krdpserver crashes when a connection comes from Remote Desktop Windows 11
Summary: krdpserver crashes when a connection comes from Remote Desktop Windows 11
Status: RESOLVED FIXED
Alias: None
Product: KRdp
Classification: Plasma
Component: general (show other bugs)
Version: 6.1.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
: 488883 489800 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-06-24 10:38 UTC by Gaël Le Baccon
Modified: 2024-07-11 08:15 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Krdp server log with segfault (4.48 KB, text/x-log)
2024-06-24 10:38 UTC, Gaël Le Baccon
Details
Krdp server backtrace (624 bytes, text/plain)
2024-06-24 10:38 UTC, Gaël Le Baccon
Details
gdb screenshot (138.72 KB, image/png)
2024-06-24 21:12 UTC, dalewyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gaël Le Baccon 2024-06-24 10:38:28 UTC
Created attachment 170905 [details]
Krdp server log with segfault

SUMMARY
When i try to connect with Remote Desktop (Windows 11), krdpserver crash with segmentation fault.

I attached krdpserver log and backtrace.

STEPS TO REPRODUCE
1. Launch the server via KCM or CLI : krdpserver -u test -p test --monitor 0
2. Launch Remote Desktop from Windows 11
3. Establish the connection with the server

OBSERVED RESULT
Segementation fault of krdpserver.

EXPECTED RESULT
Remote server screen.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Linux 40
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1

ADDITIONAL INFORMATION
Platform: Wayland
Graphics Card: NVidia GeForce GTX 1650
Graphics processor: NV167
Nvidia driver version: 555.42.02
Comment 1 Gaël Le Baccon 2024-06-24 10:38:52 UTC
Created attachment 170906 [details]
Krdp server backtrace
Comment 2 dalewyn 2024-06-24 21:12:26 UTC
Created attachment 170928 [details]
gdb screenshot

I ran into this exact problem, so I'm attaching a screenshot of some gdb readouts in case it's helpful.
Comment 3 Nate Graham 2024-06-25 15:24:06 UTC
#0  0x00007f26979c8d55 in rdpgfx_send_cache_import_reply_pdu () from /lib64/libfreerdp-server2.so.2
#1  0x00007f2698802b03 in KRdp::gfxCacheImportOffer (context=<optimized out>) at /usr/src/debug/krdp-6.1.0-1.fc40.x86_64/src/VideoStream.cpp:88
#2  0x00007f26979cdd9f in rdpgfx_server_handle_messages () from /lib64/libfreerdp-server2.so.2
#3  0x00007f26979ceea0 in rdpgfx_server_thread_func () from /lib64/libfreerdp-server2.so.2
#4  0x00007f26967691d8 in thread_launcher () from /lib64/libwinpr2.so.2
#5  0x00007f26982471b7 in start_thread () from /lib64/libc.so.6
#6  0x00007f26982c93cc in clone3 () from /lib64/libc.so.6
Comment 4 Mike Smith 2024-06-27 22:30:29 UTC
Hey Gaël would you mind sharing your RDP setting for the client? I ask because I can connect from WIndows 11 and Windows 10 RDP client but only if "Persistent bitmap caching" is turned off on the client. 

You can find that setting if you click on the "Show Options" dropdown and go to the Experience tab of Remote Desktop Connection (clinet side).

Can you confirm if that is active or inactive in your test?
Comment 5 dalewyn 2024-06-28 02:57:11 UTC
(In reply to Mike Smith from comment #4)
> Hey Gaël would you mind sharing your RDP setting for the client? I ask
> because I can connect from WIndows 11 and Windows 10 RDP client but only if
> "Persistent bitmap caching" is turned off on the client. 
> 
> You can find that setting if you click on the "Show Options" dropdown and go
> to the Experience tab of Remote Desktop Connection (clinet side).
> 
> Can you confirm if that is active or inactive in your test?

Not Gael, but I followed your suggestion and got a different error code about a protocol error on my Windows 11 RDP client.
Googling that led me to a suggestion to drop the color resolution down.

So after disabling bitmap caching as you suggested and dropping the color resolution down from 32-bit to 16-bit, I got it to connect. The actual video feed looks like garbage, but it does work in a very janky sense.
Comment 6 Mike Smith 2024-06-28 07:15:14 UTC
(In reply to dalewyn from comment #5)
> (In reply to Mike Smith from comment #4)
> > Hey Gaël would you mind sharing your RDP setting for the client? I ask
> > because I can connect from WIndows 11 and Windows 10 RDP client but only if
> > "Persistent bitmap caching" is turned off on the client. 
> > 
> > You can find that setting if you click on the "Show Options" dropdown and go
> > to the Experience tab of Remote Desktop Connection (clinet side).
> > 
> > Can you confirm if that is active or inactive in your test?
> 
> Not Gael, but I followed your suggestion and got a different error code
> about a protocol error on my Windows 11 RDP client.
> Googling that led me to a suggestion to drop the color resolution down.
> 
> So after disabling bitmap caching as you suggested and dropping the color
> resolution down from 32-bit to 16-bit, I got it to connect. The actual video
> feed looks like garbage, but it does work in a very janky sense.

Ok I've seen this before also. This time it's server side. 

On your krdp server in Fedora what do you have the "video quality" set to? I suspect it's in the middle? Set it to the highest quality. You should then be able to connect with 32-bit colour on the client. 

Report back :)
Comment 7 dalewyn 2024-06-28 08:44:41 UTC
(In reply to Mike Smith from comment #6)
> (In reply to dalewyn from comment #5)
> > (In reply to Mike Smith from comment #4)
> > > Hey Gaël would you mind sharing your RDP setting for the client? I ask
> > > because I can connect from WIndows 11 and Windows 10 RDP client but only if
> > > "Persistent bitmap caching" is turned off on the client. 
> > > 
> > > You can find that setting if you click on the "Show Options" dropdown and go
> > > to the Experience tab of Remote Desktop Connection (clinet side).
> > > 
> > > Can you confirm if that is active or inactive in your test?
> > 
> > Not Gael, but I followed your suggestion and got a different error code
> > about a protocol error on my Windows 11 RDP client.
> > Googling that led me to a suggestion to drop the color resolution down.
> > 
> > So after disabling bitmap caching as you suggested and dropping the color
> > resolution down from 32-bit to 16-bit, I got it to connect. The actual video
> > feed looks like garbage, but it does work in a very janky sense.
> 
> Ok I've seen this before also. This time it's server side. 
> 
> On your krdp server in Fedora what do you have the "video quality" set to? I
> suspect it's in the middle? Set it to the highest quality. You should then
> be able to connect with 32-bit colour on the client. 
> 
> Report back :)

Huh... I admit I didn't see that Video Quality bar until you mentioned it. Maybe I'm getting too old for this. :V

Setting that to max did indeed allow me to connect at 32-bit.

Getting it to connect is a bit flaky though, it seems fairly random whether I get a protocol error or not. I've seen this both with 32-bit and 16-bit color earlier.

I might get around to digging into journalctl and gdb again to see if I can find something interesting, but it's late night here so that will have to wait for another day. :V

Thanks a lot for the suggestions. I hope KRDP will better support Windows RDP (or at least prominently recommend certain configurations) going forward.
Comment 8 Gaël Le Baccon 2024-06-28 09:32:01 UTC
Hey Mike, for me it works when I deactivate "Persistent bitmap caching" but the color is a bit weird (the white is not completely white).
I can't see my mouse either.

CLI : krdpserver -u test -p test --monitor 1 --quality 100

When I use system settings to enable RDP server I have a protocol error on the client side, same error when i use "--plasma" on the command line above.
Comment 9 Gaël Le Baccon 2024-06-28 09:45:34 UTC
(In reply to Gaël Le Baccon from comment #8)
> Hey Mike, for me it works when I deactivate "Persistent bitmap caching" but
> the color is a bit weird (the white is not completely white).
> I can't see my mouse either.
> 
> CLI : krdpserver -u test -p test --monitor 1 --quality 100
> 
> When I use system settings to enable RDP server I have a protocol error on
> the client side, same error when i use "--plasma" on the command line above.

I've understood, the error comes from my configuration, I have too many screens so the resolution is too high :
"Requested size QSize(5120, 1080) exceeds maximum supported hardware size QSize(4096, 4096)"

The question is : how can I configure KRdp monitor settings with KCM ? It's another big subject 😋
Comment 10 Arjen Hiemstra 2024-07-10 08:35:10 UTC
*** Bug 489800 has been marked as a duplicate of this bug. ***
Comment 11 Arjen Hiemstra 2024-07-10 08:54:17 UTC
*** Bug 488883 has been marked as a duplicate of this bug. ***
Comment 12 Bug Janitor Service 2024-07-10 10:27:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/krdp/-/merge_requests/52
Comment 13 Arjen Hiemstra 2024-07-11 08:04:49 UTC
Git commit 14c5689ffb36b5741d64191c8e849faa21a0f55f by Arjen Hiemstra.
Committed on 11/07/2024 at 08:04.
Pushed by ahiemstra into branch 'master'.

Remove bitmap cache handling from VideoStream

We don't support bitmap caching anyway and the upstream implementation
does the same we would do here, but without crashing.

M  +0    -7    src/VideoStream.cpp

https://invent.kde.org/plasma/krdp/-/commit/14c5689ffb36b5741d64191c8e849faa21a0f55f
Comment 14 Arjen Hiemstra 2024-07-11 08:15:41 UTC
Git commit 786cd94f84e1d06f9ee3d4910b0e9eed6c5916cb by Arjen Hiemstra.
Committed on 11/07/2024 at 08:14.
Pushed by ahiemstra into branch 'Plasma/6.1'.

Remove bitmap cache handling from VideoStream

We don't support bitmap caching anyway and the upstream implementation
does the same we would do here, but without crashing.


(cherry picked from commit 14c5689ffb36b5741d64191c8e849faa21a0f55f)

Co-authored-by: Arjen Hiemstra <ahiemstra@heimr.nl>

M  +0    -7    src/VideoStream.cpp

https://invent.kde.org/plasma/krdp/-/commit/786cd94f84e1d06f9ee3d4910b0e9eed6c5916cb