This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix TLS resource leaking in unittest
ClosedPublic

Authored by etienneb on Jun 30 2016, 12:01 PM.

Details

Summary

The thread specific key wasn't not released.
Running the unittest in loop will fail after 1024 iteraions.

./projects/compiler-rt/lib/sanitizer_common/tests/Sanitizer-i386-Test --gtest_filter=SanitizerCommon.PthreadDestructorIterations --gtest_repeat=2000 --gtest_break_on_failure
Repeating all tests (iteration 1023) . . .

Note: Google Test filter = SanitizerCommon.PthreadDestructorIterations
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from SanitizerCommon
[ RUN      ] SanitizerCommon.PthreadDestructorIterations
/usr/local/google/home/etienneb/llvm/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_posix_test.cc:54: Failure
Value of: pthread_key_create(&key, &destructor)
  Actual: 11
Expected: 0
Aborted (core dumped)

Diff Detail

Event Timeline

etienneb updated this revision to Diff 62396.Jun 30 2016, 12:01 PM
etienneb retitled this revision from to [compiler-rt] Fix TLS resource leaking in unittest.
etienneb updated this object.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, llvm-commits.
rnk accepted this revision.Jun 30 2016, 12:54 PM
rnk edited edge metadata.

lgtm

Feel free to just commit these kinds of one line fixes.

This revision is now accepted and ready to land.Jun 30 2016, 12:54 PM
etienneb closed this revision.Jun 30 2016, 1:03 PM