-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Game crash when using yield(): Segmentation fault. 0x08c5484f in NodePath::unref() #1236
Comments
hmm can't really do much with the backtraces by looking at them, nothing On Fri, Jan 16, 2015 at 2:53 PM, ScyDev [email protected] wrote:
|
No, unfortunately I can't, because this happens during complex interaction of enemies, enemy projectiles and player projectiles. I don't know why and when it happens. I could however send you my project through a private channel if you agree to keep it safe and confidential and give you instructions how to provoke the crashes, so you can debug it. I'll contact you by email. |
from the backtrace and from what i can tell, though, maybe you are using an On Fri, Jan 16, 2015 at 3:12 PM, ScyDev [email protected] wrote:
|
Here's an idea: how about an abstaction layer between script and internal Godot Engine calls (kinda like form validation and input sanitization on the web) which checks all function calls and their parameters in order to make it impossible for scripts to crash the game? |
that layer already exists (it's only active when you run in the debugger On Fri, Jan 16, 2015 at 3:28 PM, Juan Linietsky [email protected]
OkamStudio |
I already have 3 separate (that I can identify) segfault crashes in my simple game. No, I am not calling any functions at all from animations. The only thing I do besides keyframes on spritesheets is playing sounds from the animation. And I always use queue_free(). |
Found a way to prevent this. I added an if to check whether the projectile has already collided. If that check is inactive (as in the code below) then the error happens. If it is active, then I can't provoke it. So this means the projectile collides more than once and collider.takeHit(self.damage, true) and self.queue_free() are called more than once. I don't think that should crash the game though. Does this make sense to you?
|
Refering to your earlier question about function calls from animation: Could it be that yield() bound to signal "finished" on an animation is causing this?
Internally this could cause the scenario you described, no? Like, the remainder of the function that is yielding is called from the animation at its end. What do you think? |
Removed all the yield() calls in the game and its stable now even under massive load. Btw. the crash also happens on yields other than on animations. For example:
|
by the way, collider.get("NOREST_TYPE") should also work as collider.NOREST_TYPE do you think you can make a small example of yield() failing? This feature has never been tested much and it's quite complex, so maybe it fails in some cases that were not tested |
Thanks for the hint :) But I'm doing it like this because not all the objects/scripts have this var, and therefore collider.NOREST_TYPE would throw an error. |
In this comment [1], @reduz mentions having fixed yield issues around Jan 17. Would this issue happen to be fixed then? [1] #1234 (comment) |
And if it is fixed, what about the apparently related #1235? |
No activity in a while, and #1234 is apparently related and was fixed at some time, so closing this one too. |
The text was updated successfully, but these errors were encountered: