Skip to content
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

Non-zero offset added to nullptr causes ASAN errors #509

Open
aabdolrashidi opened this issue Feb 11, 2025 · 0 comments
Open

Non-zero offset added to nullptr causes ASAN errors #509

aabdolrashidi opened this issue Feb 11, 2025 · 0 comments

Comments

@aabdolrashidi
Copy link

The Chromium rolls into ANGLE (latest roll) have started failing many tests on Linux when using UBSan/ASAN settings. (Related issue)

The error seems to come from multiple locations in two test files where a non-zero offset is added to a potentially nullptr value, which is undefined behavior:

  • modules/glshared/glsDrawTest.cpp
    • Lines 1491, 1498, and 1510 (related to vertexAttrib*Pointer())
    • Line 3789 (indexPointer)
  • framework/common/tcuTextureUtil.cpp
    • Lines 1560 and 1565 (return value of addOffset())

Using the following equivalent for each case should fix this:

basePointer + offset --> (basePointer) ? basePointer + offset : reinterpret_cast<T*>(offset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant