Skip to content

Make libuwind target thread safe - #793

Open
jonringer wants to merge 1 commit into
intel:mainfrom
jonringer:patch-1
Open

Make libuwind target thread safe#793
jonringer wants to merge 1 commit into
intel:mainfrom
jonringer:patch-1

Conversation

@jonringer

@jonringer jonringer commented Feb 10, 2022

Copy link
Copy Markdown

may close: #784

@jonringer

jonringer commented Feb 10, 2022

Copy link
Copy Markdown
Author

still fails, logs:

I don't think the relevant logs will be in here, it failed on make[1], which was likely much earlier

logs
libtool: compile: mv -f "span.o" "src/libtcmalloc_minimal_internal_la-span.o"
In file included from src/page_heap.cc:43:
src/page_heap_allocator.h: In instantiation of 'tcmalloc::STLPageHeapAllocator<T, LockingTag>::Storage::Storage(base::LinkerInitialized) [with T = std::__1::__tree_node<tcmalloc::SpanPtrWithLength, void*>; LockingTag = void]':
src/page_heap_allocator.h:175:55:   required from 'tcmalloc::STLPageHeapAllocator<std::__1::__tree_node<tcmalloc::SpanPtrWithLength, void*>, void>::Storage tcmalloc::STLPageHeapAllocator<std::__1::__tree_node<tcmalloc::SpanPtrWithLength, void*>, void>::un>
src/page_heap_allocator.h:162:5:   required from 'void tcmalloc::STLPageHeapAllocator<T, LockingTag>::deallocate(tcmalloc::STLPageHeapAllocator<T, LockingTag>::pointer, tcmalloc::STLPageHeapAllocator<T, LockingTag>::size_type) [with T = std::__1::__tree_n>
../../../sdk/tlibcxx/include/memory:1500:24:   required from 'static void std::__1::allocator_traits<_Alloc>::deallocate(std::__1::allocator_traits<_Alloc>::allocator_type&, std::__1::allocator_traits<_Alloc>::pointer, std::__1::allocator_traits<_Alloc>::>
../../../sdk/tlibcxx/include/__tree:1793:34:   required from 'void std::__1::__tree<_Tp, _Compare, _Allocator>::destroy(std::__1::__tree<_Tp, _Compare, _Allocator>::__node_pointer) [with _Tp = tcmalloc::SpanPtrWithLength; _Compare = tcmalloc::SpanBestFitL>
../../../sdk/tlibcxx/include/__tree:1780:5:   required from 'std::__1::__tree<_Tp, _Compare, _Allocator>::~__tree() [with _Tp = tcmalloc::SpanPtrWithLength; _Compare = tcmalloc::SpanBestFitLess; _Allocator = tcmalloc::STLPageHeapAllocator<tcmalloc::SpanPt>
../../../sdk/tlibcxx/include/set:400:29:   required from here
src/page_heap_allocator.h:167:46: warning: unused parameter 'x' [-Wunused-parameter]
  167 |     explicit Storage(base::LinkerInitialized x) {}
      |                      ~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from src/libc_override.h:92,
                 from src/tcmalloc.cc:150:
src/libc_override_gcc_and_weak.h: At global scope:
src/libc_override_gcc_and_weak.h:130:6: warning: the program should also define 'void operator delete(void*)' [-Wsized-deallocation]
  130 | void operator delete(void *p, size_t size) CPP_NOTHROW
      |      ^~~~~~~~
src/libc_override_gcc_and_weak.h:132:6: warning: the program should also define 'void operator delete [](void*)' [-Wsized-deallocation]
  132 | void operator delete[](void *p, size_t size) CPP_NOTHROW
      |      ^~~~~~~~
mv -f src/.deps/libtcmalloc_minimal_internal_la-span.Tpo src/.deps/libtcmalloc_minimal_internal_la-span.Plo
src/libc_override_gcc_and_weak.h:130:6: warning: 'void operator delete(void*, size_t)' alias between functions of incompatible types 'void(void*, size_t) noexcept' {aka 'void(void*, long unsigned int)'} and 'void(void*)' [-Wattribute-alias=]
  130 | void operator delete(void *p, size_t size) CPP_NOTHROW
      |      ^~~~~~~~
src/tcmalloc.cc:1984:36: note: aliased declaration here
 1984 | extern "C" PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_NOTHROW
      |                                    ^~~~~~~~~
In file included from src/libc_override.h:92,
                 from src/tcmalloc.cc:150:
src/libc_override_gcc_and_weak.h:132:6: warning: 'void operator delete [](void*, size_t)' alias between functions of incompatible types 'void(void*, size_t) noexcept' {aka 'void(void*, long unsigned int)'} and 'void(void*)' [-Wattribute-alias=]
  132 | void operator delete[](void *p, size_t size) CPP_NOTHROW
      |      ^~~~~~~~
src/tcmalloc.cc:2028:36: note: aliased declaration here
 2028 | extern "C" PERFTOOLS_DLL_DECL void tc_deletearray(void* p) PERFTOOLS_NOTHROW
      |                                    ^~~~~~~~~~~~~~
libtool: compile: mv -f "sampler.o" "src/libtcmalloc_minimal_internal_la-sampler.o"
libtool: compile: mv -f "malloc_extension.o" "src/libtcmalloc_minimal_internal_la-malloc_extension.o"
libtool: compile: mv -f "static_vars.o" "src/libtcmalloc_minimal_internal_la-static_vars.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-sampler.Tpo src/.deps/libtcmalloc_minimal_internal_la-sampler.Plo
mv -f src/.deps/libtcmalloc_minimal_internal_la-malloc_extension.Tpo src/.deps/libtcmalloc_minimal_internal_la-malloc_extension.Plo
mv -f src/.deps/libtcmalloc_minimal_internal_la-static_vars.Tpo src/.deps/libtcmalloc_minimal_internal_la-static_vars.Plo
libtool: compile: mv -f "symbolize.o" "src/libtcmalloc_minimal_internal_la-symbolize.o"
libtool: compile: mv -f "stack_trace_table.o" "src/libtcmalloc_minimal_internal_la-stack_trace_table.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-symbolize.Tpo src/.deps/libtcmalloc_minimal_internal_la-symbolize.Plo
mv -f src/.deps/libtcmalloc_minimal_internal_la-stack_trace_table.Tpo src/.deps/libtcmalloc_minimal_internal_la-stack_trace_table.Plo
libtool: compile: mv -f "central_freelist.o" "src/libtcmalloc_minimal_internal_la-central_freelist.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-central_freelist.Tpo src/.deps/libtcmalloc_minimal_internal_la-central_freelist.Plo
libtool: link: ar cru .libs/libspinlock.a  src/base/spinlock.o src/base/atomicops-internals-x86.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libspinlock.a
libtool: link: ar cru .libs/libmaybe_threads.a  src/maybe_threads.o
libtool: link: ( cd ".libs" && rm -f "libspinlock.la" && ln -s "../libspinlock.la" "libspinlock.la" )
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmaybe_threads.a
libtool: link: ( cd ".libs" && rm -f "libmaybe_threads.la" && ln -s "../libmaybe_threads.la" "libmaybe_threads.la" )
libtool: compile: mv -f "thread_cache.o" "src/libtcmalloc_minimal_internal_la-thread_cache.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-thread_cache.Tpo src/.deps/libtcmalloc_minimal_internal_la-thread_cache.Plo
libtool: compile: mv -f "malloc_hook.o" "src/libtcmalloc_minimal_internal_la-malloc_hook.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-malloc_hook.Tpo src/.deps/libtcmalloc_minimal_internal_la-malloc_hook.Plo
libtool: compile: mv -f "page_heap.o" "src/libtcmalloc_minimal_internal_la-page_heap.o"
mv -f src/.deps/libtcmalloc_minimal_internal_la-page_heap.Tpo src/.deps/libtcmalloc_minimal_internal_la-page_heap.Plo
/nix/store/07j81a5xy8j1srvf57dl7lxsaihnmfac-bash-5.1-p12/bin/bash ./libtool  --tag=CXX   --mode=link g++ -DNO_TCMALLOC_SAMPLES -DNO_HEAP_CHECK -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -fno-builtin-malloc -fno-builtin-free -fno>
make[6]: Leaving directory '/build/source/external/protobuf/protobuf_code/final_protocPB/build'
[100%] Built target protoc
make[5]: Leaving directory '/build/source/external/protobuf/protobuf_code/final_protocPB/build'
make[4]: Leaving directory '/build/source/external/protobuf/protobuf_code/final_protocPB/build'
cp -f protobuf_code/final_tlibPB/build/libprotobuf.a /build/source/build/linux/libsgx_protobuf.a
cp -f protobuf_code/final_protocPB/build/protoc /build/source/build/linux/sgx_protoc
make[3]: Leaving directory '/build/source/external/protobuf'
libtool: link: (cd .libs/libtcmalloc_minimal_internal.lax/libspinlock.a && ar x "/build/source/sdk/gperftools/gperftools-2.7/./.libs/libspinlock.a")
libtool: link: (cd .libs/libtcmalloc_minimal_internal.lax/libmaybe_threads.a && ar x "/build/source/sdk/gperftools/gperftools-2.7/./.libs/libmaybe_threads.a")
libtool: link: ar cru .libs/libtcmalloc_minimal_internal.a  src/libtcmalloc_minimal_internal_la-common.o src/libtcmalloc_minimal_internal_la-internal_logging.o src/libtcmalloc_minimal_internal_la-system-alloc.o src/libtcmalloc_minimal_internal_la-central_>
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libtcmalloc_minimal_internal.a
libtool: link: rm -fr .libs/libtcmalloc_minimal_internal.lax
libtool: compile: mv -f "tcmalloc.o" "src/libtcmalloc_minimal_la-tcmalloc.o"
mv -f src/.deps/libtcmalloc_minimal_la-tcmalloc.Tpo src/.deps/libtcmalloc_minimal_la-tcmalloc.Plo
libtool: link: ( cd ".libs" && rm -f "libtcmalloc_minimal_internal.la" && ln -s "../libtcmalloc_minimal_internal.la" "libtcmalloc_minimal_internal.la" )
/nix/store/07j81a5xy8j1srvf57dl7lxsaihnmfac-bash-5.1-p12/bin/bash ./libtool  --tag=CXX   --mode=link g++ -DNO_TCMALLOC_SAMPLES  -DNDEBUG -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -fno-builtin-malloc -fno-builtin-free -fno-builtin-reallo>
libtool: link: (cd .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a && ar x "/build/source/sdk/gperftools/gperftools-2.7/./.libs/libtcmalloc_minimal_internal.a")
libtool: link: ar cru .libs/libtcmalloc_minimal.a  src/libtcmalloc_minimal_la-tcmalloc.o  .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a/atomicops-internals-x86.o .libs/libtcmalloc_minimal.lax/libtcmalloc_minimal_internal.a/libtcmalloc_minim>
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libtcmalloc_minimal.a
libtool: link: rm -fr .libs/libtcmalloc_minimal.lax
libtool: link: ( cd ".libs" && rm -f "libtcmalloc_minimal.la" && ln -s "../libtcmalloc_minimal.la" "libtcmalloc_minimal.la" )
for la in libtcmalloc_minimal.la    ; do lib=".libs/`basename $la .la`.a"; [ ! -f "$lib" ] || : "$lib"; done
make[4]: Leaving directory '/build/source/sdk/gperftools/gperftools-2.7'
cp -f gperftools-2.7/.libs/libtcmalloc_minimal.a libsgx_tcmalloc.a
cp -f libsgx_tcmalloc.a /build/source/build/linux
make[3]: Leaving directory '/build/source/sdk/gperftools'
make[2]: Leaving directory '/build/source/sdk'
make[1]: *** [Makefile:50: all] Error 2
make[1]: Leaving directory '/build/source/sdk'
make: *** [Makefile:71: sdk] Error 2

@jonringer

Copy link
Copy Markdown
Author

hard to tell the actual failure line. All of the output is just line dumped

@lzha101

lzha101 commented Feb 10, 2022

Copy link
Copy Markdown
Contributor

hard to tell the actual failure line. All of the output is just line dumped

Can you attach the complete log here?

Comment thread sdk/cpprt/Makefile

$(CPPRT): $(OBJS) prepare-libunwind libunwind
$(CPPRT): $(OBJS) prepare-libunwind
$(Make) libunwind

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make or MAKE?

@bot-cc1s-branch-sync

Copy link
Copy Markdown
Contributor

Important

🔀 The Intel® SGX SDK codebase has moved

Thank you for your contribution!
The code this pull request modifies now resides in a new repository,1 so, unfortunately, it can no longer be merged here as-is. If your change is still relevant, please re-open it against the SDK repository, where this code is now maintained.

If you have any questions or need assistance migrating, please ask here. As we complete the migration, older pull requests may eventually be closed. No work is lost, though, and you are welcome to re-open your change in the new repository at any time.

Footnotes

  1. The affected sources were migrated from confidential-computing.sgx to the dedicated confidential-computing.sgx.sdk repo. The migration covered the SDK sources (sdk/), shared headers (common/), samples (SampleCode/), and the runtime libraries (psw/urts, psw/enclave_common).

@bot-cc1s-branch-sync bot-cc1s-branch-sync added the repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting) label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

repo-migration PR whose files moved to the SGX SDK repo (needs re-targeting)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants