Created attachment 220325 [details] Patch (Revision 1) Passes poudriere.
Patch is incorrect, it changes multiple unrelated ports Are options not handled in Makefile disabled by default? If not, you most likely want to disable those as the port may pull in dependencies otherwise if installed.
I bumped PORTREVISION on dependent ports.
Created attachment 220332 [details] Patch (Revision 1) Actually, you're right.
A commit references this bug: Author: jbeich Date: Fri Dec 11 12:51:37 UTC 2020 New revision: 557730 URL: https://svnweb.freebsd.org/changeset/ports/557730 Log: net/libvncserver: update to 0.9.13 - Pass maintainership Changes: https://github.com/LibVNC/libvncserver/releases/tag/LibVNCServer-0.9.13 ABI: https://abi-laboratory.pro/tracker/timeline/libvncserver/ PR: 251649 Submitted by: Neel Chauhan <neel@neelc.org> Reviewed by: daniel.engberg.lists@pyret.net Changes: head/net/libvncserver/Makefile head/net/libvncserver/distinfo head/net/libvncserver/files/patch-libvncclient_sasl.c head/net/libvncserver/files/patch-rfb_rfb.h head/net/libvncserver/files/patch-rfbssl_openssl.c head/net/libvncserver/pkg-plist
Thanks. Landed. Do you need this on 2020Q4 (/quarterly) as well?
I'm not sure if it makes sense to update the closed bug. I've noticed this version broke emulators/virtualbox-ose version. Whole VM crashes when I connect to VM using VNC and press a key. Last working version of libvncserver in my setup is r549922. My setup: FreeBSD 12.2-RELEASE amd64 r367186 virtualbox-ose-5.2.44_4 virtualbox-ose-kmod-5.2.44_4 I've set the host to create coredumps and verified it fails always in the same function: #0 0x0000000802918abd in VNCServerImpl::vncKeyboardEvent (down=0 '\000', keycode=703, cl=0x114) at src/VBox/ExtPacks/VNC/VBoxVNC.cpp:1177 #1 0x000000080293761d in rfbProcessClientMessage () from /usr/local/lib/libvncserver.so.1 #2 0x0000000802933b0d in clientInput () from /usr/local/lib/libvncserver.so.1 (gdb) i r $rdi $rsi $rdx rdi 0x0 0 rsi 0x2bf 703 rdx 0x114 276 (gdb) x/4i $pc => 0x802918abd <_ZN13VNCServerImpl16vncKeyboardEventEajP13_rfbClientRec+29>: mov rax,QWORD PTR [rdx] 0x802918ac0 <_ZN13VNCServerImpl16vncKeyboardEventEajP13_rfbClientRec+32>: mov r15,QWORD PTR [rax+0x30] 0x802918ac4 <_ZN13VNCServerImpl16vncKeyboardEventEajP13_rfbClientRec+36>: cmp ebx,0x7f 0x802918ac7 <_ZN13VNCServerImpl16vncKeyboardEventEajP13_rfbClientRec+39>: jae 0x802918b02 <_ZN13VNCServerImpl16vncKeyboardEventEajP13_rfbClientRec+98> (gdb)
I did a mistake above. The last working version of libvncserver is r556980. I tried to debug what's happening when using working and non-working version. Code that is being called seems to be the same: libvncserver/rfbserver.c:2487 in r557730, libvncserver/rfbserver.c:2456 in r556980. Problem seems to be this call: 2487 cl->screen->ptrAddEvent(msg.pe.buttonMask, 2488 ScaleX(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.x)), 2489 ScaleY(cl->scaledScreen, cl->screen, Swap16IfLE(msg.pe.y)), 2490 cl); While I didn't trace what sets this function pointer (and how it is being updated), every time I trace it in working version it was always pointing to VNCServerImpl::vncMouseEvent(int, int, int, _rfbClientRec*), i.e. 4 argument function. In updated version this function pointer was pointing to VNCServerImpl::vncKeyboardEvent(signed char, unsigned int, _rfbClientRec*) In the crash version %rcx is pointing to proper cl structure as one would expect in 4 arg function. ptrAddEvent() needs 4 args while vncKeyboardEvent() is 3.
Just for the clarification problem was on my side. virtualbox-ose\* has dependency on libvncserver. In my setup I held virtualbox back in /usr/local/etc/pkgtools.conf. The main structure (rfb/rfb.h: rfbScreenInfoPtr) grew in size a bit in higher version. The not updated VNC module in virtualbox (/usr/local/lib/virtualbox/ExtensionPacks/VNC/VBoxVNC.so) was using wrong offsets and hence setting this structure incorrectly. Updating the virtualbox properly fixed this issue, as expected. Sorry for the confusion here.