samp-log-core
samp-log-core copied to clipboard
Incompatibility with PawnPlus, crashes from amx_GetCppString
In reference to an issue on PawnPlus, https://github.com/IllidanS4/PawnPlus/issues/38
Explanation from @IllidanS4:
str_format does not have anything to do with it; any PP string crashes when used in this code. The crash happens inside log-core, which is in turn invoked by the construction of CScopedDebugInfo in mysql_tquery. PawnPlus isn't invoked anywhere in the process. This is an issue in samp-log-core here. It for some reason uses its own copy of the AMX functions, bypassing PP's hooking mechanism, so dynamic strings could never work with it, unless it properly sticks to the AMX API. However, that could not cause the crash on its own, because amx_GetCppString is actually wrong and assumes that amx_GetAddr never fails, which it normally does when used on a PP string. This makes samp-log-core violate the first two points of the GCA for AMX API consumers and thus PawnPlus is not expected to work with it. I suggest you post an issue there so that it can be fixed.
I should also mention that amx_GetCppString
can be triggered to crash with any value outside the AMX range, which is something that could be caused by an incorrectly working Pawn script as well. However, comparing the error with AMX_ERR_NONE
is still a good thing, since even though on one hand a function cannot be expected to work with an invalid value, on the other hand a logger is the last thing that should crash a system.
@maddinat0r https://github.com/IllidanS4/PawnPlus/issues/46
@maddinat0r , pls, fix(((