Bug 252534 - net/libvncserver - 0.9.12_2 - SIGBUS in rfbClientDesKey with example program
Summary: net/libvncserver - 0.9.12_2 - SIGBUS in rfbClientDesKey with example program
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Neel Chauhan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-08 22:11 UTC by Will B
Modified: 2021-01-12 04:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (nc)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Will B 2021-01-08 22:11:22 UTC
- FreeBSD 12.2-RELEASE-p1 running on amd64 architecture
- libvncserver 0.9.12_2 - binary package installed from 'pkg install'

After building and running the SDLvncviewer.c example program at:

https://libvnc.github.io/doc/html/_s_d_lvncviewer_8c-example.html

I attempted to connect to any TightVNC server running on Windows 7 or 10 and receive the following error (gdb output):

(gdb) r
Starting program: /usr/home/will/Projects/sdl-vnc-viewer/sdlvncviewer 192.168.0.128
08/01/2021 13:52:51 VNC server supports protocol version 3.8 (viewer 3.8)
08/01/2021 13:52:51 We have 2 security types to read
08/01/2021 13:52:51 0) Received security type 2
08/01/2021 13:52:51 Selecting security type 2 (0/2 in the list)
08/01/2021 13:52:51 1) Received security type 16
08/01/2021 13:52:51 Selected Security Scheme 2
Password: 

Program received signal SIGBUS, Bus error.
0x000000080026b3e5 in rfbClientDesKey () from /usr/local/lib/libvncclient.so.1
(gdb) bt     
#0  0x000000080026b3e5 in rfbClientDesKey () from /usr/local/lib/libvncclient.so.1
#1  0x000000080026afba in rfbClientEncryptBytes () from /usr/local/lib/libvncclient.so.1
#2  0x000000080025c9d9 in ?? () from /usr/local/lib/libvncclient.so.1
#3  0x000000080025b4e8 in InitialiseRFBConnection () from /usr/local/lib/libvncclient.so.1
#4  0x0000000800272bee in rfbInitClient () from /usr/local/lib/libvncclient.so.1
#5  0x0000000000202de1 in main (argc=2, argv=0x7fffffffda48) at sdlvncviewer.c:446

This appears to be an issue only on FreeBSD as building and running this works fine on Linux.

Build command line was:

$ cc -Wall -o sdlvncviewer sdlvncviewer.c -I/usr/local/include -I/usr/include -I/usr/local/include/SDL2 -L/usr/local/lib -lvncclient -lSDL2 -O0 -g

$ cc --version
FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2)
Target: x86_64-unknown-freebsd12.2
Thread model: posix
InstalledDir: /usr/bin

Thank you! :-)
Comment 1 Neel Chauhan freebsd_committer 2021-01-08 22:20:18 UTC
Try building libvncserver from Ports. We are on 0.9.13 now.

If that does not work, try rebuilding with SASL support.

Please report whether those two worked for you or now.
Comment 2 Will B 2021-01-08 22:23:17 UTC
(In reply to Neel Chauhan from comment #1)

Thanks Neel.

I would rather not mix Ports and Packages.  Doing so has caused much pain in the past.  Should I file a bug report to update the libvncserver package to 0.9.13?

Thanks! :-)
Comment 3 Will B 2021-01-12 04:36:19 UTC
Closing because it appears the libvncserver binary package has been updated.  I am no longer seeing this crash.

Thank you! :-)