SideChannelMarvels / Tracer

Set of Dynamic Binary Instrumentation and visualization tools for execution traces.
GNU General Public License v3.0
297 stars 70 forks source link

segmentation fault #36

Closed winterNan closed 3 months ago

winterNan commented 3 months ago

Hi, Thanks for such a great tool. However I met the following error when I was trying to profile my binary:

    [*] Trace file trace-full-info.txt opened for writing...
    /usr/local/bin/Tracer: line 26: 1423379 Segmentation fault      (core dumped) $pin $modules $options $*
I tried to use gdb on intel PIN but it seems that there is no symbol table with it. I also tried strace but it does not really help.
Based on these, can you kindly hint me on how to debug tracer.so? 
Thanks!
doegox commented 3 months ago

Does it happen for other binaries as well or this specific one?

winterNan commented 3 months ago

Thanks for the light-speed reply. The problem is the PIN version. I use an intel 13th generation processor. After upgrading PIN to 3.30 everything works.

However there are some modifications to Tracer.cpp as follows:

1, change PIN_LOCK lock to PIN_LOCK _lock. (otherwise there is a name conflicts.) 2, change TraceFile==NULL to TraceFile.fail(). Otherwise gcc complains.

I can make a PR if necessary.

winterNan commented 3 months ago

To the question, this only happens to my binary and does not happen to the ls command in the example.

doegox commented 3 months ago

ha interesting ! well yes we're using a super old version because of the bindings with sqlite. Newer Intel PIN versions don't use the common libc anymore and I think you can't tell the tracer to store the trace in a sqlite DB anymore. But maybe latest PIN versions are again different and allow it again. If you've time yes please open a PR and I'll try to test the different tracer options.

doegox commented 3 months ago

you solved it with your PR, thanks!