[Bug 1330451] Re: ld crashes with SIGSEGV in bfd_hash_table_free when linking with MALLOC_PERTURB_ set

Iain Lane iain at orangesquash.org.uk
Mon Jun 16 13:07:28 UTC 2014


** Summary changed:

- ld crashes with SIGSEGV in bfd_hash_table_free when linking with MALLOC_PETURB_ set
+ ld crashes with SIGSEGV in bfd_hash_table_free when linking with MALLOC_PERTURB_ set

** Description changed:

  I saw this when building glib on Debian & then noticed that it also
  happens in utopic. Trusty is okay. Goes away if you remove the
- MALLOC_PETURB_ - in glib it's added by the build system/toolchain
- somewhere.
+ MALLOC_PERTURB_ - in glib it's explicitly when running the testsuite.
  
  laney at utopic> echo "void main() {}" > a.c
  laney at utopic> gcc -c a.c -o a.o
  laney at utopic> env -i MALLOC_PERTURB_=53 /usr/bin/ld -o foo /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o -L/usr/lib/gcc/x86_64-linux-gnu/4.8 a.o -lgcc -lc
  [1]    10183 segmentation fault (core dumped)  env -i MALLOC_PERTURB_=53 /usr/bin/ld -o foo /usr/lib/x86_64-linux-gnu/crt1.o
  (gdb) bt full
  #0  bfd_hash_table_free (table=0x3535353535353535) at ../../bfd/hash.c:425
  No locals.
  #1  0x00007ffff7b08049 in _bfd_merge_sections_free (xsinfo=<optimized out>) at ../../bfd/merge.c:897
-         sinfo = 0x8d57b0
+         sinfo = 0x8d57b0
  #2  0x00007ffff7b357b1 in _bfd_elf_link_hash_table_free (hash=0x71ade0) at ../../bfd/elflink.c:6916
-         htab = 0x71ade0
+         htab = 0x71ade0
  #3  0x000000000044853a in xatexit_cleanup () at ../../libiberty/xatexit.c:98
-         p = 0x702e00 <xatexit_first>
-         n = 0
+         p = 0x702e00 <xatexit_first>
+         n = 0
  #4  0x00007ffff7b8d109 in xexit (code=code at entry=0) at ../../libiberty/xexit.c:50
  No locals.
  #5  0x00000000004058cc in main (argc=9, argv=0x7fffffffed98) at ../../ld/ldmain.c:534
-         emulation = 0x45bd3b "elf_x86_64"
-         start_time = 18059
-         start_sbrk = 0x704000 ""
+         emulation = 0x45bd3b "elf_x86_64"
+         start_time = 18059
+         start_sbrk = 0x704000 ""
  (gdb)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to binutils in Ubuntu.
https://bugs.launchpad.net/bugs/1330451

Title:
  ld crashes with SIGSEGV in bfd_hash_table_free when linking with
  MALLOC_PERTURB_ set

Status in “binutils” package in Ubuntu:
  New

Bug description:
  I saw this when building glib on Debian & then noticed that it also
  happens in utopic. Trusty is okay. Goes away if you remove the
  MALLOC_PERTURB_ - in glib it's explicitly when running the testsuite.

  laney at utopic> echo "void main() {}" > a.c
  laney at utopic> gcc -c a.c -o a.o
  laney at utopic> env -i MALLOC_PERTURB_=53 /usr/bin/ld -o foo /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o -L/usr/lib/gcc/x86_64-linux-gnu/4.8 a.o -lgcc -lc
  [1]    10183 segmentation fault (core dumped)  env -i MALLOC_PERTURB_=53 /usr/bin/ld -o foo /usr/lib/x86_64-linux-gnu/crt1.o
  (gdb) bt full
  #0  bfd_hash_table_free (table=0x3535353535353535) at ../../bfd/hash.c:425
  No locals.
  #1  0x00007ffff7b08049 in _bfd_merge_sections_free (xsinfo=<optimized out>) at ../../bfd/merge.c:897
          sinfo = 0x8d57b0
  #2  0x00007ffff7b357b1 in _bfd_elf_link_hash_table_free (hash=0x71ade0) at ../../bfd/elflink.c:6916
          htab = 0x71ade0
  #3  0x000000000044853a in xatexit_cleanup () at ../../libiberty/xatexit.c:98
          p = 0x702e00 <xatexit_first>
          n = 0
  #4  0x00007ffff7b8d109 in xexit (code=code at entry=0) at ../../libiberty/xexit.c:50
  No locals.
  #5  0x00000000004058cc in main (argc=9, argv=0x7fffffffed98) at ../../ld/ldmain.c:534
          emulation = 0x45bd3b "elf_x86_64"
          start_time = 18059
          start_sbrk = 0x704000 ""
  (gdb)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/binutils/+bug/1330451/+subscriptions



More information about the foundations-bugs mailing list