sourcemod icon indicating copy to clipboard operation
sourcemod copied to clipboard

KeyValues.ExportToString crashing since 1.11

Open mikleosorey opened this issue 1 year ago • 5 comments

sourcemod-1.11.0 stable

I have several commands that crash after 1.11 and narrowed it down to keyvalues.exporttostring

for me this simple code crashes. KeyValues copy = new KeyValues("Scenario"); char buffer[1000]; copy.ExportToString(buffer,sizeof(buffer));

it worked in 1.10

mikleosorey avatar Aug 18 '24 17:08 mikleosorey

I have narrowed it down to sourcemod-1.11.0-git6939-windows is the point when it starts crashing sourcemod-1.11.0-git6936-windows is fine

I compile on sourcemod-1.11.0-git6939-windows and also run the server on the same version and on 6939 the sm_test causes a crash, while on 6936 it does not and most likely any subsequent builds including 1.12

6939 is just gamedata https://github.com/alliedmodders/sourcemod/commit/720dc510bc4487f2cc941c5634e1693

something between 6936 and 6939 is causing this issue

image

the code (just my test file, so it has some unrelated mess):

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
//#include <emputils>
//#include <socket>
//#include <cURL>
//#include <SteamWorks>

#define PluginVer "v0.1"
 
public Plugin myinfo =
{
	name = "test",
	author = "Neoony",
	description = "test",
	version = PluginVer,
	url = ""
}

//Neat
#pragma semicolon 1
#pragma newdecls required //Unable to use with socket extension

public void OnPluginStart()
{
	//Console commands
	RegConsoleCmd("sm_test", test, "test");

	//Create or load config files
	AutoExecConfig(true, "test");
	//Message
	PrintToServer("[T] test by Neoony - Loaded");
}

public Action test(int client, int args)
{
	KeyValues copy = new KeyValues("Scenario");
	char buffer[1000];
	copy.ExportToString(buffer,sizeof(buffer));
	PrintToServer("test done");
	return Plugin_Handled;
}

Neoony avatar Aug 19 '24 20:08 Neoony

firefox_2024-08-19_22-27-37

weird (I am not really sure how to look at this git, I guess the stuff in master also matters here)

guess in master, probably this? image https://github.com/alliedmodders/sourcemod/commit/1e8db957bf0830a068b92a7c8dee023d46e518fe

Neoony avatar Aug 19 '24 20:08 Neoony

When Empires Mod dev tried to use some debugger: "Can't really give you more info, it hits a breakpoint in ntdll.dll then crashes if you continue Memory corruption Googling the error that is spit out in vs console, this is probably the correct commit https://github.com/alliedmodders/sourcemod/commit/1e8db957bf0830a068b92a7c8dee023d46e518fe Says about array going out of bounds It was Critical error detected c0000374"

EDIT: but not sure, might not be that commit

Neoony avatar Aug 19 '24 20:08 Neoony

Hi. First for all, topic first post lack lot of information, now this turned to guessing.

  • operation system
  • game and game version
  • Is it dedicated server
  • MetaMod:Source version and SourceMod version (use: meta version, sm version)
  • etc. etc.

Seems second person have track when this issue start, but no more information than game is what, "Empires Mod" ? Give more detail, then others can help you.

I tested on Windows10, with latest stable MM:S and SM. using Day Of Defeat: Source dedicated server, and no problems. Works fine.


version
Build Label:           6630498   # Uniquely identifies each build
Network PatchVersion:  6630498   # Determines client and server compatibility
Protocol version:           24   # High level network protocol version
Server version:        6630498
Server AppID:           232290
meta version
 Metamod:Source Version Information
    Metamod:Source version 1.11.0-dev+1155
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: May 14 2024 17:07:57
    Built from: https://github.com/alliedmodders/metamod-source/commit/2009298
    Build ID: 1155:2009298
    http://www.metamodsource.net/
sm version
 SourceMod Version Information:
    SourceMod Version: 1.11.0.6968
    SourcePawn Engine: 1.11.0.6968, jit-x86 (build 1.11.0.6968)
    SourcePawn API: v1 = 5, v2 = 16
    Compiled on: Jun 23 2024 19:39:40
    Built from: https://github.com/alliedmodders/sourcemod/commit/13510eab
    Build ID: 6968:13510eab
    http://www.sourcemod.net/

ambaca avatar Aug 25 '24 12:08 ambaca

Windows Dedicated Server - Empires Mod (SDK 2013) (only testing on srcds, not on listenserver)

version
Build Label:              2970   # Uniquely identifies each build
Network PatchVersion: 2.37.2.2970   # Determines client and server compatibility
Protocol version:           24   # High level network protocol version
Server version:           2970
Server AppID:           460040
meta version
 Metamod:Source Version Information
    Metamod:Source version 1.11.0-dev+1155
    Plugin interface version: 16:14
    SourceHook version: 5:5
    Loaded As: Valve Server Plugin
    Compiled on: May 14 2024 17:19:12
    Built from: https://github.com/alliedmodders/metamod-source/commit/2009298
    Build ID: 1155:2009298
    http://www.metamodsource.net/
sm version
 SourceMod Version Information:
    SourceMod Version: 1.11.0.6939
    SourcePawn Engine: 1.11.0.6939, jit-x86 (build 1.11.0.6939)
    SourcePawn API: v1 = 5, v2 = 16
    Compiled on: Oct  8 2023 23:25:31
    Built from: https://github.com/alliedmodders/sourcemod/commit/720dc510
    Build ID: 6939:720dc510
    http://www.sourcemod.net/

also crashes when using meta 1.12 also crashes on any later sm build or sm 1.12 anything more you need, let me know

Neoony avatar Aug 25 '24 16:08 Neoony

Hi! If you're still seeing this occur please install accelerator and supply us a link to get this rolling.

Headline avatar Jan 31 '25 05:01 Headline