samp-plugin-crashdetect
samp-plugin-crashdetect copied to clipboard
My server only connects with crashdetect
This error appears right on the call.
[08:39:15] Long callback execution detected (hang or performance issue)
[08:39:15] AMX backtrace:
[08:39:15] #0 00009ea0 in Opcode:UnrelocateOpcode (Opcode:opcode=-147921579) at C:\Users\Pichau\Desktop\SA-MP\dependencies\Pawn.RakNet\src\..\..\amx_assembly\opcode.inc:744
[08:39:15] #1 00010c74 in CodeScanRunFastPrescanRelocate (&proc=@02585824 -5947932, &nextaddr=@02585820 -5951856, searchFuncAddr=43916) at C:\Users\Pichau\Desktop\SA-MP\dependencies\Pawn.RakNet\src\..\..\amx_assembly\codescan.inc:827
[08:39:15] #2 000110d0 in bool:CodeScanRunFast (csState[CodeScanner:164]=@02586040, searchFuncAddr=43916) at C:\Users\Pichau\Desktop\SA-MP\dependencies\Pawn.RakNet\src\..\..\amx_assembly\codescan.inc:867
[08:39:15] #3 00012ed4 in AddressofResolve () at C:\Users\Pichau\Desktop\SA-MP\dependencies\Pawn.RakNet\src\..\..\amx_assembly\addressof_jit.inc:130
[08:39:15] #4 000137b0 in public AMX_OnCodeInit () at C:\Users\Pichau\Desktop\SA-MP\dependencies\YSI-Includes\YSI_Data\y_foreach\..\..\YSI_Coding\y_va\..\..\YSI_Core\y_core\y_thirdpartyinclude.inc:367
[08:39:15] #5 00003098 in public Debug_OnCodeInit () at C:\Users\Pichau\Desktop\SA-MP\dependencies\YSI-Includes\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_amx_impl.inc:206
[08:39:15] #6 000029ec in public ScriptInit_OnCodeInit () at C:\Users\Pichau\Desktop\SA-MP\dependencies\YSI-Includes\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_debug_impl.inc:644
[08:39:15] #7 00001524 in bool:ScriptInit_CallOnCodeInit (bool:jit=false, bool:fs=false) at C:\Users\Pichau\Desktop\SA-MP\dependencies\YSI-Includes\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_scriptinit_impl.inc:375
[08:39:15] #8 00001e48 in public OnGameModeInit () at C:\Users\Pichau\Desktop\SA-MP\dependencies\YSI-Includes\YSI_Data\y_foreach\..\..\YSI_Core\y_core\y_scriptinit_impl.inc:624
When I don't crashdetect plugins in server.cfg, GameMode won't load.
Looks like that backtrace appears because the init of the YSI-Includes is taking up too much time. As far as I know, Y_Less recently made use of a feature available in crashdetect, so it won't report those code init callbacks anymore, as they always take too much to be executed (lots of things are done there, so that can't really be improved).
It is hard to tell why your server won't load without crashdetect, but there are two things to try:
- Try loading your server without any filterscripts and if that works. If it will work, it means that there's a crash when initializing any of the filterscripts, so you would have to debug that. If it still doesn't work, try debugging your
OnGameModeInit
. You can try a basic debugging by placing lots ofprint
in your code. After every 15 lines or so in your callback, you could add some kind ofOnGameModeInit 1/2/3/[and so on, each one being an increment of the last one]
. If the server goes into yourOnGameModeInit
but it won't come out of it without crashing, then the problem is somewhere between the lastprint
that got its output written in theserver_log.txt
file and the nextprint
, which didn't get written there. If you find an interval like that, try adding moreprint
functions between those lines, to find the exact line that is crashing. - If none of the
print
s mentioned in the previous step are displayed, including aprint
placed on the first line of yourOnGameModeInit
, it probably means that it is crashing in one of your libraries'OnGameModeInit
hook. Maybe you have a pretty old YSI-Includes library? Try updating it. Old libraries versions can be unstable, so it is worth a try. If it still doesn't work (after you manage to successfully upgrade the version), try updating more of your libraries. This one may take more time, if you are currently using ancient library versions. Converting from ancient versions to the latest versions may require plenty of code changes. You may also need to do theprint
debugging in your libraries.