-
Notifications
You must be signed in to change notification settings - Fork 18k
runtime/race: use runtime.CallersFrames #19749
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
Comments
The race detector run time support calls back into Go to print a stack trace. The callback function is passed to the race detector in the call to The PC values passed to So, yes, it would be nice to use |
Re API: yes, need to extend it to make it possible to return several frames. Tsan runtime itself was always able to deal with inlined frames, so it's only tsan<->Go interface that needs to be changed. Re right data: @ianlancetaylor why do you suspect that the data may not be right? Why calling CallersFrames with a single PC may not work? |
Calling Perhaps the race detector does collect that, and I just understand how it works. |
@ianlancetaylor on function entry it obtains caller pc, so it's actually call site. So everything should work. |
Just ran into this again while investigating #36431. |
Hmmm, I thought I fixed this in the fix for #33309. |
Are you sure you saw a missing frame using 1.14? I don't see any missing frames. I get the same trace you did in #36431 where you said you turned inlining off. I didn't turn inlining off. |
Hmm, must've been with |
Phew, thanks. I'm going to close this issue then. |
The backtraces from the race detector don't include inlined frames. But we now have that information available, via runtime.CallersFrames. It'd be nice to use it.
I went to look at adding this myself, but I'd need a few pointers--the race detector code is out of tree, and I can't find the place where the race detector traceback interacts with the Go runtime.
cc @dvyukov
The text was updated successfully, but these errors were encountered: