cppcoro icon indicating copy to clipboard operation
cppcoro copied to clipboard

static_thread_pool test coredump??

Open anlongfei opened this issue 4 years ago • 2 comments

Hi all, I copied TEST_CASE("launch many tasks remotely") and modified like this blow. TEST_CASE("modified launch many tasks remotely") { unsigned int consumer_thread_num = 4; cppcoro::static_thread_pool threadPool{ consumer_thread_num }; int task_exec_num = 1'000'000; cppcoro::async_mutex mutex; auto makeTask = & -> cppcoro::task<> { co_await threadPool.schedule();

// repeat lock and unlock
co_await mutex.lock_async(); 
mutex.unlock();

co_await mutex.lock_async();
mutex.unlock();

co_await mutex.lock_async(); 
mutex.unlock();

};

std::vector<cppcoro::task<>> tasks; for (std::uint32_t i = 0; i < task_exec_num; ++i) { tasks.push_back(makeTask()); }
cppcoro::sync_wait(cppcoro::when_all(std::move(tasks))); } The testcase was compiled by clang8.0,and runned. but it core dump. the back trace like this blow. could somI do not understand the reason?

..... #130982 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130983 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130984 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130985 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130986 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130987 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130988 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130989 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130990 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130991 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130992 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130993 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130994 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130995 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130996 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #130997 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130998 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #130999 0x00000000002124a4 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:61 #131000 0x0000000000212517 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:64 #131001 0x0000000000212431 in _DOCTEST_ANON_FUNC_4()::$_0::operator()() const (this=) at test/cppcoro_tests.cpp:58 #131002 0x00000000002131ca in std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, cppcoro::static_thread_pool::static_thread_pool(unsigned int)::$_0> >(void*) (__vp=) at /home/longfei.alf/mytools/LLVM/local/bin/../include/c++/v1/experimental/coroutine:123 #131003 0x00007ffff7306e25 in start_thread () from /lib64/libpthread.so.0 #131004 0x00007ffff7618f1d in clone () from /lib64/libc.so.6 (gdb)

anlongfei avatar Nov 15 '19 12:11 anlongfei

Just out of interest, what did the issue end up being?

lewissbaker avatar Nov 17 '19 19:11 lewissbaker

sorry for my poor English. i have not find the detail reason for this coredump. do you have any idea??

anlongfei avatar Dec 06 '19 09:12 anlongfei