Zeex / samp-plugin-crashdetect

Crash/error reporting plugin for SA-MP server
http://forum.sa-mp.com/showthread.php?t=262796
BSD 2-Clause "Simplified" License
116 stars 23 forks source link

Crash in reloadfs #45

Closed oscar-broman closed 5 years ago

oscar-broman commented 8 years ago

The server crashes quite often when I reload a FS. It does not crash if I don't use crashdetect, or if I use the JIT plugin. Also, reloading the FS from the console is even more crash-prone than doing it in-game.

How can I debug this further so you get some better information? It's on Windows.

[2015-09-20 17:31:32]   Filterscript 'gang.amx' loaded.
[2015-09-20 17:31:32] [debug] Server crashed due to an unknown error
[2015-09-20 17:31:32] [debug] Native backtrace:
[2015-09-20 17:31:32] [debug] #0 00401696 in ?? () from samp-server.exe
[2015-09-20 17:31:32] [debug] #1 00480c41 in ?? () from samp-server.exe
[2015-09-20 17:31:32] [debug] #2 004912ba in ?? () from samp-server.exe
[2015-09-20 17:31:32] [debug] #3 004912c7 in ?? () from samp-server.exe
ghost commented 8 years ago

Good to know that this is caused by crashdetect.

Confirmed!

[debug] Native backtrace: [debug] #0 00401696 in ?? () from samp-server.exe [debug] #1 03e12726 in _sampgdk_amxhooks_FindPublic () from plugins\YSF.dll [debug] #2 03e16436 in CCallbackManager::OnServerMessage () from plugins\YSF.dll [debug] #3 03e1b8ba in HOOK_logprintf () from plugins\YSF.dll [debug] #4 68032d43 in ?? () from plugins\crashdetect.dll [debug] #5 6802ec2d in ?? () from plugins\crashdetect.dll [debug] #6 6802edc5 in ?? () from plugins\crashdetect.dll [debug] #7 680322e8 in ?? () from plugins\crashdetect.dll [debug] #8 68034626 in ?? () from plugins\crashdetect.dll [debug] #9 7742f675 in ?? () from C:\Windows\SYSTEM32\KERNELBASE.dll [debug] #10 004a1fc6 in ?? () from samp-server.exe [debug] #11 0049b401 in ?? () from samp-server.exe [debug] #12 75727c04 in ?? () from C:\Windows\SYSTEM32\KERNEL32.DLL [debug] #13 776dad1f in ?? () from C:\Windows\SYSTEM32\ntdll.dll [debug] #14 776dacea in ?? () from C:\Windows\SYSTEM32\ntdll.dll

Zeex commented 8 years ago

Have you tried running the server under a debugger (e.g. Visual Studio or WinDbg)? Not sure if that would produce something useful though as it seems to be happening somewhere down inside the server.

I can do this myself if you provide the AMX file for the filterscript, I've tried using some of the standard filterscripts but they didn't reproduce this crash.

ghost commented 8 years ago

Not tried it in VS but you won't get this crash for first time. You need sometimes to reload fs from console around 10-13 times to crash, sometime it crash for first time. Anyway just a simple example script, but the script doesn't matter because after some time it will crash with any script.

http://www.solidfiles.com/d/024a657d41/

oscar-broman commented 8 years ago

Worth mentioning is this should not be confused with the issue that arise if an unfinished HTTP is active while reloading the FS.

ghost commented 8 years ago

I think it's totally not because I don't use anywhere HTTP in my server.

oscar-broman commented 8 years ago

Yeah that's what I said!

Zeex commented 8 years ago

@oscar-broman Could you save a crash dump? (and upload it somewhere where you can later delete it in case it contains sensitive information).

Also I looked up those addresses from the stack trace in IDA, and it seems that the server crashed while trying to call some public because the AMX had been partially freed prior to that (amx->base was NULL or invalid) but I can't say which one as there's not enough info.