[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#589755: Segfaults/FPEs using -lc_p



Package: libc6-prof
Version: 2.17-92+b1
Followup-For: Bug #589755

The bug is still present as of 2.17-92+b1. It is actually possible to
trigger it even using a minimal source program:

int main() {
  return 0;
}

Compiling following the instructions in README.Debian fails:

$ gcc -g -pg main.cc -static-libstdc++ -lc_p
/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality
in
`/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libc_p.a(strcmp.op)'
can not be used when making an executable; recompile with -fPIE and
relink with -pie
collect2: error: ld returned 1 exit status

Adding `-static -Wl,--no-export-dynamic' to the command line fixes this:

$ gcc -g -pg main.cc -static -Wl,--no-export-dynamic -static-li
bstdc++ -lc_p

However:

$ gdb ./a.out
GNU gdb (GDB) 7.6 (Debian 7.6-5)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
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://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dmancusi/src/foo/a.out...done.
(gdb) r
Starting program: /home/dmancusi/src/foo/a.out
warning: no loadable sections found in added symbol-file system-supplied
DSO at 0x7ffff7ffd000

Program received signal SIGSEGV, Segmentation fault.
0x000000000044be3b in __mcount_internal ()
(gdb) bt
#0  0x000000000044be3b in __mcount_internal ()
#1  0x00000000004104e4 in mcount ()
#2  0x0000000000000000 in ?? ()

I can provide more information if needed.

Cheers,
Davide

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'oldstable-updates'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6-prof depends on:
ii  libc6  2.17-92+b1

libc6-prof recommends no packages.

libc6-prof suggests no packages.

-- no debconf information


Reply to: