llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.11k stars 12.01k forks source link

ThreadPoolTest.GetFuture hangs with 1 CPU. #28331

Open vinsonlee opened 8 years ago

vinsonlee commented 8 years ago
Bugzilla Link 27957
Version trunk
OS Linux
CC @joker-eph

Extended Description

make check does not complete on a single CPU machine. It hangs at ThreadPoolTest.GetFuture.

$ ./build/unittests/Support/SupportTests --gtest_filter=ThreadPoolTest.GetFuture Note: Google Test filter = ThreadPoolTest.GetFuture [==========] Running 1 test from 1 test case. [----------] Global test environment set-up. [----------] 1 test from ThreadPoolTest [ RUN ] ThreadPoolTest.GetFuture

(gdb) bt

​0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38

​1 0x00007f282790dd7e in std::__atomic_futex_unsigned_base::_M_futex_wait_until(unsigned int*, unsigned int, bool, std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) ()

from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

​2 0x000055cf1ae988c4 in std::__atomic_futex_unsigned<2147483648u>::_M_load_and_test_until (this=0x55cf1bb90470, assumed=0, operand=1, __equal=true,

__mo=std::memory_order_acquire, __has_timeout=false, __s=..., __ns=...)
at /usr/include/c++/5/bits/atomic_futex.h:104

​3 0x000055cf1ae97ecb in std::__atomic_futex_unsigned<2147483648u>::_M_load_and_test

(this=0x55cf1bb90470, __assumed=0, __operand=1, __equal=true, 
__mo=std::memory_order_acquire) at /usr/include/c++/5/bits/atomic_futex.h:122

​4 0x000055cf1ae96bbb in std::atomic_futex_unsigned<2147483648u>::_M_load_when_equal (mo=std::memory_order_acquire, __val=1, this=0x55cf1bb90470)

at /usr/include/c++/5/bits/atomic_futex.h:162

​5 std::__future_base::_State_baseV2::wait (this=0x55cf1bb90460)

at /usr/include/c++/5/future:322

​6 0x000055cf1ae975c4 in std::__basic_future::_M_get_result (

this=0x7fff16a34ae0) at /usr/include/c++/5/future:681

​7 0x000055cf1ae96c5a in std::shared_future::get (this=0x7fff16a34ae0)

at /usr/include/c++/5/future:967

​8 0x000055cf1ae94cea in ThreadPoolTest_GetFuture_Test::TestBody (

this=0x55cf1bb90780)
at unittests/Support/ThreadPool.cpp:145

​9 0x000055cf1afeb6d8 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void> (object=0x55cf1bb90780, method=&virtual testing::Test::TestBody(),

location=0x55cf1b04eec3 "the test body")
at utils/unittest/googletest/src/gtest.cc:2090

​10 0x000055cf1afe77ef in testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> (object=0x55cf1bb90780, method=&virtual testing::Test::TestBody(),

location=0x55cf1b04eec3 "the test body")
at utils/unittest/googletest/src/gtest.cc:2142

​11 0x000055cf1afd5f2e in testing::Test::Run (this=0x55cf1bb90780)

at utils/unittest/googletest/src/gtest.cc:2162

​12 0x000055cf1afd658a in testing::TestInfo::Run (this=0x55cf1bb873d0)

at utils/unittest/googletest/src/gtest.cc:2309

​13 0x000055cf1afd6af8 in testing::TestCase::Run (this=0x55cf1bb870d0)

at utils/unittest/googletest/src/gtest.cc:2416

​14 0x000055cf1afdb557 in testing::internal::UnitTestImpl::RunAllTests (

this=0x55cf1bb6fd50)
at utils/unittest/googletest/src/gtest.cc:4207

​15 0x000055cf1afec565 in testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55cf1bb6fd50,

method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x55cf1afdb298 <testing::internal::UnitTestImpl::RunAllTests()>, 
location=0x55cf1b04f968 "auxiliary test code (environments or event listeners)")
at utils/unittest/googletest/src/gtest.cc:2090

​16 0x000055cf1afe80fd in testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (object=0x55cf1bb6fd50,

method=(bool (testing::internal::UnitTestImpl::*)(testing::internal::UnitTestImpl * const)) 0x55cf1afdb298 <testing::internal::UnitTestImpl::RunAllTests()>, 
location=0x55cf1b04f968 "auxiliary test code (environments or event listeners)")
at utils/unittest/googletest/src/gtest.cc:2142

​17 0x000055cf1afda54a in testing::UnitTest::Run (

this=0x55cf1b317bc0 <testing::UnitTest::GetInstance()::instance>)
at utils/unittest/googletest/src/gtest.cc:3841

​18 0x000055cf1afd127e in main (argc=1, argv=0x7fff16a35008)

at utils/unittest/UnitTestMain/TestMain.cpp:47
vinsonlee commented 8 years ago

What is the config? (OS, compiler, stdlib)

Ubuntu 16.04 g++ 5.3.1-1ubuntu1 libstdc++ 5.3.1-14ubuntu2.1

joker-eph commented 8 years ago

What is the config? (OS, compiler, stdlib)