-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Division by zero crashes editor and builds instead of logging error message #83308
Comments
Good eye, sniper!
Does seem like it, yes. The other person replicating this over on chat.godotengine.org also ran Windows. |
Oh right I forgot to post the console log for when I replicated the crash on rocket chat. Not sure if it's any use though. I could only get the backtrace when using my custom build of 4.2(probably my fault), but I got the same crash on the official. Got this from
|
Please build with debug symbols |
Furthermore, backtrace of the repro:
|
Tested on Windows 10 on current master (a574c02), I get the crash too. Error message is
0xc0000094 is Windows SEH code for godot/core/variant/variant_op.h Line 181 in a574c02
Looks like the basic godot/core/variant/variant_op.h Lines 166 to 187 in a574c02
|
It seems that all OperatorEvaluators in https://github.com/godotengine/godot/blob/a574c0296b38d5f786f249b12e6251e562c528cc/core/variant/variant_op.h suffer from the same problem. If the var a := -1
print(12 << a) # prints "0" instead of error message
var b := 0
print(12 % b) # crashes |
Godot version
v4.2.beta1.official [b137180]
System information
Godot v4.2.beta1 - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 (NVIDIA; 31.0.15.3640) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)
Issue description
When you are dividing ints by 0 builds and editor hard crashes.
In 4.1.2, both editor and builds, there's an error message logged.
(Editor crashes only happen when using @tool)
Floats doesn't crash, and doesn't log an error, instead it results in "inf".
The editor warns about division by zero if you try
1/0
etc.Boxing the divisor in a variable yields no warning:
Steps to reproduce
Minimal reproduction project
div-by-zero-bug.zip
Edit: Fixed erroneous godot version. Got confused and copied from the wrong window.
The text was updated successfully, but these errors were encountered: