godot: ERROR: store_buffer: Condition ' !p_src ' is true when doing some operations.
Godot version: 3.2.beta.custom_build. 157246ae8 OS/device including version: Ubuntu 19.10 Issue description:
Using null buffer pointer in fwrite function is Undefinied Behaviour
size_t fwrite(
const void *buffer,
size_t size,
size_t count,
FILE *stream
);
and this cause this error
ERROR: store_buffer: Condition ' !p_src ' is true.
At: drivers/unix/file_access_unix.cpp:278.
It can be easily silenced but probably this is not the best solution
Steps to reproduce:
- Download “FirstPersonStarter” from Template in Project Manager
https://github.com/godotengine/godot/blob/24e1039eb6fe32115e8d1a62a84965e9be19a2ed/scene/main/http_request.cpp#L358 2. Import GLTF File Katalog bez nazwy.zip
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 30 (12 by maintainers)
Commits related to this issue
- FileAccess: Don't err in `store_buffer` with buffer of size 0 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 chec... — committed to akien-mga/godot by akien-mga 3 years ago
- FileAccess: Don't err in `store_buffer` with buffer of size 0 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 chec... — committed to godotengine/godot by akien-mga 3 years ago
- FileAccess: Don't err in `store_buffer` with buffer of size 0 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 chec... — committed to godotengine/godot by akien-mga 3 years ago
The fix is simple:
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.
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
My code is the above one.
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
It’s probably not working because the server on the other end is responding with
-1
as the content length.If you could make a small repo to test that it would help narrow down the issue a lot!