-
Notifications
You must be signed in to change notification settings - Fork 860
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 valgrind throws General Protection Fault on dl-misc.c #1295
Comments
Hi @saschanaz -- thanks for reporting this! It sounds like a specific instance of the issue discussed in #120 . You might want to follow up there. In particular, it would be interesting to know whether the workaround on that thread (compiling Valgrind from source rather than installing the Ubuntu binary version) works for you. |
Hi @aseering, unfortunately installing from source doesn't work but generates a different error stack:
PS: Just did an apt-get upgrade and now I'm getting more specific one:
|
Thanks @saschanaz for the quick turnaround! That error actually looks different to me; the previous error looked like Valgrind itself was segfaulting, this error looks like Valgrind is intercepting a segfault in your application. That implies to me that it may have actually identified a bug in your application. The stack trace is in some function that's performing dynamic loading. My first guesses would be that you're either trying to find a symbol in a ".so" file that is corrupted in some way, or you have some other sort of buffer overflow (possibly on the stack so Valgrind wouldn't catch it?; also possibly a use-after-free() that, in this run, also occurs after the relevant block has been re-allocated so Valgrind wouldn't catch it as using un-allocated memory). Could either of those be the case here? (I admit, I haven't looked closely at your code; I figure you know more about it than I do.) Also -- do you know whether Valgrind runs this application correctly on a real Ubuntu Linux system? I'm not sitting at one right now so I haven't checked. But Valgrind basically runs your entire application in an emulated virtual environment; I have hit cases in the past where that emulation was not complete and, as a result, Valgrind failed to run a binary that worked just fine when running natively. |
@aseering The code is a "cachelab" assignment template from CMU so I don't think there is any big issue. And yes, it runs well on original Ubuntu 16.04 running on VM. |
@saschanaz -- hm... Yeah, I don't see anything wrong with that code. I'm not sure what's going on here. I'm just another WSL user; I think someone from the WSL team might know more? For what it's worth, per #120 , Valgrind has been known to not work for a while now; my assumption is that it depends on some Linux kernel functionality that's somewhere in the WSL team's backlog. |
I have a bug internally opened for this. |
Hi @misenesi , do we know when there will be a fix for this, or if there is a work-around? |
@Grauniad It is one of the items on my todo list, I am not sure yet when I get to it. If there is anyone more familiar with valgrind and could identify the source of the issue/difference between Ubuntu/WSL, I could get in the fix quicker. |
Hi @misenesi , as per the investigation here: https://github.com/Grauniad/valgrind I'm fairly sure the issue is with the si_code being raised when a process attempts to access unmapped memory. Logs / repro binary here: https://github.com/Grauniad/valgrind/tree/master/logs I think #120 is the same issue. |
@Grauniad thank you for your investigation, it is deeply appreciated! I have checked in a fix for this. |
Running
make;valgrind ./tracegen -M 32 -N 32 -F 1
throws General Protection Fault while not on original Ubuntu 16.04.Insider build 14955
make;valgrind ./tracegen -M 32 -N 32 -F 1
https://gist.github.com/SaschaNaz/cdf4081a03ed13e97090862aff98dd28
sudo apt-get install valgrind
The text was updated successfully, but these errors were encountered: