Raised This Month: $51 Target: $400
 12% 

Not enough space on the stack


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-04-2014 , 11:22   Not enough space on the stack
Reply With Quote #1

Hey,

One of my plugins crashs the server if there much people.
The plugin give this error:
Plugin encountered error 8: Not enough space on the stack

On this line: decl String:g_Classname[9999];
even with decl String:g_Classname[32];

PHP Code:
public OnClientPutInServer(client)
{
    if(
IsValidClient(client))
    {
        
SDKHook(clientSDKHook_WeaponEquipOnWeaponEquip);
    }
}

public 
Action:OnWeaponEquip(clientweapon)
{
    
decl String:g_Classname[9999];
    
GetEdictClassname(weapong_Classnamesizeof(g_Classname));

I hope you can help me
TheWho is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 05-04-2014 , 11:28   Re: Not enough space on the stack
Reply With Quote #2

I get that error too sometimes. But mine is in item_pickup source event and doesn't really do anything, it seems like it doesn't even stop that function's section from working.
9999 clearly is too much. But i only allocate 64 and it still does it.
xf117 is offline
Send a message via ICQ to xf117
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-04-2014 , 11:30   Re: Not enough space on the stack
Reply With Quote #3

Yes exactly, btw it is CS:GO.
I tried some values always this error, and this crash my server with ~20 players.

edit1: Still crashing with 32 players.

Last edited by TheWho; 05-04-2014 at 11:51.
TheWho is offline
Mainstaff
AlliedModders Donor
Join Date: May 2011
Old 05-04-2014 , 11:49   Re: Not enough space on the stack
Reply With Quote #4

Quote:
Originally Posted by xf117 View Post
I get that error too sometimes. But mine is in item_pickup source event and doesn't really do anything [...]
Same problem here. In the end I had to remove the plugin.

I also tried
Quote:
#pragma dynamic 65536
but this didn't help.

Last edited by Mainstaff; 05-04-2014 at 11:51.
Mainstaff is offline
TheWho
AlliedModders Donor
Join Date: Jul 2012
Old 05-04-2014 , 12:01   Re: Not enough space on the stack
Reply With Quote #5

I tried #pragma dynamic 131072 also.

It didn't helped.

I think it is because the Soucemod snapshot: "sourcemod-1.5.4-hg4036-linux". Something wrong with it.

Last edited by TheWho; 05-04-2014 at 12:03.
TheWho is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 05-04-2014 , 12:34   Re: Not enough space on the stack
Reply With Quote #6

CS:Go too. Gentoo machine.
I don't think it is related to any sourcemod version. I had this thing for a while. 6 months at least.
xf117 is offline
Send a message via ICQ to xf117
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 05-04-2014 , 13:09   Re: Not enough space on the stack
Reply With Quote #7

Running out of stack space might be a symptom of infinite recursion. We need to see more code.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 05-05-2014 , 08:55   Re: Not enough space on the stack
Reply With Quote #8

It may lag if you use this extension. I had 'not enough space on the stack' when using this ext. However, it was also happening on item_pickup] event. You may want to create a timer/use SDKHook_WeaponEquipPost hook or provide more code.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Bittersweet
Veteran Member
Join Date: May 2012
Old 05-05-2014 , 17:07   Re: Not enough space on the stack
Reply With Quote #9

Quote:
Originally Posted by TheWho View Post
Hey,

One of my plugins crashs the server if there much people.
The plugin give this error:
Plugin encountered error 8: Not enough space on the stack

On this line: decl String:g_Classname[9999];
even with decl String:g_Classname[32];

PHP Code:
public OnClientPutInServer(client)
{
    if(
IsValidClient(client))
    {
        
SDKHook(clientSDKHook_WeaponEquipOnWeaponEquip);
    }
}

public 
Action:OnWeaponEquip(clientweapon)
{
    
decl String:g_Classname[9999];
    
GetEdictClassname(weapong_Classnamesizeof(g_Classname));

I hope you can help me
You might need a little more than 32, but you don't need 9999. Yak shows 128:
https://wiki.alliedmods.net/Scripting_FAQ_(SourceMod)

rhelgeby is right. If recursion is the issue, adding more stack space only puts off the inevitable. The code you posted doesn't even do anything except store a classname in a string array. Post the entire code.
__________________
Thank you in advance for your help

My plugins:
[CS:S] BOT Swat | [ANY] CVAR Randomizer | [CS:S] SM CS:S Tag Beta | [CS:S] Bot2Player
Awesome & Crucial plugins by other people:
[CS:S/CS:GO] GunGame | [UMC3] Ultimate Mapchooser | [ANY] Server Crontab | [ANY] SM ForceCamera
Bittersweet is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode