Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyValues.ExportToString crashing since 1.11 #2202

Open
mikleosorey opened this issue Aug 18, 2024 · 5 comments
Open

KeyValues.ExportToString crashing since 1.11 #2202

mikleosorey opened this issue Aug 18, 2024 · 5 comments

Comments

@mikleosorey
Copy link

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

@Neoony
Copy link

Neoony commented Aug 19, 2024

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
720dc51

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
Copy link

Neoony commented Aug 19, 2024

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
1e8db95

@Neoony
Copy link

Neoony commented Aug 19, 2024

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 1e8db95
Says about array going out of bounds
It was
Critical error detected c0000374"

EDIT: but not sure, might not be that commit

@ambaca
Copy link
Contributor

ambaca commented Aug 25, 2024

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/

@Neoony
Copy link

Neoony commented Aug 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants