-
-
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
Attempting to read large file as string causes segfault #80533
Comments
I reproduced it with my windows machine, Same backtrace. Godot v4.2.dev (7ba79d6) - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 (NVIDIA; 31.0.15.3118) - 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (16 Threads) |
Probably caused by an int overflow with |
I tested with that PR and it does indeed fix the crash with that particular file, however there is still a limit of
Files bigger than 2^31-1 bytes will overflow and also fail to read, or read partially if it overflows to a positive number |
Yes, maybe at least we can update the document and do something to prevent it from crash. Although unlikely, files larger than 2-4G will be needed in certain cases. |
String is UTF-32, so it will be at least 4x larger adter conversion, and variables used for size are signed so limit is 2G. |
Can someone confirm this on latest? Should be fixed by: |
I already did in #86730 (comment) :) |
Sorry didn't see it said it was occuring without that PR 🙂 |
Godot version
4.1.1.stable, master [4714e95]
System information
Godot v4.2.dev (4714e95) - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Tue, 08 Aug 2023 22:13:48 +0000 - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 (RADV NAVI10) () - AMD Ryzen 7 5800X3D 8-Core Processor (16 Threads)
Issue description
I attempted to read a large JSON file (1GB+) using
FileAccess.get_file_as_string
, but the result is a crash. Here's a backtrace from a debug build [4714e95] and some info, not sure what to make of thisAfter some manual binary searching 0x7ffff7fff000 seems to pop up...
Steps to reproduce
In case the specific file is needed it's available here (warning: it's big)
Minimal reproduction project
The text was updated successfully, but these errors were encountered: