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

Clean up several UBSan violations #2081

Merged
merged 4 commits into from
May 2, 2024
Merged

Conversation

fhanau
Copy link
Collaborator

@fhanau fhanau commented May 2, 2024

This should be sufficient to resolve all undefined behavior in workerd code and tests alongside capnproto/capnproto#2021. Also see the downstream PR, where all workerd UBSan tests are passing.

Open to alternative suggestions on how to fix these.

fhanau added 4 commits May 1, 2024 20:09
This caused a subtle -fsanitize=vptr violation only affecting the test
itself.
Trying to mmap an empty file, then releasing the contents caused an
empty kj::Array to be created and a new array being created from it,
resulting in a "reference binding to null pointer" warning based on the
disposer of the empty array being null.
Not calling mmap if the file is empty fixes the issue here. It is likely
that similar patterns exist in other places, that can be addressed at a
future time within capnproto.
@fhanau fhanau requested a review from jasnell May 2, 2024 17:01
@fhanau fhanau requested review from a team as code owners May 2, 2024 17:01
@fhanau fhanau requested a review from hoodmane May 2, 2024 17:01
@fhanau
Copy link
Collaborator Author

fhanau commented May 2, 2024

Thank you James!

@fhanau fhanau merged commit 2a853c8 into main May 2, 2024
10 checks passed
@fhanau fhanau deleted the felix/resource-test-vptr-issue branch May 2, 2024 17:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants