Defer early match autoload to mitigate client crashes - #1010
Conversation
|
I’m not really convinced this should be considered a fix rather than a workaround. The tests only demonstrate that moving autoload from OnClientPutInServer to player_connect_full makes the crash stop reproducing. The actual cause of the access violation hasn’t been identified. The delay test is especially telling: deferring by one frame still crashes, while waiting roughly one second succeeds. That looks much more like a timing workaround — we’re simply avoiding the problematic window. The generation counter also addresses a separate issue: preventing stale queued callbacks from running after a match unload or map end. It doesn’t address the cause of the crash itself. I’d therefore describe this as a workaround for early autoload rather than a fix for the underlying crash. A proper fix would ideally reproduce this on a pristine upstream setup and identify what exactly about the autoload + map restart sequence causes the client-side AV in shaderapidx9.dll. The workaround itself may be useful and worth keeping, but based on these results, I don’t think we can confidently claim that the underlying crash has been fixed. |
Thanks, that distinction is fair. I’m not claiming this fixes the underlying null-pointer dereference in the client renderer. |
|
Following up with new client-side debugging results. The distinction still stands: this PR is a server-side workaround, but I now have much stronger evidence for the underlying client failure. I reproduced the same The observed failure sequence is:
For this client build, the loading-start guard is at I then tested a targeted, temporary client-memory intervention on an insecure client/server: call the existing queue-disable function once before that early return when the loading flag is set and actual queue mode is 2. It leaves the loading flag intact and does not rerun the loading-screen initialization or increase the server delay.
This supports a client-engine correction to the rendering-state transition, but it is a debugger proof of concept, not a production patch. The tests have debugger timing overhead, the client still has addons, and a pristine upstream reproduction has not yet been completed. These results support the workaround's rationale; they do not turn this PR into a client-engine fix. The PR changes when the existing autoload/restart sequence runs rather than eliminating the second map load. Also, the minimal 3-second failure occurred after |
When
confogl_match_autoload 1is enabled, Confogl currently begins loading mode plugins fromOnClientPutInServer, before the connecting client has completed sign-on. In the tested downstream setup, this repeatedly crashed the Windows client during its first loading screen when the server needed to load ZoneMod and restart the map as part of that connection. Reconnecting succeeded once that work had completed.This change waits for a real client's
player_connect_fullevent, then schedules the existing mode-loading path withRequestFrame. Before executing, it revalidates the client serial, autoload setting, and active-match state. A generation counter invalidates queued work when the map ends or a match unload occurs. Existing plugin loading, manual match commands, and map-restart behavior are otherwise unchanged.Validation
shaderapidx9.dll + 0x612A.OnClientPutInServerby one frame still crashed, while a 1-second delay succeeded. In successfulplayer_connect_fulltests, the event occurred about 0.34-0.37 seconds afterPutInServer.599d14ffpassed both an initial ZoneMod autoload and a later autoload after the mode had unloaded while empty, without restarting the server process.CreateDialogdeprecation warning, andgit diff --checkpasses.A pristine upstream server reproduction has not yet been completed. Subsequent client-side tracing identified an already-loading early return that skips disabling queued material rendering before another map load, leading to the observed null D3D buffer dereference. A targeted, temporary client-memory intervention succeeded twice, with withdrawal reproducing the original crash in the same client process. See the follow-up investigation and limitations. This PR remains a server-side timing workaround, not a fix to the client engine; the generation counter only guards against stale queued work.
This concerns Confogl's built-in
confogl_match_autoload, not the separateconfogl_autoloaderplugin.