This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Tool] Fix memory leak and double-allocation
ClosedPublic

Authored by protze.joachim on Jan 15 2020, 9:19 AM.

Diff Detail

Event Timeline

protze.joachim created this revision.Jan 15 2020, 9:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 15 2020, 9:19 AM
Herald added a subscriber: guansong. · View Herald Transcript
Hahnfeld added inline comments.Jan 15 2020, 9:57 AM
openmp/tools/archer/ompt-tsan.cpp
864–865

Why do we need tsan_flags globally? It's again deleted further below, you can just put it onto the stack.

You are right, with the current usage a local variable works.

Hahnfeld added inline comments.Jan 16 2020, 12:33 AM
openmp/tools/archer/ompt-tsan.cpp
864–865

Why do we need to new this? Even though not really critical, it'll be leaked in all the error cases below.

It should be easier to do the following:

TsanFlags tsan_flags(options);
This revision is now accepted and ready to land.Jan 16 2020, 11:27 AM
This revision was automatically updated to reflect the committed changes.

@hans please include to the 10.0 branch