Page 1 of 1
[2.0.77][mac] Crash (SIGBUS)
Posted: Fri May 22, 2026 10:03 pm
by hgschmie
(nothing in the factorio-current.log file)
Crash log from the MacOS crash reporter. Also sent it to Apple, so you may receive it from there as well.
basically, there is a mod that has a handler for entity creation. In that handler, it destroys the entity that the handler was called for and creates a new one (with same name, type etc., just different orientation). When adding "raise_built = true" to the 'create_entity' call, the game crashes hard.
I'll try to whip up an actual test case if you need one.
Re: [2.0.77] crash straight to MacOS
Posted: Fri May 22, 2026 10:23 pm
by Rseding91
When adding "raise_built = true" to the 'create_entity' call, the game crashes hard.
That's infinite recursion. Of course that will crash. You simply can't do that.
Re: [2.0.77][mac] Crash (SIGBUS)
Posted: Fri May 22, 2026 10:32 pm
by hgschmie
I would have expected the engine to catch this (and maybe crash the mod) after a certain number of levels (e.g. 100 or so). The "crash straight to MacOS" was surprising.
Re: [2.0.77][mac] Crash (SIGBUS)
Posted: Sat May 23, 2026 12:09 am
by Rseding91
It's almost never worth trying to detect infinite recursion because it adds a performance cost at all times for the "this should never happen to being with" state. Since the engine has not way to "safely handle" infinite recursion happening the only fix is "don't do that" and it's better performance wise to let it crash and have the mod author fix the code than *try* to detect when it's happening and show an error + then crash. On Windows and linux we have special-case error handling that detects a generic stack-overflow error and shows the standard "Factorio crashed ..." but with a special message saying "stack overflow" and printing the stack at the time of crash. It's special case because it uses platform-specific logic to communicate across threads when a stack-overflow happens.
Re: [2.0.77][mac] Crash (SIGBUS)
Posted: Sat May 23, 2026 2:05 am
by Stargateur
Agreed, as long as there is no security issue, stack overflow is the problem of mod.