System stack errors

okay i want to know is wha tthe easiest way is to find system stack error. i dont know why but they keep happening to me. i look for duplicates but never find them! is slowing my game creating processs down every freaking day and i am sick of it. every time it happens i can never find the certain script duplicate and i just copy everything into a new project.

could it be from notetags
It could be from anything.

The usual culprits are due to simple errors:

1. Duplicate scripts (pasting it twice by accident or otherwise). Since integration with other scripts involves frequently aliasing methods, having duplicate scripts means you will have an aliased method calling itself.

2. Duplicate method names. This often occurs when a scripter begins writing more than one script working with the same set of methods (eg: multiple Actor-related scripts maybe). They might use the same alias name and then the methods would just end up calling themselves. This also occurs when you alias a method in one class, and then alias the same method in a child class using the same name, such as

class Game_Battler < Game_BattlerBase alias :th_custom_initialize :initialize def initialize th_custom_initialize # stuff end endclass Game_Actor < Game_Battler alias :th_custom_initialize :initialize def initialize(actor_id) th_custom_initialize() # actor-specific stuff end endUsually this only happens once cause most scripters learn not to do it again after they encounter it.Everything else would need to be dealt with on an individual basis.

"Notetags" themselves don't do anything since they are just strings. It's when a note-tag causes a script to run certain pieces of code which are vulnerable to infinite loops.

There are several pieces of vulnerable code in the default project that would run into issues if you are not careful, particularly the "refresh" methods in Game_BattlerBase which are called during the initialization: if you happen to need to refresh while it is refreshing, well, there's your infinite loop.

The Class Graphics script, for example, is vulnerable to this refresh problem.

I've caught some cases, but there could be more issues that I didn't think of.
Everything else would need to be dealt with on an individual basis.

"Notetags" themselves don't do anything since they are just strings. It's when a note-tag causes a script to run certain pieces of code which are vulnerable to infinite loops.

There are several pieces of vulnerable code in the default project that would run into issues if you are not careful, particularly the "refresh" methods in Game_BattlerBase which are called during the initialization: if you happen to need to refresh while it is refreshing, well, there's your infinite loop.

The Class Graphics script, for example, is vulnerable to this refresh problem.

I've caught some cases, but there could be more issues that I didn't think of.
when i replace this with main

#==============================================================================

# ** Main

#------------------------------------------------------------------------------

# This processing is executed after module and class definition is finished.

#==============================================================================

begin

rgss_main do

begin

SceneManager.run

rescue RGSSReset

Graphics.transition(10)

retry

end

end

rescue SystemExit

exit

rescue Exception => error

scripts_name = load_data('Data/Scripts.rvdata2')

scripts_name.collect! {|script| script[1] }

backtrace = []

error.backtrace.each_with_index {|line,i|

if line =~ /{(.*)}(.*)/

backtrace << (scripts_name[$1.to_i] + $2)

elsif line.start_with?(':1:')

break

else

backtrace << line

end

}

error_line = backtrace.first

backtrace[0] = ''

print error_line, ": ", error.message, " (#{error.class})", backtrace.join("\n\tfrom "), "\n"

raise error.class, "Error ocurred, check the debug console for more information.", [error.backtrace.first]

end

like you do it says i get "Game_ActionResult:38"
Use the following technique:

http://forums.rpgmakerweb.com/index.php?/topic/16808-how-to-debug-systemstackerror/

Add

raise "crash me" if caller.length > 100Above line 38 of that class.You should see some repetition occurring if you look at the output in the console. Screenshot that.
actually its a problem with class graphics your script

i really need this script or something that does the same thing.

so what exactly should i do

(thanks for putting up with my lack of scripting so far)
Just follow the steps and then screenshot the error.


You should show the top of the error.
what and where do i place it.

when i have class graphics in i get an error at line 2730 in the script "battle Symphony"

Code:
 #--------------------------------------------------------------------------  # alias method: clear_hit_flags  #--------------------------------------------------------------------------  alias bes_clear_hit_flags clear_hit_flags  def clear_hit_flags    return unless @calc <- (LINE 30)    bes_clear_hit_flags    @temp_missed = @temp_evaded = @temp_critical = nil  end
Did you read the post where I say "add"?
well i did and in the console i get a ton of crap and none of its really "repeated" or following a pattern
Increase it to 200 or 500 then. Maybe 100 is too small. If you're getting system stack error then a pattern must emerge at some point.


Otherwise you'll have to upload your project so others can look at the issue.
sorry for posting twice, couldn't find that "attach files" in the edit

okay i found the repeat 

^^^^ (from cmd - from cmd)
I know this forum post is rather old, but the assistance it provided me was very useful.  Thank you kindly to everyone who posted and assisted here.  I found I had labelled one of my script's aliases with the same identifier as another alias from the same method of the same script, in another script page.  I searched for a while trying to figure out which method/call/proc/etc was causing my stack overflow with no luck.  

I turned to the forums and I found this back trace post, with that back trace script.  I converted it to encompass the main inside RGSS2, and boom I found my issue immediately.  I never thought the alias would call another alias with the same identifier, instead of its locally positioned script alias.  Its honestly never something I considered would happen.  I'm guessing the script interpreter has no syntax exceptions for this error.

Thanks everyone who posted here, you all assisted in fixing my issue.

Original thread: https://forums.rpgmakerweb.com/threads/system-stack-errors.16776/