Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
2421 Discussions

crash with -flto and Ubuntu 16.04.2 and g++-6

Peter_F_1
Beginner
231 Views

#0  0x00007ffff6d5a799 in tbb::internal::intrusive_list_base<tbb::internal::intrusive_list<tbb::internal::generic_scheduler>, tbb::internal::generic_scheduler>::push_front(tbb::internal::generic_scheduler&) ()
    at ../../src/tbb/intrusive_list.h:175
#1  tbb::internal::generic_scheduler::create_master(tbb::internal::arena*) (a=0x0) at ../../src/tbb/scheduler.cpp:1181
#2  0x00007ffff6d4611c in tbb::internal::governor::init_scheduler_weak () at ../../src/tbb/governor.cpp:178
#3  tbb::internal::governor::local_scheduler_weak () at ../../src/tbb/governor.h:140
#4  tbb::internal::allocate_root_with_context_proxy::allocate (this=0x7fffffff8d60, size=88)
    at ../../src/tbb/task.cpp:67

anybody any clue?
It works fine in debug mode (using tbb_debug.so).
I only did minor changes to tbb2017_20161128oss/build/linux.gcc.inc:

35,36c35,36
< CPLUS = g++
< CONLY = gcc
---
> CPLUS = g++-6
> CONLY = gcc-6
71c71,73
<         CPLUS_FLAGS = $(ITT_NOTIFY) -g -O2 -DUSE_PTHREAD
---
>         CPLUS_FLAGS = $(ITT_NOTIFY) -g -O3 -DUSE_PTHREAD -flto=8 -funroll-loops -ffast-math -march=native
>     LINK_FLAGS += $(CPLUS_FLAGS)
>     LIB_LINK_FLAGS += $(CPLUS_FLAGS)

 

0 Kudos
4 Replies
Peter_F_1
Beginner
231 Views

this also seems to be true, without -flto and even when replacing -O3 with -O2 or even with a nearly original linux.gcc.inc (only compilers changed to version 6). Only when using libtbb_debug.so it is not crashing. BTW the code is clean regarding valgrind.

Alexey_K_Intel3
Employee
231 Views

If your version of TBB precedes 4.4.6, please upgrade. TBB 4.4.6 is the minimal version that works with GCC 6.

Peter_F_1
Beginner
231 Views
Alexey_K_Intel3
Employee
231 Views

Correct. Since TBB 4.4.6, the -flifetime-dse=1 option is added to the TBB makefiles.

Reply