-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Errors on every program run through Valgrind on Monterey 12.7.2 #104
Comments
Hi @pjaglom, Thanks for all the context! You are right that sometimes we need to add suppressions to prevent false positives to show in Valgrind. Unfortunately I don't have access to a macOS 12 x86 computer, so I did my testing on my macOS 14 x86 one. I get a slightly different output
My errors seem to indicate that some macOS function (at Unfortunately, because this issue happens in the |
I could be wrong, but I don't think my error is genuine, because the clean output I wrote in the "what did I expect to happen" section is what I get when I compile and run the exact same code in a linux environment. I'll take a look at creating my own suppression file - thanks! The specifics of what is really happening in memory during these errors is a little over my head, but I'm just curious if this is something that could theoretically be corrected (not just suppressed), so valgrind runs as cleanly in macOS as it does in linux? Not that I'm asking you to do that - I'm about to start an Intro to OS course, and after a few more level-ups, I'd like to be able to start contributing to projects like yours. |
It's entirely possible and it's what I am (slowly) trying to do. In general I would want macOS to run without any suppressions (which is what happens for most systems, macOS has the most suppressions by far IIRC). Some recent work as pushed us in this direction but we aren't there yet.
That's great to hear! 😄 You would be more than welcome here or on upstream valgrind (where most of the work happens, all we do here is macOS support) |
I reproduced the same bug with a much more simple code:
with this one I get the following errors:
which is pretty similar. |
Context
I am running valgrind on a 2016 Intel-based MacBook Pro running macOS 12.7.2. For context this is my first foray into C, gdb, and valgrind so my experience level is low. I recently installed valgrind-macos to be able to run it on my own machine instead of VMs (thank you for this excellent work - it was such a relief not to have to deal with the latency!). Valgrind seemed to install without error, and does identify issues with the code I've run through it, but it also identifies errors and leaks that don't seem to be associated with my programs (since they valgrind cleanly on linux). They seem to be related to dylib or dyld. I read through #11, #19, and #74 which all suggested this kind of issue should have been suppressed/corrected so I wonder if I'm missing a dependency or should install a different branch of valgrind-macos. (I followed the instructions in the README.)
I do note that 103 other errors are suppressed, but I'm wondering if there's a way to get the last few suppressed as well, or if I should simply ignore any errors related to dylib or dyld.
What went wrong?
Here is an example of the kinds of errors I see:
If I run with
--leak-check=full
I get additional errors/leaks, but didn't want to spam the issue with a wall of text. If helpful, I can add.I modified the following program, which was from an assignment in an online course. (Please forgive the messy code...still learning.)
I compiled with
gcc -ggdb3 -Wall -Werror -std=gnu99 -pedantic -o sortLines sortLines.c
.I ran
valgrind ./sortLines input.txt
where input.txt is:What did you expect to happen?
I expected the following output, which is what I get when running through valgrind on a linux VM.
Information
uname -m
): x86_64sw_vers
): 12.7.2xcrun --sdk macosx --show-sdk-version
): 13.1The text was updated successfully, but these errors were encountered: