OpenParsec / openparsec

GNU General Public License v2.0
51 stars 8 forks source link

Server Segfault #97

Open CrazySpence opened 2 years ago

CrazySpence commented 2 years ago

Currently the server will segfault when run, doesn't matter if it is 32bit or 64bit i can verify it on my host and on a 64bit docker image I just put together for testing

End of the log + gdb output:

Script execution done. Initializing TCP/IP stack... skipping loopback interface

Program received signal SIGSEGV, Segmentation fault. 0x00005555555aacd2 in NODE_Copy (dst=0x555555610b08 <NET_UDPDriver::GetUDPDriver()::_TheUDPDriver+40>, src=0x0) at ../../../../src/parsec_server/net_util_sv.cpp:59 59 {

CrazySpence commented 2 years ago

Looking at the function it will assert if either dst or src are null and in this case src is null for some reason

CrazySpence commented 2 years ago

Back trace makes it look like it's bombing on the initialization of the interface, I wonder if this is like the old Mac OS problem we had where it couldn't find interfaces?

(gdb) bt

0 0x00005555555aacd2 in NODE_Copy (dst=0x555555610b08 <NET_UDPDriver::GetUDPDriver()::_TheUDPDriver+40>, src=0x0) at ../../../../src/parsec_server/net_util_sv.cpp:59

1 0x00005555555ab80f in NET_UDPDriver::_SetupInterface (this=0x555555610ae0 <NET_UDPDriver::GetUDPDriver()::_TheUDPDriver>, p_Node=0x0) at ../../../../src/parsec_server/nl_udpdriver.cpp:610

2 0x00005555555ab6ac in NET_UDPDriver::_RetrieveLocalIP (this=0x555555610ae0 <NET_UDPDriver::GetUDPDriver()::_TheUDPDriver>) at ../../../../src/parsec_server/nl_udpdriver.cpp:530

3 0x00005555555aaf47 in NET_UDPDriver::InitDriver (this=0x555555610ae0 <NET_UDPDriver::GetUDPDriver()::_TheUDPDriver>, szInterface=0x0, selected_port=6582) at ../../../../src/parsec_server/nl_udpdriver.cpp:102

4 0x0000555555594f1b in E_GameServer::Init (this=0x555555613ee0 <E_GameServer::GetGameServer()::_TheGameServer>) at ../../../../src/parsec_server/e_gameserver.cpp:319

5 0x00005555555ac8ca in main (argc=1, argv=0x7fffffffecd8) at ../../../../src/parsec_server/sv_main.cpp:79

CrazySpence commented 2 years ago

Ok, so! this is actually 2 issues, the one listed above is the result of running the server in a container, in bridged mode the networking for the vm is like 0.0.0.0:6589 which we never anticipated for parsec so some of the startup checks are ignoring that and then segfaulting because no addresses exist, ill make another issue for the bug im hitting in the real world

CrazySpence commented 2 years ago

Commented this out of nl_udpdriver.cpp and it worked and I had parsec_server running in a local container and was able to connect to it from my machine

// only handle IPV4 entries if ( ifr->ifr_addr.sa_family != AF_INET ) { continue; }

Honestly that seems like a redundant check since the interface struct is being called against AF_INET to begin with