Opened 4 hours ago
#22340 new defect
must Copy+Paste in under 1 second to can paste on host, from wayland guest, else VERR_TIMEOUT and host app hangs for 9 sec
Reported by: | foofoofeefeebambam | Owned by: | |
---|---|---|---|
Component: | clipboard | Version: | VirtualBox-7.1.6 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Windows |
Description
I've Arch Linux kde plasma wayland as guest os with VBoxClient --wayland
running on it, and obviously Biderectional setting for clipboard in Devices->Shared Clipboard->Bidirectional menu on the host which is win11.
For testing this I suggest running this on guest os:
$ pkill VBoxClient $ /usr/bin/VBoxClient -vvvvvvvvvvvvvvvf --wayland
(wasn't needed to pkill -9 )
If I RMB->Copy something from either Konsole or Ctrl+C(aka Copy) something selected from mousepad, then this line:
uFmt = g_DcpCtx.Session.clip.uFmt.wait();
gets executed which waits exactly 1 second, it's from file:
VirtualBox-7.1.6/src/VBox/Additions/x11/VBoxClient/wayland-helper-dcp.cpp
During that 1 sec wait if I manage to paste when I just copied, into host's notepad for example, then it works: it does paste it (if it's missing the last character, that's bug https://www.virtualbox.org/ticket/22339 which fixes it), but if that 1 sec passes and I didn't paste it on host yet, but I paste it any time after that 1 sec passed, the app(eg. notepad) on host will hang for a few seconds and then doesn't paste anything but it unhangs after. If that 1 second passed, you see:
wl-dcp VBoxClient Wayland: announcing fFmts=0x1 to host, rc=VERR_TIMEOUT
So a successful, in under 1 sec paste looks like this:
12:09:28.204894 main VBoxClient Wayland: Service started 12:09:33.781989 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_device_data_offer 12:09:33.782812 wl-dcp VBoxClient Wayland: session end [Copy clipboard to the host], rc=VINF_SUCCESS, rcEnd=VINF_SUCCESS 12:09:33.783607 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_session_start_generic_cb 12:09:33.784111 wl-dcp VBoxClient Wayland: session start [Copy clipboard to the host], rc=VINF_SUCCESS, rcStart=VINF_SUCCESS 12:09:33.784840 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:09:33.785420 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:09:33.786241 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:09:33.786733 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:09:33.787612 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:09:33.788122 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:09:33.788912 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:09:33.789423 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:09:33.790112 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:09:33.790677 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:09:33.794099 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:09:33.794826 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:09:33.795589 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_device_selection 12:09:33.796845 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_device_data_offer], cUsers=2 12:09:33.798032 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_report_cb 12:09:34.246357 wl-focus VBoxClient Wayland: guest property change: name: /VirtualBox/GuestAdd/GuiOnFocus, val: 0, flags: TRANSIENT, RDONLYGUEST, fWasDeleted: false 12:09:34.247048 wl-focus VBoxClient Wayland: trigger popup, rc=VINF_SUCCESS 12:09:34.452235 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read 12:09:34.452782 wl-clip VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=3 12:09:34.453713 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read_join_cb 12:09:34.517099 wl-dcp VBoxClient Wayland: Wayland: read chunk of 7 bytes from Wayland 12:09:34.517751 wl-dcp VBoxClient Wayland: Wayland: read 7 bytes from Wayland 12:09:34.518310 wl-dcp VBoxClient Wayland: will send fmt=0x1 (text/plain) to the host 12:09:34.518816 wl-dcp VBoxClient Wayland: announcing fFmts=0x5 to host, rc=VINF_SUCCESS 12:09:34.519368 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_device_data_offer], cUsers=2, rc=VINF_SUCCESS 12:09:34.556490 wl-clip VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=1, rc=VINF_SUCCESS
A copy on guest without any paste on host looks like this:
12:10:33.660748 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_device_data_offer 12:10:33.661317 wl-dcp VBoxClient Wayland: session end [Copy clipboard to the host], rc=VINF_SUCCESS, rcEnd=VINF_SUCCESS 12:10:33.661993 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_session_start_generic_cb 12:10:33.662725 wl-dcp VBoxClient Wayland: session start [Copy clipboard to the host], rc=VINF_SUCCESS, rcStart=VINF_SUCCESS 12:10:33.663531 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:10:33.664052 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:10:33.664975 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:10:33.665499 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:10:33.666251 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:10:33.666781 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:10:33.667598 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:10:33.668143 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:10:33.668914 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_control_offer_offer 12:10:33.669487 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=2 12:10:33.670257 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_add_fmt_cb 12:10:33.670759 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_control_offer_offer], cUsers=1, rc=VINF_SUCCESS 12:10:33.671604 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_data_device_selection 12:10:33.672758 wl-dcp VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_device_data_offer], cUsers=2 12:10:33.674070 wl-dcp VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_report_cb 12:10:34.693429 wl-dcp VBoxClient Wayland: announcing fFmts=0x5 to host, rc=VERR_TIMEOUT 12:10:34.694050 wl-dcp VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_data_device_data_offer], cUsers=1, rc=VERR_TIMEOUT
then a paste (which is way later than 1 sec) on host looks like this in addition to the above:
12:11:35.403249 wl-focus VBoxClient Wayland: guest property change: name: /VirtualBox/GuestAdd/GuiOnFocus, val: 0, flags: TRANSIENT, RDONLYGUEST, fWasDeleted: false 12:11:35.403999 wl-focus VBoxClient Wayland: trigger popup, rc=VINF_SUCCESS 12:11:35.753397 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read 12:11:35.753854 wl-clip VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=2 12:11:35.754563 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read_join_cb 12:11:39.837279 wl-clip VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=1, rc=VERR_TIMEOUT 12:11:39.838130 wl-clip VBoxClient Wayland: cannot process host clipboard event, rc=VERR_TIMEOUT 12:11:40.755992 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read 12:11:40.756538 wl-clip VBoxClient Wayland: session join [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=2 12:11:40.757259 wl-clip VBoxClient Wayland: vbcl_wayland_hlp_dcp_gh_clip_read_join_cb 12:11:44.805809 wl-clip VBoxClient Wayland: session leave [Copy clipboard to the host @ vbcl_wayland_hlp_dcp_gh_clip_read], cUsers=1, rc=VERR_TIMEOUT 12:11:44.806598 wl-clip VBoxClient Wayland: cannot process host clipboard event, rc=VERR_TIMEOUT
so looks like host hangs for 9 seconds when a paste is issued.
oh, the setting in Clipboard from systray of kde plasma wayland might matter, I've: under "General", then "Selection and Clipboard" [ ] "Keep the selection and clipboard the same" is deselected/disabled, otherwise, when you doubleclick a work in Konsole it gets Copy-ed instantly, without you having to RMB and choose Copy.
ok, I know you want me to attach the whole VBox.log but I'm kinda resisting that because it has lots of sensitive info that I'd rather not share for privacy reasons. Instead maybe I should give better reproduction steps, like by using an arch linux vm for virtualbox... I could do that if it helps. Meanwhile, any ideas/hints on what to look for or do ? But I doubt I can crack this one on my own, as I don't even understand what's going on with wayland calls/callbacks there in code.
I can for example extend that 1 second to +3 seconds, so 4 total seconds by doing this:
-
VirtualBox-7.1.6/src/VBox/Additions/x11/VBoxClient/wayland-helper-dcp.cpp
diff --git a/VirtualBox-7.1.6/src/VBox/Additions/x11/VBoxClient/wayland-helper-dcp.cpp b/VirtualBox-7.1.6/src/VBox/Additions/x11/VBoxCli ent/wayland-helper-dcp.cpp index 6589b55d..b5764ea0 100644
a b 28 28 * SPDX-License-Identifier: GPL-3.0-only 29 29 */ 30 30 31 #include <thread> 32 #include <chrono> 33 31 34 #include <iprt/env.h> 32 35 #include <iprt/assert.h> 33 36 #include <iprt/string.h> … … static DECLCALLBACK(int) vbcl_wayland_hlp_dcp_gh_clip_report_cb( 827 836 rc = VbglR3ClipboardReportFormats(g_DcpCtx.pClipboardCtx->idClient, fFmts); 828 837 if (RT_SUCCESS(rc)) 829 838 { 839 LogRel(("!!!Sleeping 3 sec.\n")); 840 std::this_thread::sleep_for(std::chrono::seconds(3)); 841 LogRel(("!!!Done sleeping 3 sec.\n")); 842 LogRel(("!!!!! about to wait to send fmt (this means u just copied something on guest OS, quick paste it on HOST os in under 1 sec for it to work)\n")); 830 843 uFmt = g_DcpCtx.Session.clip.uFmt.wait(); 831 844 if (uFmt != g_DcpCtx.Session.clip.uFmt.defaults()) 832 845 {
now you have 4 seconds between the copy from guest kde plasma wayland Konsole or mousepad, and the paste on win11 host to work, but it only pastes it after the 4 seconds elapsed, yet u still have to do the ctrl+v aka paste before the 4 sec elapse.
So maybe devs (who no doubt know how all this works (unlike me)) could get an idea as to why it works during that 1 sec (or 4 sec with the patch), but doesn't after. This is my hope with this. And I'm hoping to avoid the need to attach VBox.log, I'd rather give (better) repro steps next:)