sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

Constant crash on the same instruction 'rep movs'

Open A1mDev opened this issue 1 year ago • 4 comments

I can’t figure out what the problem is, different plugins crash on one instruction 'rep movs'. I'm using the latest version of sourcepawn.

image

A1mDev avatar Jun 08 '24 09:06 A1mDev

Can you post a crash dump or a stack trace, please?

sapphonie avatar Jun 09 '24 00:06 sapphonie

337863583-b4cc594d-1d0f-4136-9f7f-26ed7e9de5db I did not describe that this is a compiler problem, because if you rebuild the plugin using a new compiler, then after loading this plugin the server will crash

A1mDev avatar Jun 09 '24 13:06 A1mDev

337863583-b4cc594d-1d0f-4136-9f7f-26ed7e9de5db I did not describe that this is a compiler problem, because if you rebuild the plugin using a new compiler, then after loading this plugin the server will crash

That's cool, could you post a text version of the complete stack trace instead of a grainy screenshot of part of it which nobody is going to bother transcribing by hand? Or, again, an actual crash dump, which would be more helpful.

Thanks Steph

sapphonie avatar Jun 12 '24 15:06 sapphonie

I know that it’s not good to write such code, but I found such code in a plugin, and it is this that crashes the server, other plugins with the same instructions also crashed, but I don’t know which parts of the code were compiled incorrectly. Perhaps the code below will give some insight into why this issue might occur. Use source mod 1.12.7140 for testing (update sourcepawn submodule (#2146))

#include <sourcemod>

#define MAX_LEN 32

public void OnPluginStart()
{
	RegConsoleCmd("sm_getchar", Cmd_GetChar);
}

Action Cmd_GetChar(int iClient, int iArgs)
{
	PrintToServer("%s", FooterGet());
	return Plugin_Handled;
}

char[] FooterGet()
{
	static char buffer[MAX_LEN];
	Format(buffer, sizeof(buffer), "asdada");
	
	return buffer;
}

A1mDev avatar Jun 21 '24 19:06 A1mDev

Changes in commit ceffea8 cause crash

A1mDev avatar Nov 20 '24 06:11 A1mDev

Thanks, I can reproduce this.

dvander avatar Nov 29 '24 03:11 dvander

Thanks for the reduced test case, this is fixed on master.

dvander avatar Nov 29 '24 15:11 dvander