alliedmodders / sourcemod

SourceMod - Source Engine Scripting and Administration
http://www.sourcemod.net/
965 stars 421 forks source link

[TF2] The server crashes when recording a replay. | Replay Crash | SDKTools Issue #1581

Closed LapplandBro closed 1 year ago

LapplandBro commented 2 years ago

I wanted to enable the recording system [Replay] on the TF2 server. Crashed about 3 times on different maps.

Regularity of the error - crashes only when the player is recording. All settings are correct, recording files are downloaded and successfully created. When completely unloading plugins - the error persists. All plugins are updated to the latest versions.

Setting permissions for the server process - full access to files and folders.

Temporary player record files remain in temporary folder. No files were detected on web server.

When completely unloading SDKTools/Hooks - no error. Accelerator showed that the problem is in line 54. The error is unknown.

OS - Windows 10 21h1. Sourcemod version 1.10.6510.

================================================================================

https://github.com/alliedmodders/sourcemod/blob/1eae765dc3fe7b2ff28c4ad444970399f1e2b88c/extensions/sdktools/hooks.cpp#L54

Accelerator Web-Page - https://crash.limetech.org/mqe6krznrn75

sdktools.ext.2.tf2.dll!__SourceHook_FHCls_IBaseFileSystemFileExists0::Func(char const ,char const ) [hooks.cpp:51 + 0x146] replay.dll + 0x4237c vstdlib.dll + 0x6480 vstdlib.dll + 0x6d5c tier0.dll + 0xea42 tier0.dll + 0x25a35 kernel32.dll + 0x1fa29 ntdll.dll + 0x676b4 ntdll.dll + 0x67684

OllyDebug 2.00 debug - ACCESS_VIOLATION_WHEN_READING_FILE or ERROR_FILE_NOT_FOUND unknown

[SM] Listing 63 plugins: 01 "Admin File Reader" (1.11.0.6695) by AlliedModders LLC 02 "Admin Help" (1.11.0.6695) by AlliedModders LLC 03 "Admin List" (1.3.1) by Fredd, killer666, W22 04 "Admin Menu" (1.11.0.6695) by AlliedModders LLC 05 "Advertisements" (2.0.2) by Tsunami 06 "Anti Color Abuse" (1.0.0) by 11530 07 "Anti-Flood" (1.11.0.6695) by AlliedModders LLC 08 "Ban disconnected players" (1.05) by mad_hamster 09 "Banned Sprays" (0.0.3.8) by TnTSCS aka ClarkKent 10 "Basic Chat" (1.11.0.6695) by AlliedModders LLC 11 "Basic Comm Control" (1.11.0.6695) by AlliedModders LLC 12 "Basic Commands" (1.11.0.6695) by AlliedModders LLC 13 "Basic Info Triggers" (1.11.0.6695) by AlliedModders LLC 14 "Basic Votes" (1.11.0.6695) by AlliedModders LLC 15 "Client Preferences" (1.11.0.6695) by AlliedModders LLC 16 "[Source 2013] Custom Chat Colors Toggle Module" (2.0.0) by Dr. McKay, Mini 17 "[Source 2013] Custom Chat Colors" (3.1.0) by Dr. McKay 18 "[Discord] Core" (1.0.8) by CrazyHackGUT aka Kruzya 19 "[Discord] Simple Report System" (1.2.2) by CrazyHackGUT aka Kruzya 20 "Fun Commands" (1.11.0.6695) by AlliedModders LLC 21 "Fun Commands X" (2.5) by Spazman0 and Arg! 22 "Fun Votes" (1.11.0.6695) by AlliedModders LLC 23 "Give Bots Cosmetics" (1.10) by luki1412 24 "Give Bots Weapons" (1.10a) by luki1412 25 "[TF2] Server Help Menu" (1.1.08) by ╨Э╨░╨╝ ╨╜╤Г╨╢╨╜╤Л ╨║╨╛╤Б╤В╤Л╨╗╨╕! - (C) WOLFA22 26 "Hide Plugin List" (1.0.0) by Bara 27 "[Lilac] Little Anti-Cheat" (1.7.0) by J_Tanzanite 28 "Nextmap" (1.11.0.6695) by AlliedModders LLC 29 "[TF2] No Enemies In Spawn" (1.1.08) by Dr. McKay 30 "[TF2] Doomsday nuke" (1.3) by Pelipoika (main) & Orion (lil' option) 31 "Player Commands" (1.11.0.6695) by AlliedModders LLC 32 "Player Ranks" (3.4.1) by Aderic 33 "Players Votes" (1.5.0) by The Resident, pZv! 34 "Plugins Manager" (1.1) by CrazyHackGUT aka Kruzya 35 "TF2 Projectile Collision Fix" (1.1.0) by Bakugo 36 "Reserved Slots" (1.11.0.6695) by AlliedModders LLC 37 "[TF2] Respawn Effects" (3.2) by Lucas 'aIM' Maza 38 "SourceBans: Admin Config Loader" (1.6.2) by AlliedModders LLC, Sarabveer(VEERтДв) 39 "SourceBans++: Bans Checker" (1.6.2) by psychonic, Ca$h Munny, SourceBans++ Dev Team 40 "SourceBans++: SourceComms" (1.6.2) by Alex, SourceBans++ Dev Team 41 "SourceBans++: Main Plugin" (2.0) by SourceBans Development Team, SourceBans++ Dev Team 42 "SourceBans++: SourceSleuth" (1.6.2) by ecca, SourceBans++ Dev Team 43 "SendFile Exploit Fix (v3.1)" (3.1) by backwards 44 "Server Hud Logo" (2.2) by ReFlex 45 "Simple Chat Processor (Redux)" (2.1.0) by Simple Plugins, Mini 46 "SourceMod Anti-Cheat" (0.8.7.3) by SMAC Development Team 47 "SMAC Aimbot Detector" (0.8.7.3) by SMAC Development Team 48 "SMAC AutoTrigger Detector" (0.8.7.3) by SMAC Development Team 49 "SMAC Rcon Locker" (0.8.7.3) by SMAC Development Team 50 "[TF2] Smooth Sentry Construct & Upgrade Animations" (1.0) by Pelipoika 51 "[ANY] ConVars Anomaly Fixer" (1.8) by Dragokas 52 "Observer Point" (1.0.100) by Dog 53 "REGEX word filter" (1.2) by Twilight Suzuka 54 "SM Zones" (1.1) by Root (based on "Anti Rush" plugin by Jannik 'Peace-Maker' Hartung) 55 "[ANY] Spray Exploit Fixer" (2.1) by SilverShot 56 "Steph's AntiCheat (StAC)" (5.0.7) by steph&nie 57 "SteamWorks Game Description Override" (1.1) by Dr. McKay, Sarabveer(VEERЩ) 58 "TauntPoser" (1.0.0) by Pelipoika 59 "[TF2] TF2Attributes" (1.3.3@nosoop-1.6.0) by FlaminSarge 60 "TF2IDB" (0.94.0) by Bottiger, FlaminSarge 61 "[TF2] Rate of Fire" (1.2) by EHG 62 "Tidy Chat" (0.5) by linux_lover 63 "[ANY] Unrestricted FOV" (1.2.0) by Dr. McKay sm exts list [SM] Displaying 20 extensions: [01] Automatic Updater (1.10.0.6510): Updates SourceMod gamedata files [02] Webternet (1.10.0.6510): Extension for interacting with URLs [03] Accelerator (2.5.0): SRCDS Crash Handler [04] Equinox Console Cleaner (): Bite me alien boi [05] CStudioHdr::GetSharedPoseParameter Fix (0.1): [06] TF2Items (1.6.4): TF2 Item Modifier [07] TF2 Tools (1.10.0.6510): TF2 extended functionality [08] BinTools (1.10.0.6510): Low-level C/C++ Calling API [09] SDK Hooks (1.10.0.6510): Source SDK Hooks [10] SDK Tools (1.10.0.6510): Source SDK Tools [11] Regex (1.10.0.6510): Provides regex natives for plugins [12] Top Menus (1.10.0.6510): Creates sorted nested menus [13] Client Preferences (1.10.0.6510): Saves client preference settings [14] SQLite (1.10.0.6510): SQLite Driver [15] REST in Pawn (1.0.5): Provides HTTP and JSON natives for plugins [16] DHooks (2.2.0): Dynamic Hooks [17] SteamWorks Extension (1.2.3): Exposes SteamWorks functions to Developers [18] MySQL-DBI (1.10.0.6510): MySQL driver implementation for DBI

SourceMod Version Information: SourceMod Version: 1.10.0.6510 SourcePawn Engine: 1.10.0.6510, jit-x86 (build 1.10.0.6510) SourcePawn API: v1 = 5, v2 = 12 Compiled on: Jul 12 2021 05:51:14 Built from: https://github.com/alliedmodders/sourcemod/commit/0b468f21 Build ID: 6510:0b468f21 http://www.sourcemod.net/

Minidump attached. minidump_srcds.zip

======================================

Windows Event Viewer -

Failed application name: srcds.exe, version: 0.0.0.0, timestamp: 0x60cd2760 Failed module name: sdktools.ext.2.tf2.dll, version: 1.10.0.6510, timestamp: 0x60ec3b45 Exclusion code: 0x80000003 Error Offset: 0x00017236 Failed process ID: 0x4a4 Start time of the failed application: 0x01d7aade7538f447 Failed application path: S:\Servers\srcds\stable_casual_server\srcds.exe Failed module path: s:\servers\srcds\stable_casual_server\tf\addons\sourcemod\extensions\sdktools.ext.2.tf2.dll Report ID: ec09d42f-ca55-4a7f-a3c5-e20fdac4bb20

Error Container 1933668206107507159, Type 1 Event Name: APPCRASH Response: No data CAB ID: 0

Problem Signature: P1: srcds.exe P2: 0.0.0.0 P3: 60cd2760 P4: sdktools.ext.2.tf2.dll P5: 1.10.0.6510 P6: 60ec3b45 P7: 80000003 P8: 00017236

psychonic commented 2 years ago

This is somewhat of a known issue due to replay calling FileExists off of the main thread, combined with the hook on it. There is some discussion about it on #493. There was a partial workaround implemented in #512, just not attempting to not add the hook on TF2 if replay is enabled, which makes the crash there a little confusing.

psychonic commented 2 years ago

Are you still able to reproduce this issue on SM 1.11.6786 or later?

LapplandBro commented 2 years ago

I'll do it on the test server and I'll let you know tomorrow or the day after.

LapplandBro commented 2 years ago

image Not Fixed. sdktools.ext.2.tf2.dll!__SourceHook_FHCls_IBaseFileSystemFileExists0::Func(char const ,char const ) [hooks.cpp:54 + 0x146] https://crash.limetech.org/b7zbruvfwrxp I don't understand, why is the file lost in the debugger? Is it possible to use C++ to catch an exception and simply shut down this piece of code if an exception occurs?

hydrogen-mvm commented 1 year ago

@psychonic @LapplandBro This should be fixed now in https://github.com/alliedmodders/sourcemod/pull/2033 . I think this issue can be marked as resolved (hopefully for good), but up to you guys.

Thanks.

psychonic commented 1 year ago

Thanks. I had forgotten that this was still open, but was out of ideas and without time available to debug further.