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
Cannot create more than 65536 PoolByteArrays #18094
Comments
I did this: extends Node
var testArr = []
var randNumber
var randNumberTwo
var maxNum = 65535 # <- reduce by one and this code works
func _ready():
create_arrays()
call_deferred("create_arrays")
func create_arrays():
for i in maxNum:
randNumber = randi() % 100
randNumberTwo = randi() % 200
var bytePool = PoolByteArray()
bytePool.push_back(randNumber)
bytePool.push_back(randNumberTwo)
testArr.push_back(bytePool)
print("Done!")
print(testArr.size()) and got on output:
and a couple of errors:
ending with:
|
When I run a game with code from above, this error appear(really strange):
In my project, I read from file, with encoding other than utf-8, many thousands of characters which I must load with get_8() function and store it in PoolByteArray, and then I can easily overflow it. |
Godot 3.2.2 beta3 |
Can someone try to reproduce this with PackedByteArray in the |
Doesn't crash in master build 3f7f4fb.
Which results in:
Update: |
Did a test with a hundred times the original number, it took maybe 10 seconds to do, but completed fine: Godot v4.3.dev (0c03d25) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1070 (NVIDIA; 31.0.15.3623) - Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 Threads) |
This doesn't guarantee that it work on 3.x as the code is largely different, so to properly close this testing on 3.x would be required, but confirming it's not occuring on the 4.x branch is good! |
I reproduced it from the LTS binary from the website ( v3.5.3.stable.official [6c81413] ). |
Godot version:
3.0.1
OS/device including version:
Windows 7, 64bit
Issue description:
Attempted to create a very large number of PoolByteArrays but as soon as more than 65536 (maximum for a 16 bit number) of them are created the game becomes unresponsive and crashes.
Steps to reproduce:
The following code crashes but if you change the variable
maxNum
to 65535 or less it works as expected.Minimal reproduction project:
PoolByteArrays.zip
The text was updated successfully, but these errors were encountered: