-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Running bun in valgrind shows an excessive amount of memory safety issues (false positives maybe?) #579
Comments
Could those be false positives due to JIT compilation perhaps? |
in debug builds I tend to use mimalloc's debug mode which adds some additional safety checks, but I also haven't run Bun through sanitizers yet. It's worth investigating these. The first one from the log:
The only call to https://github.com/Jarred-Sumner/bun/blob/main/src/bun.js/base.zig#L958-L959 We can see that https://github.com/Jarred-Sumner/bun/blob/main/src/bun.js/base.zig#L908-L909 Bun does use a lot of threadlocal variables, many of which are defined later Will continue investigating |
This comment was marked as off-topic.
This comment was marked as off-topic.
Are you saying that threadlocal variables are falsely flagged as uninitialized read by valgrind? |
Version
0.1.2
Platform
Linux <my_hostname> 5.18.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 07 Jul 2022 17:18:13 +0000 x86_64 GNU/Linux
What steps will reproduce the bug?
Using valgrind in version 3.19.0, run
valgrind bun ./http.ts
with:Wait for a few seconds and it starts printing hundreds of detected issues. At this point you can stop it with Ctrl-C.
How often does it reproduce? Is there a required condition?
Works quite reliably.
What is the expected behavior?
No memory safety issues reported by valgrind.
What do you see instead?
Hundres of reported issues.
log.txt
Additional information
I'm not sure if those are real issues or if those are actually safe operations that
valgrind
just can't track properly because it wasn't designed for programs written with zig.If they are real issues though, I'd call that a bit concerning.
The text was updated successfully, but these errors were encountered: