oneTBB: Debug assertion fails during static linking of onetbb 2021.6.0, but does not on 2021.3.0

Hi there,

i am trying to get an onetbb conan package update through. The ci-testing system ensures working different configurations and environments. As far as i can the the problem is not restricted to specific compiler versions and i was able to reproduce this assert fail on different gcc and clang versions. https://github.com/conan-io/conan-center-index/pull/13116

As far as i can see the problematic behavior gets triggered by the Debug mode (assuming that Release just disables the assertions and potentially hides the problem) in combination the shared=False option going for an static linkage.

maybe related to, since this is only triggered in shared=False and build_type=Debug sitatuion: https://github.com/oneapi-src/oneTBB/issues/297

The specific output as gathered from conan ci is: https://github.com/conan-io/conan-center-index/pull/13116#issuecomment-1259306027 The interesting part is:

Assertion node(val).my_prev_node == &node(val) && node(val).my_next_node == &node(val) failed (located in the push_front function, line in file: 135)
Detailed description: Object with intrusive list node can be part of only one intrusive list simultaneously

Does someone lighten me up here how to cope with such static linkage Debug asserts problems?Is this indicating a bigger issue? Is the old version just working because of missing assert statements, or is there in the meantime really something problematic introduced?

steps to reproduce:

git clone --branch onetbb/2021.6.0 https://github.com/cguentherTUChemnitz/conan-center-index.git 
cd conan-center-index/recipes/onetbb/all
docker run --rm -it -v$(pwd):/home/conan/project conanio/gcc11 /bin/bash -c "cd project && conan create . onetbb/2021.6.0@ -pr:b=default -pr:h=default -o onetbb:shared=False -s build_type=Debug"

or when conan is present locally, you can also leave the docker wrapper out with (from the onetbb/all working dir):

conan create . onetbb/2021.6.0@ -pr:b=default -pr:h=default -o onetbb:shared=False -s build_type=Debug

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Same issue here using a static build. It immediately asserts on startup when registering a task observer:

libc.so.6!__GI_raise(int sig) (raise.c:50)
libc.so.6!__GI_abort() (abort.c:79)
tbb::detail::r1::assertion_failure_impl(const char * location, int line, const char * expression, const char * comment) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\assert_impl.h:56)
operator()(const struct {...} * const __closure) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\assert_impl.h:73)
tbb::detail::d0::run_initializer<tbb::detail::r1::assertion_failure(char const*, int, char const*, char const*)::<lambda()> >(const struct {...} &, std::atomic<tbb::detail::d0::do_once_state> &)(const struct {...} & f, std::atomic<tbb::detail::d0::do_once_state> & state) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\include\oneapi\tbb\detail\_utils.h:288)
tbb::detail::d0::atomic_do_once<tbb::detail::r1::assertion_failure(char const*, int, char const*, char const*)::<lambda()> >(const struct {...} &, std::atomic<tbb::detail::d0::do_once_state> &)(const struct {...} & initializer, std::atomic<tbb::detail::d0::do_once_state> & state) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\include\oneapi\tbb\detail\_utils.h:277)
tbb::detail::r1::assertion_failure(const char * location, int line, const char * expression, const char * comment) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\assert_impl.h:73)
tbb::detail::r1::intrusive_list_base<tbb::detail::r1::intrusive_list<tbb::detail::r1::arena>, tbb::detail::r1::arena>::push_front(tbb::detail::r1::intrusive_list_base<tbb::detail::r1::intrusive_list<tbb::detail::r1::arena>, tbb::detail::r1::arena> * const this, tbb::detail::r1::arena & val) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\intrusive_list.h:134)
tbb::detail::r1::market::insert_arena_into_list(tbb::detail::r1::market * const this, tbb::detail::r1::arena & a) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\market.cpp:47)
tbb::detail::r1::market::create_arena(int num_slots, int num_reserved_slots, unsigned int arena_priority_level, std::size_t stack_size) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\market.cpp:303)
tbb::detail::r1::governor::init_external_thread() (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\governor.cpp:188)
tbb::detail::r1::governor::get_thread_data() (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\governor.h:103)
tbb::detail::r1::observe(tbb::detail::d1::task_scheduler_observer & tso, bool enable) (\work\weiss\deps\vcpkg\buildtrees\tbb\src\v2021.7.0-3b3fca2d98.clean\src\tbb\observer_proxy.cpp:271)
tbb::detail::d1::task_scheduler_observer::observe(tbb::detail::d1::task_scheduler_observer * const this, bool state) (\work\weiss\vcpkgs\x64-linux\include\oneapi\tbb\task_scheduler_observer.h:103)
weiss::TaskObserver::TaskObserver(weiss::TaskObserver * const this) (\work\weiss\weisscore\jobrunner.cpp:15)
main(int argc, char ** argv) (\work\weiss\weisscore\test\gtestmain.cpp:67)

here’s the Getting Started example as CMake project for testing: https://github.com/kambala-decapitator/onetbb-assert-debug-static