-
-
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
ERROR: store_buffer: Condition ' !p_src ' is true when doing some operations. #33564
Comments
I'm also seeing this issue when downloading files with the HTTPRequest node. The download still works, though. |
I have the exactly the same error when I use this plugin: https://github.com/fenix-hub/godot-engine.text-editor
|
I have the same error. I don't have any plugin and i don't use HTTPRequest but i do have GLTF files imported from blender. (Created from scratch and exported by me with the latest version of blender). It always happen in the script editor when i have an "error" in my code (ex: when writting an "if" before putting the ":" at the end). It freeze the whole program for a few minutes... But if godot was started from a terminal, i can do a ctrl+c in it and godot will unfreeze like nothing happened ! Not exiting the program, just unfreezing it. I use Godot_v3.2.1-stable_x11.64 on Ubuntu 18.04.4 LTS |
This solved the problem in my case: |
For reference, this is now the default in 3.3rc: #42896 |
In 3.3, this doesn't solve the problem. |
This is expected with some file hosts such as GitHub because they don't report the body size for files that were generated on-the-fly (such as ZIP archives). In this situation, you will get the body size if you try downloading the same file a second time in a short enough interval. |
That's generally true, but in my case these are the same specific files of which get_body_size() returns the actual size when exporting with Godot v3.2.3 but not when exporting with v3.3. |
@avnerh1 Which platform are you testing this with? The HTML5 HTTPClient has been rewritten to use |
I got similar error when running on android device via editor. 305c364 |
I'm using Win10/Edge. |
I'm having this issue on Mac OS X. The problem occurs in both debug mode (editor) and exported versions. const endpoint = "https://query1.finance.yahoo.com/v8/finance/chart/AAPL?symbol=AAPL&period1=1614957299&period2=1620054899&useYfid=true&interval=15m&includePrePost=false"
const headers = [
"Content-Type: application/json",
"Accept-Encoding: gzip"
]
var http
http = HTTPRequest.new()
http.download_chunk_size = 65535
http.download_file = "user://test.gz"
self.add_child(http)
var result = http.request(endpoint, headers, true)
assert(result == OK)
result = yield(http, "request_completed") |
I am also having this same problem. It worked in version 3.2.3 and in version 3.3 the function get_body_size () always returns -1 in the same file and server that returned correctly in the version exported with 3.2.3.
I have full access to the server (AWS) and the file. Is there any configuration that can solve this? File is a pck with about 20Mb. File is downloaded correctly, buy progress bar stoped working |
It's probably not working because the server on the other end is responding with If you could make a small repo to test that it would help narrow down the issue a lot! |
Running directly in the editor, and downloading the same file from the same location, everything works perfectly, it only happens when I export to html |
Log when running from the EDITOR (this works)
Log when running from the HTML EXPORT (this don't work)
|
Has anyone found solution for this error? Im trying to download files using httprequest node but only sometimes issue is present. |
This is likely a regression from #46731 (see also #47597). cc @Faless
Which operating system and Godot version are you using? If this is HTML5, see above. |
Im using popos with godot 3.3.2. Error seems to come off at random interval. Tested with filesize less than 1 mb, issue isn't present. Tested with 10mb file issue is present. |
Which website are you downloading the file from? Many hosts such as GitHub will not report content lengths unless the file was already recently downloaded. This is because the file is generated on-the-fly, so GitHub doesn't even know the file size until the file is generated. |
Mainly itch io and various other sites. Including couple of pictures from wikipedia. Although error is present, file is downloaded. |
I noticed that the problem is not consistent. I suspect it has something to do with caching the file by CDN. I will look into it and report back if I find anything useful. |
For me the error of httprequet.get_body_size () returning -1 always happens in version 3.3 (and 3.3.2) This function returns the correct value in version 3.2.3 when downloading the same file, on the same server in the same game |
@darcio-studiobluechip which file? Could you provide a sample project? |
My code is the above one.
|
get_body_size also works when running the same code and requesting the same file from the same server on the android exported version of the game |
Just switched from v3.2.3 to v3.3.2 and with HTML export the problem immediately showed up again, for every file. |
Quoting myself above: However, it was recently fixed by #49226 which will be available in 3.4. |
The error check was added for `FileAccessUnix` but it's not an error when both `p_src` and `p_length` are zero. Added correct error checks to all implementations to prevent the actual erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer indexing). Fixes godotengine#33564.
The fix is simple: diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index ec23df62d0..6ea55219bb 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -264,7 +264,7 @@ void FileAccessUnix::store_8(uint8_t p_dest) {
void FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) {
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
- ERR_FAIL_COND(!p_src);
+ ERR_FAIL_COND(!p_src && p_length > 0);
ERR_FAIL_COND(fwrite(p_src, 1, p_length, f) != p_length);
}
Cf. #49394. For what it's worth, the errors are harmless, it's just noise. It errors on code that tries to store a non-existent buffer of size 0... which doesn't need to be an error, it will just not do anything. |
The error check was added for `FileAccessUnix` but it's not an error when both `p_src` and `p_length` are zero. Added correct error checks to all implementations to prevent the actual erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer indexing). Fixes #33564. (cherry picked from commit 01d5c46)
The error check was added for `FileAccessUnix` but it's not an error when both `p_src` and `p_length` are zero. Added correct error checks to all implementations to prevent the actual erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer indexing). Fixes #33564. (cherry picked from commit 01d5c46)
Godot version:
3.2.beta.custom_build. 157246a
OS/device including version:
Ubuntu 19.10
Issue description:
Using null buffer pointer in fwrite function is Undefinied Behaviour
and this cause this error
It can be easily silenced but probably this is not the best solution
Steps to reproduce:
godot/scene/main/http_request.cpp
Line 358 in 24e1039
2.
Import GLTF File Katalog bez nazwy.zip
godot/core/io/resource_format_binary.cpp
Line 1538 in dec10dd
The text was updated successfully, but these errors were encountered: