Open Adrianilloo opened 2 years ago
Last time this was discussed you had a 2nd plugin using DHooks loaded with a likely faulty hook setup, and the crash report indicates that plugin was loaded at the time of that crash. Can I just confirm you've reproduce this with only a single, known-good, DHooks-using plugin running?
Yes, I already tested disabling that plugin (for which I had correctly filled remaining gamedata anyway, here), and, in fact, running with the minimum possible MM and SM plugins + exts and could reproduce same crash. I've just double-checked it (with minimal dependencies, and just this plugin as DHooks one). Identical stacktrace generated.
Without looking at the crash dump yet, this commit might be relevant. https://github.com/peace-maker/DHooks2/commit/aca054f7b4cc60bbdc9ae553522cf63a92b1211c
Hopefully no hook is fired on the same frame after entity removal.. Will have to revisit in that case.
Ok, here is a very important update.
My server is running SourceTV. If I disable it, the crash vanishes (couldn't reproduce anymore the reload crashes for 40-50 times, ~10 total minutes during same server session). As I guessed initially, TV probably influences it due to its early spawning nature each map restart. This also means sm plugins reload
shouldn't trigger the fault, neither.
My TV relevant configs:
autoexec.cfg
:
exec tv
tv_enable 1
tv.cfg
:
tv_name "AdRiAnIlloO`s TV"
server.cfg
:
tv_delay 0
tv_transmitall 1
(There are some file splits for organization reasons, a I run different servers reusing files with symlinks)
Could you link a new crash report on crash.limetech.org? It accelerates the debugging process.
Sorry, deleted last crash dump again accidentally. Here is new one: https://crash.limetech.org/j7nrodanp2lb
Help us help you
Environment
Description
DHooks2 showcases a possible
DHooksCallback::plugin_callback
NULL
pointer de-reference crash sequence when plugins that use it (properly setting hook atOnPluginStart
and having double-checked gamedata) get reloaded. Concretely I repeatedly recompile one of them and have it reloaded by restarting map (doing both steps once each new map session), rather than viasm plugins reload
(which I didn't test yet). The crash has enough chance to happen each map reload.Reference plugin.
Recompiled DHooks info
I recompiled DHooks with some debug logging stataments (targetting error logs, for my own convenience) showing relevant related data (callback addresses, offsets, etc.), manually preventing the crash as well, and resulting logs are attached below. Here are the exact testing changes:
Important: notice how the logs show several map reloads and after one happens, the
dg->plugin_callback was NULL!!!
log arises, and itsdg
object has been cleared early atDHooksEntityListener::CleanupListeners
.It seems to me that the calling stack that triggers this is the following:
DHooksManager::DHooksManager -> MakeHandler(ReturnType type) -> GenerateThunk(ReturnType type) -> Callback(DHooksCallback *dg, void **argStack)
Notice that at
DHooksManager
, theplugin_callback
is only assigned after theMakeHandler
call.Logs
errors_20220107.log crash_j6efozxcjard.zip