Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash within Query::buildPlayerInfoBuffer #925

Closed
Northn opened this issue Jun 13, 2024 · 2 comments
Closed

Crash within Query::buildPlayerInfoBuffer #925

Northn opened this issue Jun 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working nightly

Comments

@Northn
Copy link

Northn commented Jun 13, 2024

Describe the bug
Server got randomly crashed when player disconnected. It looks like a some strange race condition

To Reproduce
Have no idea

Expected behavior
Server should not randomly crash when player is disconnected

Screenshots and/or logs
(gdb) bt
#0 0xf7a8aa60 in free () from /lib32/libc.so.6
#1 0xf7dcdf2c in operator delete(void*) () from /lib32/libstdc++.so.6
#2 0x56673beb in std::__new_allocator::deallocate (__p=0x1f <error: Cannot access memory at address 0x1f>,
__n=, this=)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/new_allocator.h:158
#3 std::allocator_traits<std::allocator >::deallocate (__p=0x1f <error: Cannot access memory at address 0x1f>,
__n=, __a=...)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:496
#4 std::_Vector_base<char, std::allocator >::_M_deallocate (
__p=0x1f <error: Cannot access memory at address 0x1f>, __n=, this=)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:387
#5 std::_Vector_base<char, std::allocator >::~_Vector_base (this=)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:366
#6 std::vector<char, std::allocator >::~vector (this=)
at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_vector.h:733
#7 httplib::detail::SocketStream::~SocketStream (this=0xf78df854) at /host/openmp/lib/cpp-httplib/httplib.h:4723
#8 0xf61fad33 in Query::buildPlayerInfoBuffer (this=0x58765ff8, except=0xf78df854)
at /host/openmp/Server/Components/LegacyNetwork/Query/query.cpp:51
#9 0xf62196e4 in Query::buildPlayerDependentBuffers (this=0x58765ff8, except=0xf78df854)
at /host/openmp/lib/RakNet/Include/raknet/../../../../Server/Components/LegacyNetwork/Query/query.hpp:44
#10 RakNetLegacyNetwork::onPlayerDisconnect (this=, player=..., reason=)
at /host/openmp/Server/Components/LegacyNetwork/legacy_network_impl.hpp:313
#11 0xf62196e4 in non-virtual thunk to RakNetLegacyNetwork::onPlayerDisconnect(IPlayer&, PeerDisconnectReason) ()
from components/LegacyNetwork.so
#12 0x566a825e in Impl::DefaultEventDispatcher::dispatch<void, IPlayer&, PeerDisconnectReason, Player&, PeerDisconnectReason&> (
mf=&virtual PlayerConnectEventHandler::onPlayerDisconnect(IPlayer&, PeerDisconnectReason), this=,
args=, args=) at /host/openmp/SDK/include/Impl/events_impl.hpp:133
#13 PlayerPool::clearPlayer (this=, player=..., reason=)
--Type for more, q to quit, c to continue without paging--
at /host/openmp/Server/Source/player_pool.hpp:1791
#14 0x566968f9 in PlayerPool::onPeerDisconnect (this=, peer=..., reason=) at /host/openmp/Server/Source/player_pool.hpp:1816
#15 0x56697318 in non-virtual thunk to PlayerPool::onPeerDisconnect(IPlayer&, PeerDisconnectReason) () at /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/iostream:74
#16 0xf6202f01 in Impl::DefaultEventDispatcher::dispatch<void, IPlayer&, PeerDisconnectReason, IPlayer&, PeerDisconnectReason&> (
mf=&virtual NetworkEventHandler::onPeerDisconnect(IPlayer&, PeerDisconnectReason), args=, this=, args=) at /host/openmp/SDK/include/Impl/events_impl.hpp:133
#17 RakNetLegacyNetwork::OnRakNetDisconnect (this=, reason=PeerDisconnectReason_Quit, rid=) at /host/openmp/Server/Components/LegacyNetwork/legacy_network_impl.cpp:520
#18 RakNetLegacyNetwork::onTick (this=, elapsed=..., now=...) at /host/openmp/Server/Components/LegacyNetwork/legacy_network_impl.cpp:912
#19 0xf620304b in non-virtual thunk to RakNetLegacyNetwork::onTick(std::chrono::duration<long long, std::ratio<1ll, 1000000ll> >, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> > >) () at /host/openmp/Server/Components/LegacyNetwork/legacy_network_impl.cpp:919
#20 0x56678a40 in Impl::DefaultEventDispatcher::dispatch<void, std::chrono::duration<long long, std::ratio<1ll, 1000000ll> >, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> > >, std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> > > const&> (this=,
mf=&virtual CoreEventHandler::onTick(std::chrono::duration<long long, std::ratio<1ll, 1000000ll> >, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long long, std::ratio<1ll, 1000000000ll> > >), args=..., args=...) at /host/openmp/SDK/include/Impl/events_impl.hpp:133
#21 Core::run (this=) at /host/openmp/Server/Source/core_impl.hpp:1413
#22 0x566729ee in main (argc=, argv=) at /host/openmp/Server/Source/server.cpp:153

Commit hash in master
833af23

@Northn Northn added bug Something isn't working nightly labels Jun 13, 2024
@Northn
Copy link
Author

Northn commented Jun 13, 2024

I've noticed here some calls to httplib::detail::SocketStream::~SocketStream and it's not clear how it appeared there, there's no any reference to it within queries component

The only thing I can tell is that at the moment before the server crash, it stuck for like a 20 seconds, and there could be some issues with dynamic ticks feature. It probably could get too high for a second if I'm correct

@AmyrAhmady
Copy link
Member

This should be fixed now in latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nightly
Projects
None yet
Development

No branches or pull requests

2 participants