lucid gold makes nearly all C++ applications segfault before main()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
binutils (Debian) |
Fix Released
|
Unknown
|
|||
binutils (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: binutils
Trying to build MySQL 5.1.46 with binutils-gold installed leads to 'gen_lex_hash' (in the mysql tree, that is run during build) to segfault.
Logs below for building Drizzle (and trying to use the resulting executable). It also segfaults.
Both of these worked fine in karmic.
removing binutils-gold at least fixes a MySQL build.
stewart@
Segmentation fault
stewart@
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://
Reading symbols from /home/stewart/
(gdb) r
Starting program: /home/stewart/
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x0000000000a6ef40 in strlen ()
(gdb) bt
#0 0x0000000000a6ef40 in strlen ()
#1 0x00007ffff7deb89f in _dl_fixup (l=0x52feb7,
reloc_
#2 0x00007ffff7df2445 in _dl_runtime_resolve ()
at ../sysdeps/
#3 0x00007ffff711ba40 in std::basic_
from /usr/lib/
#4 0x00007ffff7fc4d6b in MakeTypeNameTable ()
at google/
#5 __static_
at google/
#6 global constructors keyed to parser.cc ()
at google/
#7 0x00007ffff7fca546 in __do_global_
from /usr/local/
#8 0x00007ffff7fca56b in _init () from /usr/local/
#9 0x00007ffff7e05000 in ?? ()
#10 0x00007ffff7debd35 in call_init (main_map=
argv=
#11 _dl_init (main_map=
env=
#12 0x00007ffff7dddb2a in _dl_start_user () from /lib64/
warning: (Internal error: pc 0x1 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
#13 0x0000000000000001 in ?? (warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
) at ./drizzled/
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
#14 0x00007fffffffe50f in ?? ()
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)
#15 0x0000000000000000 in ?? ()
(gdb) q
A debugging session is active.
Inferior 1 [process 31410] will be killed.
Quit anyway? (y or n) y
stewart@
linux-vdso.so.1 => (0x00007fff281a
libprotobuf.so.6 => /usr/local/
libdrizzledmes
libuuid.so.1 => /lib/libuuid.so.1 (0x00007f3a46a6
libdl.so.2 => /lib/libdl.so.2 (0x00007f3a4686
libz.so.1 => /lib/libz.so.1 (0x00007f3a4664
libpcre.so.3 => /lib/libpcre.so.3 (0x00007f3a4642
librt.so.1 => /lib/librt.so.1 (0x00007f3a4621
libstdc++.so.6 => /usr/lib/
libm.so.6 => /lib/libm.so.6 (0x00007f3a45c8
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f3a45a6
libpthread.so.0 => /lib/libpthread
libc.so.6 => /lib/libc.so.6 (0x00007f3a454c
/lib64/
stewart@
Related branches
Changed in binutils (Debian): | |
status: | Unknown → Confirmed |
Changed in binutils (Debian): | |
status: | Confirmed → Fix Released |
tags: |
added: verification-done removed: verification-needed |
It is worse for me. Absolutely no applications, be they C++ or C, are linked properly. Consider this small example:
#include <stdio.h>
#include <string.h>
__attribute_ _((noinline) )
int f(const char *a, const char *b) { return strcmp(a, b); }
int main() { printf("%x\n", f("foo", "bar")); }
If you compile it dynamically, you get a segfault due to strcmp being placed in a non-executable page.
If you compile it statically, you get the address of function _libc_start instead of executing strcmp.
Same thing happens with strlen et al, which explains that all applications a bit complicated will segfault before even reaching main (due to dynamic loading relying on strlen).
This is on Lucid Lynx with binutils 2.20.1-3ubuntu5 on amd64. It was working fine on Karmic.