Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Apr 2019 13:56:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 237068] /usr/local/bin/ld: BFD (GNU Binutils) 2.30 assertion fail elflink.c:2824
Message-ID:  <bug-237068-29464-lJW1rxERZD@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-237068-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-237068-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D237068

--- Comment #5 from Dimitry Andric <dim@FreeBSD.org> ---
(In reply to Ed Maste from comment #4)
> Is there an associated GNU binutils ld bug report?

Not yet, I'm working on a small test case. The issue appears to be caused b=
y a
versioned weak symbol:

  llvm::hashing::detail::get_execution_seed()::seed@@JL_LLVM_6.0

I added some debug printfs around the failing assertion, with binutils mast=
er,
and this shows:

DBG h  : llvm::hashing::detail::get_execution_seed()::seed@@JL_LLVM_6.0
DBG def: __bss_start@@JL_LLVM_6.0
/home/dim/ins/binutils-master-e392bad3e/bin/ld: BFD (GNU Binutils)
2.32.51.20190407 assertion fail /share/dim/src/binutils-gdb/bfd/elflink.c:2=
974
DBG h  : llvm::hashing::detail::get_execution_seed()::seed@@JL_LLVM_6.0
DBG def: __bss_start@@JL_LLVM_6.0
/home/dim/ins/binutils-master-e392bad3e/bin/ld: BFD (GNU Binutils)
2.32.51.20190407 assertion fail /share/dim/src/binutils-gdb/bfd/elflink.c:2=
974

The 'seed' variable is a static variable in an inline function in
include/llvm/ADT/Hashing.h:

/// \brief A global, fixed seed-override variable.
///
/// This variable can be set using the \see llvm::set_fixed_execution_seed
/// function. See that function for details. Do not, under any circumstance=
s,
/// set or read this variable.
extern size_t fixed_seed_override;

inline size_t get_execution_seed() {
  // FIXME: This needs to be a per-execution seed. This is just a placehold=
er
  // implementation. Switching to a per-execution seed is likely to flush o=
ut
  // instability bugs and so will happen as its own commit.
  //
  // However, if there is a fixed seed override set the first time this is
  // called, return that instead of the per-execution seed.
  const uint64_t seed_prime =3D 0xff51afd7ed558ccdULL;
  static size_t seed =3D fixed_seed_override ? fixed_seed_override
                                           : (size_t)seed_prime;
  return seed;
}

In libLLVM-6.0.so's .symtab, it looks like:

$ readelf -sW
/wrkdirs/share/dim/ports/lang/julia/work/julia-1.0.3/deps/scratch/llvm-6.0.=
0/build_Release/lib/libLLVM-6.0.so
| grep _ZZN4llvm7hashing6detail18get_execution_seedEvE4seed
3490: 00000000027c5380     8 OBJECT  WEAK   DEFAULT   28
_ZZN4llvm7hashing6detail18get_execution_seedEvE4seed@@JL_LLVM_6.0
31450: 00000000027c5380     8 OBJECT  WEAK   DEFAULT   28
_ZZN4llvm7hashing6detail18get_execution_seedEvE4seed

For some reason, there is both a symbol with versionJL_LLVM_6.0, and one
without.

libLLVM-6.0.so gets built with the following very simple version script:

JL_LLVM_6.0 { global: *; };

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-237068-29464-lJW1rxERZD>