Skip to content

Unfortunate export of backtrace_uncompress_zdebug #58132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GregBowyer opened this issue Feb 3, 2019 · 2 comments
Closed

Unfortunate export of backtrace_uncompress_zdebug #58132

GregBowyer opened this issue Feb 3, 2019 · 2 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries

Comments

@GregBowyer
Copy link

GregBowyer commented Feb 3, 2019

This might be related to #34984, basically making a rust staticlib to be consumed from a C program which is linked under GCC and is using the address sanitizer collides on backtrace_uncompress_zdebug

This error shows up in our builds (not cargo sorry) like so

ERROR: /home/greg/.cache/bazel/_bazel_greg/c75e2059c1e63a4c3c0afb06f978fe5a/external/rure/BUILD.bazel:30:1: Linking of rule '@rure//:rure_test' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -o bazel-out/k8-fastbuild/bin/external/rure/rure_test -Wl,--gc-sections '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -m64 -m64 '-fsanitize=address' ... (remaining 4 argument(s) skipped)
Use --sandbox_debug to see verbose messages from the sandbox
/usr/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/external/rure/librure_impl-444955826.a(elf.o): multiple definition of 'backtrace_uncompress_zdebug'
/usr/bin/ld.gold: /usr/lib/gcc/x86_64-linux-gnu/7/libasan.a(elf.o): previous definition here
collect2: error: ld returned 1 exit status
INFO: Elapsed time: 0.837s, Critical Path: 0.28s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

Rust version

greg@gregslaptop ~/work/core-ticketing-host $ ./bazel-core-ticketing-host/external/rust_linux_x86_64/bin/rustc --version
rustc 1.31.0 (abe02cefd 2018-12-04)
greg@gregslaptop ~/work/core-ticketing-host $

*backtrace* symbols from librure_impl.a

bingrep -D -s backtrace_* bazel-out/k8-fastbuild/bin/external/rure/librure_impl-444955826.a  | grep backtrace
Symbol                            Owner
  backtrace_alloc                   alloc.o
  backtrace_free                    alloc.o
  backtrace_vector_finish           alloc.o
  backtrace_vector_grow             alloc.o
  backtrace_vector_release          alloc.o
  backtrace_full                    backtrace.o
  backtrace_dwarf_add               dwarf.o
  backtrace_pcinfo                  fileline.o
  backtrace_syminfo                 fileline.o
  backtrace_close                   posix.o
  backtrace_open                    posix.o
  backtrace_get_view                read.o
  backtrace_release_view            read.o
  backtrace_qsort                   sort.o
  backtrace_create_state            state.o
  backtrace_initialize              elf.o
  backtrace_uncompress_zdebug       elf.o

Rure in this case is the regex-capi from the regex crate.

Compiling with clang, or without asan solves this, maybe something is missing in hiding symbols in libbacktrace?

@jonas-schievink jonas-schievink added the A-linkage Area: linking into static, shared libraries and binaries label Feb 3, 2019
@GregBowyer
Copy link
Author

FWIW this might be unrelated to rust, and might be bazel rust_rules problem (bazelbuild/rules_rust#189)

@bdfshongjie
Copy link

bdfshongjie commented Mar 4, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries
Projects
None yet
Development

No branches or pull requests

3 participants