-
Notifications
You must be signed in to change notification settings - Fork 89
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
Fix broken stacks traces on Go code #100
Comments
Hi, I just discovered this project and it looks like an amazingly useful tool, and I'd love to get it working better with Go. I haven't tried running myself yet, but some initial notes below:
[1] A bit more background: the |
Thanks for taking a look at this. It's nice to have someone who actually knows how Go works (as opposed to us) working on this. To answer your question: magic-trace doesn't track or know anything about stack pointers. The stack frames are entirely inferred by the history of application's control flow (e.g. call, ret, jmp). From your description, it sounds like stack shrinking is uninteresting to magic-trace. |
See the comment in trace_writer.ml for more details about what this entails. The gist of what I've done here is review every call to `gogo` within demo.go and make sure the stack returns to the right spot. Fixes janestreet#100
See the comment in trace_writer.ml for more details about what this entails. The gist of what I've done here is review every call to `gogo` within demo.go and make sure the stack returns to the right spot. Fixes janestreet#100
I've put up a draft of a PR that works on a very simple demo program. Thanks for the Could you please take a look at that PR and try that version of magic-trace on some interesting go programs you may have lying around? |
In this simple Go example, it's clear that Go's stack switch causes stacktraces to wander off the right hand side of the screen. I think this is easy to fix: when trace_writer.ml, sees the symbol runtime.newstack, it should mark all currently-open stack frames as closed.
I'm not sure if there is any more custom control flow in Go code. e.g. do Go stacks shrink? Please file more bugs if you notice any.
The text was updated successfully, but these errors were encountered: