Skip to content

Commit

Permalink
initialize tls structure to zero
Browse files Browse the repository at this point in the history
fixes gaasedelen#5 which could cause pintool to crash on the first instruction
  • Loading branch information
gaasedelen authored Apr 25, 2021
1 parent 352237b commit 7f97ae8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tracers/pin/pintenet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ static VOID OnThreadStart(THREADID tid, CONTEXT* ctxt, INT32 flags, VOID* v)
// Create a new 'ThreadData' object and set it on the TLS.
auto& context = *reinterpret_cast<ToolContext*>(v);
auto data = new ThreadData;
memset(data, 0, sizeof(ThreadData));

data->m_trace = new ofstream;
context.setThreadLocalData(tid, data);

Expand Down

0 comments on commit 7f97ae8

Please sign in to comment.