skyrim-multiplayer / skymp

Multiplayer Mod & TypeScript SDK for Skyrim Special Edition
Other
217 stars 75 forks source link

Tests: Unknown bind__() error 98 #111

Closed nic11 closed 3 years ago

nic11 commented 3 years ago
$ ./skymp5-server/cpp/unit
[ESPM] Skyrim.esm read in 0.103972s, parsed in 3.09136s, size is 238Mb
[ESPM] Update.esm read in 0.009465s, parsed in 0.048818s, size is 17Mb
[ESPM] Dawnguard.esm read in 0.010295s, parsed in 0.294307s, size is 24Mb
[ESPM] HearthFires.esm read in 0.001476s, parsed in 0.046697s, size is 3Mb
[ESPM] Dragonborn.esm read in 0.030766s, parsed in 0.573462s, size is 61Mb
DoMessage for 1 users took 59 microseconds
Unknown bind__() error 98.

...

System info:

$ cmake --version
cmake version 3.21.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ clang++-12 --version
Ubuntu clang version 12.0.0-3ubuntu1~20.04.3
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ node --version 
v14.17.4

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
nic11 commented 3 years ago

Probably Linux-only issue, didn't see that line with Windows build.

According to strace:

socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) = 15
setsockopt(15, SOL_SOCKET, SO_RCVBUF, [262144], 4) = 0
setsockopt(15, SOL_SOCKET, SO_LINGER, 0x7ffe5ded1a60, 4) = -1 EINVAL (Invalid argument)
setsockopt(15, SOL_SOCKET, SO_SNDBUF, [16384], 4) = 0
setsockopt(15, SOL_SOCKET, SO_BROADCAST, [1], 4) = 0
setsockopt(15, SOL_IP, IP_HDRINCL, [0], 4) = -1 ENOPROTOOPT (Protocol not available)
bind(15, {sa_family=AF_INET, sin_port=htons(7778), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
close(15)                               = 0
write(1, "Unknown bind__() error 98.\n", 27) = 27
close(15)                               = -1 EBADF (Bad file descriptor)

Also, double-close here. Should be fixed somehow.

nic11 commented 3 years ago

Came from here: https://github.com/SLikeSoft/SLikeNet/blob/cca394f05e9e9e3e315a85539e648f267d3f2fcc/Source/src/RakNetSocket2_Berkley.cpp#L234

This also explains why this doesn't get printed on Windows, since this is Unix-specific branch. But probably Windows is also affected by this issue.

nic11 commented 3 years ago

We've got SLikeNet version dated Sep 4, 2019 according to commit hash cca394f05e9e9e3e315a85539e648f267d3f2fcc from vcpkg port. The most recent commit is dated Jul 1, 2021, however. Maybe upgrade will fix it?

Security-1337 commented 3 years ago

так апгрейдни и чекни ты че гений что ли, нахуй пишешь в иссуе если тут иссуе с головой

Security-1337 commented 3 years ago

bind(15, {sa_family=AF_INET, sin_port=htons(7778), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use) - не смущает да?

nic11 commented 3 years ago

@solomun259 Please refrain from abusive speech and keep conversations appropriate. See https://github.com/skyrim-multiplayer/skymp/blob/main/CONTRIBUTING.md:

No offensive language in code - Let's code and comment in ways that do not hurt anyone.

This also applies to issue comments. Please also keep it in English language.

As for your comment, I did see error text. Keep in mind that checking new version of dependency requires building it again with changes to vcpkg port, and this takes some time. Also, I did not see any new commits featuring this file since that day which could change the situation (but I'll try upgrading despite that).

Pospelove commented 3 years ago

This is expected. See: https://github.com/skyrim-multiplayer/skymp/blob/45ccd6323ff1f59d5ec91e25fbb3c645c2c308f4/skymp5-server/cpp/unit/NetworkingTest.cpp#L61