System Stack Error In Game Interrupter 119?

So in my project, there's one minigame I made, it uses a heavy amount of common events. the minigame works fine to a certain point? It uses a round system, where it repeats a lot of the same common events in a cycle. When the game reaches a certain point, it tends to crash and give me a system stack error, I used Hime's System Stack Debugger to figure out where it was rooting from and it was from line 119, to my understanding it has something to do with...
Code:
#--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    @fiber.resume if @fiber
  end
  #--------------------------------------------------------------------------
But if not, I'd love to be helped with how I can stop the game from crashing, is it something with my common events or this script or some other script I'm running with this one?
Are you making a common event, that also calls itself?
"stack level too deep" means that you have a function that calls it self, and did it so many times the computer can no longer keep track of it.

The only way to prevent that error is to change your game logic to no longer call itself, which means we need to see your logic circle to help, not the line where the call caused the iteration.
Are you making a common event, that also calls itself?
I looked and no, I didn't see any common event that called itself?
The game tends to crash on this event in particular, but this game uses a lot of different common events for this minigame, so I'm really not too sure if it's this one, but this is the main set up for the system that has the CPU and Player input choices.
bandicam 2022-02-02 01-58-37-195.jpg
bandicam 2022-02-02 01-58-44-057.jpg
bandicam 2022-02-02 01-58-49-134.jpg
What is this "call common event [MJ-Value-2]" and "[MJ-Holds]"?
What is this "call common event [MJ-Value-2]" and "[MJ-Holds]"?
They're both separate common events?
bandicam 2022-02-02 02-19-25-080.jpg

Here's the holds one?
bandicam 2022-02-02 02-21-34-154.jpg
bandicam 2022-02-02 02-21-42-560.jpg
bandicam 2022-02-02 02-21-45-900.jpg

It's more or less the same, as the first one but with some unique values.
What is the name of the common event you first posted?
Is there any flow that makes it goes back to the first common event?

for example
MJ-Value-1 --> call MJ-Value-2 --> call MJ-Value-3 --> call MJ-Value-1
Yes, that's MJ Value-1, I posted it cause the game seems to crash on that event, when it's called, always, at a certain point?
Start -> MJ-Value-1 -> Outcome_1 -> MJ-Value-2 -> Outcome_2 -> MJ-Value-3 -> Outcome 3 -> End

Then when it reaches End goes back to Start.
But a linear sequence CANNOT cause the error you have. That would be like asking a car to drive to the moon - it cannot, because it doesn't have rockets to fly.
Somewhere you have to have a recursive structure that calls itself - there is literally no other way to cause a stack level too deep error, because the stack has more than enough reserves to handle every regular form of programming.

And that is why I asked for the logic of your events, not for the code itself. The events themselves are secured from those errors as well, only script commands and call commands can cause this, nothing else.

So what you now need to do is to check every event you have for either call commands or script functions that call plugins. and whenever you find such a command, you need to keep a note of it somewhere.
and when you have all that together, link them graphically to see where the circular sequence is that causes this.

and if you don't have the sequence in the events, you need to start checking your scripts.

it might help if you install the backtracer script to get the full error trace of the error message when it comes to that.

EDIT:
Then when it reaches End goes back to Start.
And how does it do that?
Because THAT could be the recursive cause if you don't stop and call start directly...
@Andar actually no

There is the problem. When you call a common event, for example like this

... Do stuff 1
... Call common event 10
... Do stuff 2

The system stack "common event 10" and wait for the common event 10 ends before continuing "do stuff 2". Now, what is going to happen if you make it looped by calling it 1 --> 2 --> 3 --> 1 --> 2 --> 3? They will stack on each other eventually build up and becomes too deep the system throws an error. Because when you call "1", you don't actually end it but add it to the stack.

Granted, the tolerance to the stack is usually large (and only noticeable in the badly written script or duplicated script because it pilled up faster), but if you keep doing it, you will eventually reach the limit.
actually no
please note my edit - I read his last sentence too late
So what is the solution exactly?
You can make the trigger parallel/autorun for MJ-Value-1. And let the event ends at MJ-Value-3. It will reinitiate itself without the direct call to MJ-Value-1. You need to flip the switch to initiate it though.

Edit:
Actually, I'm not sure about re-initiating itself (I never use common events).
basically any call needs to be returned, so that the event continues after the call command is complete. And the top level event would then be a parallel process.

however if your current events cannot return to from where they were called, then you need to rework the entire logic into a single loop without using the call command at all.

which solution is the better one for you we cannot tell without understanding the entire structure of every part of the events.
I'd suggest to create a looping process in a CE that just calls MJ-Value-1, -2 and -3 in sequence, that will create a better overview of what's happening (and is better in every way than calling the next one at the end of current event), and should easily prevent stacking of calls that make the interpreter's 4kb-sized Fiber memory explode.

The minigame-loop I have in mind would look this way:
Code:
◆Call CommonEvent: MJ-Value-1
◆Call CommonEvent: MJ-Value-2
◆Call CommonEvent: MJ-Value-3
◆

~炬燵あ
I'd suggest to create a looping process in a CE that just calls MJ-Value-1, -2 and -3 in sequence, that will create a better overview of what's happening (and is better in every way than calling the next one at the end of current event), and should easily prevent stacking of calls that make the interpreter's 4kb-sized Fiber memory explode.

The minigame-loop I have in mind would look this way:
Code:
◆Call CommonEvent: MJ-Value-1
◆Call CommonEvent: MJ-Value-2
◆Call CommonEvent: MJ-Value-3
◆

~炬燵あ
Ah, you're a life saver thanks everyone for helping, I'll update you if this method stops it from happening!
I'd suggest to create a looping process in a CE that just calls MJ-Value-1, -2 and -3 in sequence, that will create a better overview of what's happening (and is better in every way than calling the next one at the end of current event), and should easily prevent stacking of calls that make the interpreter's 4kb-sized Fiber memory explode.

The minigame-loop I have in mind would look this way:
Code:
◆Call CommonEvent: MJ-Value-1
◆Call CommonEvent: MJ-Value-2
◆Call CommonEvent: MJ-Value-3
◆

~炬燵あ
I remolded the structure to that, and it works like a charm thank you!

Original thread: https://forums.rpgmakerweb.com/threads/system-stack-error-in-game-interrupter-119.144554/