-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Trying to create a large Array causes a silent crash in CowData #46842
Comments
I can confirm this on
|
Turns out 89,478,485 x 24 = 2,147,483,640 |
In the 3.2 stable build I tested with a named array func _ready():
var a = [];
a.resize(89478485) # This doesn't crash
a.resize(89478486) # This crashes and it crashed with error:
so max size must be 0x5555555 and somehow unnamed array caused the crash with NO ERROR for the current master branch there was a game-crash with stack trace : (with and without variable name) maybe DEBUG mode forcefully generating BACKTRACE.
|
When I run your version of the script, it still crashes without an error. |
I was able to reproduce the error on the master, I will make a PR. |
Isn't it a problem too that on 64 bit systems _get_alloc_size_checked and _get_alloc_size are limited to an unsigend int value by next_power_of_2 which is only handles unsigned int? see: Line 124 in 01851de
godot/core/templates/cowdata.h Line 91 in 273fe7e
godot/core/templates/cowdata.h Line 102 in 273fe7e
|
I ran into this too, here's my reproduction project for var INT32_MAX = 2147483647 # 2^31 - 1
var byte_arr = PackedByteArray()
byte_arr.resize(INT32_MAX) # OK
byte_arr.resize(INT32_MAX + 1) # error
var int32_arr = PackedInt32Array()
#int32_arr.resize(INT32_MAX) # crash
int32_arr.resize(INT32_MAX + 1) # error
int32_arr.resize(INT32_MAX / 4) # OK, int32 is 4 bytes so alloc == INT32_MAX - 3 (due to truncation)
int32_arr.resize(INT32_MAX / 4 + 1) # OK, not sure why (alloc INT32_MAX + 1)
#int32_arr.resize(INT32_MAX / 4 + 2) # crash, alloc INT32_MAX + 5 I'm not sure #46868 is the right solution, it seems to me that we should be able to fix CowData to support allocating arrays of more than 2147483647 bytes. The error mentioned in my script is:
|
This is fixed in 4.0 RC 1. |
Godot version:
v3.2.3.stable.official
OS/device including version:
OS: Arch Linux (I don't know how to give a version for this)
CPU: x86_64 AMD Ryzen 5 3600 6-Core Processor
GPU: AMD Radeon RX 580
RAM: 15 GB + 8 GB swap
Issue description:
When the game crashes, there's no error message. Even if this should have caused a crash, there should at least be an error message.
Steps to reproduce:
Minimal reproduction project:
array_size_limit.zip
The text was updated successfully, but these errors were encountered: