Skip to content

[compiler-rt] ThreadDescriptorSize is flaky (fails if other tests call InitTlsSize() first) #112399

@mgorny

Description

@mgorny

Today, two tests started failing for me on main:

FAIL: SanitizerCommon-Unit :: ./Sanitizer-i386-Test/1/12 (3455 of 7309)
******************** TEST 'SanitizerCommon-Unit :: ./Sanitizer-i386-Test/1/12' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests/./Sanitizer-i386-Test-SanitizerCommon-Unit-878-1-12.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=12 GTEST_SHARD_INDEX=1 /var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests/./Sanitizer-i386-Test
--

Script:
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests/./Sanitizer-i386-Test --gtest_filter=SanitizerLinux.ThreadDescriptorSize
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp:208: Failure
Expected equality of these values:
  0u
    Which is: 0
  ThreadDescriptorSize()
    Which is: 1216


/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp:208
Expected equality of these values:
  0u
    Which is: 0
  ThreadDescriptorSize()
    Which is: 1216



********************
FAIL: SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test/10/13 (3639 of 7309)
******************** TEST 'SanitizerCommon-Unit :: ./Sanitizer-x86_64-Test/10/13' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests
/./Sanitizer-x86_64-Test-SanitizerCommon-Unit-878-10-13.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=13 GTEST_SHARD_INDEX=10 /var/tmp/portag
e/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests/./Sanitizer-x86_64-Test
--

Script:
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt_build/lib/sanitizer_common/tests/./Sanitizer-x86_6
4-Test --gtest_filter=SanitizerLinux.ThreadDescriptorSize
--
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cp
p:208: Failure
Expected equality of these values:
  0u
    Which is: 0
  ThreadDescriptorSize()
    Which is: 2368


/var/tmp/portage/sys-libs/compiler-rt-sanitizers-20.0.0_pre20241015/work/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cp
p:208
Expected equality of these values:
  0u
    Which is: 0
  ThreadDescriptorSize()
    Which is: 2368



********************

A bisect points out that the failure started happening with aa44f59. Curious facts:

  • Tests fail only on one of the two systems I've tested. The "failing" system is -j12, the good one is -j32; I'm going to test later if switching the other to -j12 triggers the issue.
  • If I remove the newly added test (TEST(SanitizerCommon, PrintThreadHistory)), they start passing again.
  • If I remove the contents of the new test but leave the empty function in place, they still fail.

All this considered, my educated guess is that something is leaking from some other test, and the addition of this one caused other tests to be reorganized into shards that trigger this failure.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions