mxz297 / dyninst

DyninstAPI: Tools for binary instrumentation, analysis, and modification.
http://www.dyninst.org
GNU Lesser General Public License v2.1
2 stars 3 forks source link

Support calling instrumentation libraries written in Go #8

Open mxz297 opened 3 years ago

mxz297 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

Hi @mxz297 ,

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