-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
WARNING: Please, read this note carefully before submitting a new issue:
It is important to realise that this is NOT A SUPPORT FORUM, this is for reproducible BUGS with raylib ONLY.
There are lots of generous and helpful people ready to help you out on raylib Discord forum or raylib reddit.
Remember that asking for support questions here actively takes developer time away from improving raylib.
Please, before submitting a new issue verify and check:
- I tested it on latest raylib version from master branch
- I checked there is no similar issue already reported
- My code has no errors or misuse of raylib
Issue description
Briefly describe the issue you are experiencing (or the feature you want to see added to raylib). Tell us what you were trying to do and what happened instead. Remember, this is not the best place to ask questions. For questions, go to raylib Discord server.
UBSAN flags
Line 1186 in 87b5420
| if (mesh.indices != NULL) rlDrawVertexArrayElements(0, mesh.triangleCount*3, 0); |
Line 3124 in 87b5420
| glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (unsigned short*)buffer + offset); |
rlgl.h:3124:84: runtime error: applying zero offset to null pointer
From some reading around (e.g. https://patchwork.kernel.org/project/git/patch/20200125053834.GB744673@coredump.intra.peff.net/), it sounds like adding any offset (even 0) to NULL is technically undefined behavior.
This was introduced sometime between raylib 3.5.0 and raylib 3.7.0, and still exists on master.
Environment
Linux, desktop.
Issue Screenshot
If possible, provide a screenshot that illustrates the issue. Usually an image is better than a thousand words.
Code Example
Provide minimal reproduction code to test the issue. Please, format the code properly and try to keep it as simple as possible, just focusing on the experienced issue.
- Compile raylib with the undefined behavior sanitizer
- Run
shaders_basic_lightingexample