CounterStrikeSharp icon indicating copy to clipboard operation
CounterStrikeSharp copied to clipboard

Crash on player connects.

Open chenbuyi2019 opened this issue 2 years ago • 3 comments

I found my server randomly crash when player connecting.
I was watching the server console and found each crash happens after print someone connecting.

My css version: v56
Server OS: Windows 10,11

there was no PDB file so the mdmp file get no stacktrace.
And finally I built a release counterstrikesharp.dll with PDB file.
According to the mdmp file, the problem is in src\core\managers\player_manager.cpp(367).

image

full stack:

[Inline Frame] counterstrikesharp.dll!std::_Adjust_manually_vector_aligned(void * &) Line 160
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xmemory(160)
[Inline Frame] counterstrikesharp.dll!std::_Deallocate(void * _Ptr, unsigned __int64 _Bytes) Line 262
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xmemory(262)
[Inline Frame] counterstrikesharp.dll!std::allocator<char>::deallocate(char * const _Count, const unsigned __int64) Line 969
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xmemory(969)
[Inline Frame] counterstrikesharp.dll!std::string::_Tidy_deallocate() Line 4838
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xstring(4838)
counterstrikesharp.dll!std::string::operator=(std::string && _Right) Line 2981
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xstring(2981)
[Inline Frame] counterstrikesharp.dll!counterstrikesharp::CPlayer::Initialize(const char *) Line 367
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(367)
counterstrikesharp.dll!counterstrikesharp::PlayerManager::OnClientConnect(CPlayerSlot slot, const char * pszName, unsigned __int64 xuid, const char * pszNetworkID, bool unk1, CBufferString * pRejectReason) Line 126
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(126)
counterstrikesharp.dll!__SourceHook_FHCls_IServerGameClientsClientConnect0::Func(CPlayerSlot p1, const char * p2, unsigned __int64 p3, const char * p4, bool p5, CBufferString * p6) Line 54
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(54)
[Frames may be missing, no binary loaded for engine2.dll]
engine2.dll!00007ffd05fb6993()

there are 3 mdmp file. my server crashed 3 times in 2 hour. and they all get the same stack.
20:26, 21:07, 22:02
image
image
image

chenbuyi2019 avatar Nov 18 '23 14:11 chenbuyi2019

My way to build dll with PDB:

I fork it and changed a little and use github action to build. image

chenbuyi2019 avatar Nov 18 '23 14:11 chenbuyi2019

I just got a new Mdmp. the stack goes here:

Access violation writing location 0x0000000000000000.

[Inline Frame] counterstrikesharp.dll!std::string::_Eos(const unsigned __int64) Line 4815
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xstring(4815)
[Inline Frame] counterstrikesharp.dll!std::string::clear() Line 3673
	at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.37.32822\include\xstring(3673)
[Inline Frame] counterstrikesharp.dll!counterstrikesharp::CPlayer::Disconnect() Line 545
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(545)
counterstrikesharp.dll!counterstrikesharp::PlayerManager::InvalidatePlayer(counterstrikesharp::CPlayer * pPlayer) Line 358
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(358)
counterstrikesharp.dll!counterstrikesharp::PlayerManager::OnClientDisconnect_Post(CPlayerSlot slot, int reason, const char * pszName, unsigned __int64 xuid, const char * pszNetworkID) Line 264
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(264)
counterstrikesharp.dll!counterstrikesharp::PlayerManager::OnClientConnect(CPlayerSlot slot, const char * pszName, unsigned __int64 xuid, const char * pszNetworkID, bool unk1, CBufferString * pRejectReason) Line 123
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(123)
counterstrikesharp.dll!__SourceHook_FHCls_IServerGameClientsClientConnect0::Func(CPlayerSlot p1, const char * p2, unsigned __int64 p3, const char * p4, bool p5, CBufferString * p6) Line 54
	at D:\a\CounterStrikeSharp\CounterStrikeSharp\src\core\managers\player_manager.cpp(54)
[Frames may be missing, no binary loaded for engine2.dll]
engine2.dll!00007ffd05fb6993()

image

chenbuyi2019 avatar Nov 18 '23 14:11 chenbuyi2019

More detail:

very strange, it often happens in slot 58.
image image image image

chenbuyi2019 avatar Nov 18 '23 14:11 chenbuyi2019

As there have been many releases to the project since this issue, I'm going to close it. If you find the same issue on the latest version then re-open the ticket.

B3none avatar Aug 12 '24 18:08 B3none