Skip to content
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

Support calling instrumentation libraries written in Go #8

Open
mxz297 opened this issue Apr 4, 2021 · 3 comments
Open

Support calling instrumentation libraries written in Go #8

mxz297 opened this issue Apr 4, 2021 · 3 comments

Comments

@mxz297
Copy link
Owner

mxz297 commented Apr 4, 2021

While I have added support for emitting function calls conforming to Go ABI (passing parameters on stack) for binary rewriting, it is not sufficient. The key issue is that if we call a function written in Go in instrumentation, the Go function may trigger dynamic stack growth and initialize stack unwinding.

However, currently I only generate a return address mapping for existing function call. The table does not include any recipe for unwinding through instrumentation. Note that function calls in instrumentation are newly generated code, so there is not existing .eh_frame corresponding.

@mxz297
Copy link
Owner Author

mxz297 commented Apr 4, 2021

@ManojKumarChauhan I looked at the case where mybin_out does not crash but mybin_out_p crashes. The root cause of mybin_out_p crash is mentioned above. I think the fact that mybin_out does not crash is just accidental.

I have some ongoing work that serves as a foundation to resolve this problem. I am not there yet. This is something that I am interested to support. I will think about how to incorporate this issue my plan. It will probably take several weeks.

@ManojKumarChauhan
Copy link

ManojKumarChauhan commented Apr 7, 2021

Hi @mxz297,
Thanks for the clarification.
The crash also exists when the instrumented function is the part of a go library with c-shared or plugin option.

@ManojKumarChauhan
Copy link

Hi @mxz297 ,

As per discus
qorappl.zip
sion, please get the reproducer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants