Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
603 Discussions

Windows debug version using tbb2021.5 and VS2017 crashes right after the executable is launched

tbbuser
Novice
675 Views

Using Windows debug version of my executable using tbb 2021.5 and VS2017 compiler, crashes right after the executable is launched.  The optimized version of the executable does not crash.

 

I have used tbb::enumerable_thread_specific feature in my code. Looks like there is some memory corruption when it is trying to initialize this variable.

I have a capture of the stack trace in windbg.

Could you please let me know what could be going wrong here

Labels (1)
0 Kudos
1 Solution
tbbuser
Novice
580 Views

I figured out the problem.

My CMakeLists.txt for tbb (configuration file ) was missing the following lines which disables the inter procedural optimization of the tbb code.

 

if (CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type)
if (_tbb_build_type STREQUAL "debug")
set(TBB_ENABLE_IPO OFF)
endif()
unset(_tbb_build_type)
endif()

 

The debug build no longer crashes.

View solution in original post

0 Kudos
1 Reply
tbbuser
Novice
581 Views

I figured out the problem.

My CMakeLists.txt for tbb (configuration file ) was missing the following lines which disables the inter procedural optimization of the tbb code.

 

if (CMAKE_BUILD_TYPE)
string(TOLOWER ${CMAKE_BUILD_TYPE} _tbb_build_type)
if (_tbb_build_type STREQUAL "debug")
set(TBB_ENABLE_IPO OFF)
endif()
unset(_tbb_build_type)
endif()

 

The debug build no longer crashes.

0 Kudos
Reply