Raised This Month: $ Target: $400
 0% 

[Solved] SMA file to big to be compiled? Not enough memory?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 12-07-2014 , 17:32   [Solved] SMA file to big to be compiled? Not enough memory?
Reply With Quote #1

Hello,

I spent the last month writing a big counter-strike plugin, well actually I am rewriting it. Anyway that is not neccessary, but what is neccessary is that my plugin is not compiling at all. I have downloaded the latest dev build 1.8.3 git4478 and I am compiling from that.

Everytime I compile it, amxxpc.exe stops responding and then I get in the compilation console "Internal error". I simply cannot compile it, however I can still compile other plugins just fine.

I tried using the "#pragma dynamic 32768" preprocessor but the result is the same.

Here are the details of my SMA file:
10368 lines
293 KB

My question is: Is my plugin too big to be compiled? Is there not enough memory? Should I divide my plugin into several smaller plugins?

I appreciate any help on the matter.

Regards,
tony
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 12-08-2014 at 09:39.
tonykaram1993 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-07-2014 , 18:49   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #2

It's unlikely that you could write enough code to be too big for the compiler. I've actually had this happen on a 'not-so-big' plugin. There was actually something wrong with my code. I recommend that you comment out large blocks of your code to see if you get it to respond (error or not, doesn't matter as long as it responds with something). Then, When it starts responding again, you can narrow it down from what you just commented out.

Of course, the alternative to post your code always exists . . . but I have a feeling that won't happen.
__________________
fysiks is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 12-08-2014 , 05:32   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #3

I appreciate your reply, I will do just that altho I have already tried it but not in depth.
As you might have guessed, unfortunately I prefer keeping my code private until its a working stable version. Then at that time I will be releasing it here on alliedmods.

I also think posting the code might not help since it's a very large project and I have a feeling no one has the time and patience to debug a 10k lines code for someone else. Hey, I might be wrong, but again I appreciate your reply.

EDIT: I have just tried it and nothing changes. Even if I comment the entire file (everything is a comment) the plugin still does not compile and amxxpc.exe just stops responding.

Any other ideas?
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 12-08-2014 at 05:55.
tonykaram1993 is offline
Old 12-08-2014, 06:18
tonykaram1993
This message has been deleted by tonykaram1993. Reason: nvm, i was wrong
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2014 , 06:19   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #5

Then show your code (more attach it as it is). It doesn't matter much your plugin is not in a stable version, you're asking help so do it, so we can test and try to figure out why.
__________________

Last edited by Arkshine; 12-08-2014 at 06:20.
Arkshine is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 12-08-2014 , 06:23   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #6

Alright then you forced me, here you go:

*snip*

The code that caused the compiler crash was the following as stated by arkshine below:
PHP Code:
new const g_strKnifeSounds[ ][ ][ ] = {
    
/* Barehands (replacing default T knife) */
    
{
        
"weapons/barehands/knife_deploy1.wav",
        
"weapons/barehands/knife_hit1.wav",
        
"weapons/barehands/knife_stab.wav",
        
"weapons/barehands/knife_slash1.wav",
        
"weapons/barehands/knife_hit1.wav"
    
},
    
    
/* Taser (replacing default CT knife) */
    
{
        
"weapons/taser/knife_deploy1.wav",
        
"weapons/taser/knife_hit1.wav",
        
"weapons/taser/knife_stab",
        
"weapons/taser/knife_hit1.wav",
        
"weapons/taser/knife_hit1.wav",
    }
}; 
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 12-08-2014 at 09:45.
tonykaram1993 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2014 , 07:57   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #7

It crashes because of g_strKnifeSounds, you have left a comma for the last item and for some reason compiler doesn't like it. It's dumb, and another stupid compiler bug. It seems to crash only with 3d array with undefined size. I don't remember if it was happening with 1.8.2 compiler, as it could be a side-effect of the update applied in 1.8.3. That's said, I remember SourceMod allowing extra comma in array, like enum, I guess it's worth to check that. Compiler is a bitch.

EDIT: If you are curious how I've found that, I've just compiled compiler in debug mod, then seen an assertion has been triggered inside a function related to array initialization. Then, I've removed all code except declaration, and removed array by array until it doesn't crash. Then seen the extra comma.
__________________

Last edited by Arkshine; 12-08-2014 at 08:07.
Arkshine is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 12-08-2014 , 07:59   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
It crashes because of g_strKnifeSounds, you have left a comma for the last item and for some reason compiler doesn't like it. It's dumb, and another stupid compiler bug. Actually it should not crash, even if by default it's not allowed. I don't remember if it was happening with 1.8.2 compiler, as it could be a side-effect of the update applied in 1.8.3. That's said, I remember SourceMod allowing extra comma in array, like enum, I guess it's worth to check that. Compiler is a bitch.
I know for a fact that SM's compiler allows a final comma in enums, arrays idk for sure.
__________________
WildCard65 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2014 , 08:08   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #9

Yeah, it has been always allowed for enum, that's why it has been added for array in SM as it doesn't make much sense this to not be allowed. Here, crash seems to happen only for 3d array and with undefined size.
__________________

Last edited by Arkshine; 12-08-2014 at 08:08.
Arkshine is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 12-08-2014 , 09:38   Re: SMA file to big to be compiled? Not enough memory?
Reply With Quote #10

Oh I see thank you very much for your explanation and your find.
But the thing that did not make sense is why did the compiler crash when I commented the entire code?
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]

Last edited by tonykaram1993; 12-08-2014 at 09:42.
tonykaram1993 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 15:21.


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