tinyPortMapper icon indicating copy to clipboard operation
tinyPortMapper copied to clipboard

FreeBSD 14.0 errno=55:No buffer space available

Open jTd7bPLFb opened this issue 1 year ago • 1 comments

After compiling, when trying to start, I get this error

running in a virtual machine (kvm)

SO_SNDBUF fail socket_buf_size=2097152 errno=55:No buffer space available

full output

./tinymapper -l10.18.19.201:2222 -r10.18.19.202:22 -t [2024-03-18 16:03:00][INFO]argc=4 ./tinymapper -l10.18.19.201:2222 -r10.18.19.202:22 -t [2024-03-18 16:03:00][INFO]parsing address: 10.18.19.201:2222 [2024-03-18 16:03:00][INFO]its an ipv4 adress [2024-03-18 16:03:00][INFO]ip_address is {10.18.19.201}, port is {2222} [2024-03-18 16:03:00][INFO]parsing address: 10.18.19.202:22 [2024-03-18 16:03:00][INFO]its an ipv4 adress [2024-03-18 16:03:00][INFO]ip_address is {10.18.19.202}, port is {22} [2024-03-18 16:03:00][FATAL]SO_SNDBUF fail socket_buf_size=2097152 errno=55:No buffer space available

any hint?

-- compiled with make freebsd echo "const char *gitversion = "";" > git_version.h rm -f tinymapper g++ -o tinymapper -I. main.cpp log.cpp common.cpp fd_manager.cpp my_ev.cpp -isystem libev -std=c++11 -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-missing-field-initializers -lrt -ggdb -static -O2

jTd7bPLFb avatar Mar 18 '24 16:03 jTd7bPLFb

i think you might need to manually tune down the 2097152 to a workable value.

On linux this is not a problem, since linux allow you to set a over-sized value. But seems like on BSD it's difference.

wangyu- avatar Jun 13 '24 02:06 wangyu-

sock buffers need to be changed

default is 2MB

sysctl kern.ipc.maxsockbuf kern.ipc.maxsockbuf: 2097152

change to 4MB (it works also with 3MB already)

sysctl -w kern.ipc.maxsockbuf=4194304 kern.ipc.maxsockbuf: 2097152 -> 4194304

to make it permanent

/etc/sysctl.conf kern.ipc.maxsockbuf=4194304

jTd7bPLFb avatar Aug 31 '24 20:08 jTd7bPLFb

other possible fix, setting 1MB as default before compiling

edit main.cpp and replace

const int listen_fd_buf_size=2*1024*1024;
with
const int listen_fd_buf_size=1*1024*1024;

jTd7bPLFb avatar Aug 31 '24 20:08 jTd7bPLFb