Repository navigation
ODR issue for gcc san with CRAN version #152
Description
Activity
This is because both tbb and tbbmalloc define the (identical) object here:
RcppParallel/src/tbb/src/tbb/tools_api/ittnotify_static.c
Lines 226 to 243 in 20d6042
/* static part descriptor which handles. all notification api attributes. */ __itt_global _N_(_ittapi_global) = { ITT_MAGIC, /* identification info */ ITT_MAJOR, ITT_MINOR, API_VERSION_BUILD, /* version info */ 0, /* api_initialized */ 0, /* mutex_initialized */ 0, /* atomic_counter */ MUTEX_INITIALIZER, /* mutex */ NULL, /* dynamic library handle */ NULL, /* error_handler */ (const char**)&dll_path, /* dll_path_ptr */ (__itt_api_info*)&api_list, /* api_list_ptr */ NULL, /* next __itt_global */ NULL, /* thread_list */ NULL, /* domain_list */ NULL, /* string_list */ __itt_collection_normal /* collection state */ }; I tried playing around to see if there was a simple way to avoid that collision, but I couldn't find anything on first glance.
For some reason, some compiled optimized versions do not see this ODR violation; I think it doesn't (yet) occur with CRAN.
It does; the CRAN team has notified me already. And it's apparent because that same symbol is defined in both libraries:
$ nm libtbb.dylib | grep ittapi_global 00000000000268e0 d ___itt__ittapi_global $ nm libtbbmalloc.dylib | grep ittapi_global 0000000000015c30 d ___itt__ittapi_globalI'm not sure what the right fix is on TBB's side, though. Should they be sharing a single definition? Should the name of the version in tbbmalloc be different?
I am unsure too. We simply redefined for each binary that we produced. If you follow that approach you would pick one and change any name that refers to it. This could probably by some build script.
Note to self, the solution here is probably to try defining
INTEL_ITTNOTIFY_PREFIXdifferently for tbb + tbbmalloc:RcppParallel/src/tbb/src/tbb/tools_api/ittnotify.h
Lines 239 to 244 in ad65ac4
#ifndef INTEL_ITTNOTIFY_PREFIX # define INTEL_ITTNOTIFY_PREFIX __itt_ #endif /* INTEL_ITTNOTIFY_PREFIX */ #ifndef INTEL_ITTNOTIFY_POSTFIX # define INTEL_ITTNOTIFY_POSTFIX _ptr_ #endif /* INTEL_ITTNOTIFY_POSTFIX */
I am getting the following ODR violation; CRAN asked me to fix ODR violations in my package, and this one came up: