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

Constant crash on the same instruction 'rep movs' #977

Closed
A1mDev opened this issue Jun 8, 2024 · 7 comments
Closed

Constant crash on the same instruction 'rep movs' #977

A1mDev opened this issue Jun 8, 2024 · 7 comments

Comments

@A1mDev
Copy link

A1mDev commented Jun 8, 2024

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

@sapphonie
Copy link

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

@A1mDev
Copy link
Author

A1mDev commented Jun 9, 2024

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

@sapphonie
Copy link

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

@A1mDev
Copy link
Author

A1mDev commented Jun 21, 2024

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

A1mDev commented Nov 20, 2024

Changes in commit ceffea8 cause crash

@dvander
Copy link
Member

dvander commented Nov 29, 2024

Thanks, I can reproduce this.

dvander added a commit that referenced this issue Nov 29, 2024
dvander added a commit that referenced this issue Nov 29, 2024
@dvander
Copy link
Member

dvander commented Nov 29, 2024

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

@dvander dvander closed this as completed Nov 29, 2024
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