public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug dynamic-link/14370] SIGFPE in 'ldd -r'
Date: Sun, 02 Sep 2012 20:00:00 -0000	[thread overview]
Message-ID: <bug-14370-131-rc8rv87y5c@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14370-131@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=14370

--- Comment #8 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-02 20:00:15 UTC ---
(In reply to comment #0)
> Created attachment 6536 [details]
> testcase
> 
> $ ldd -r SceMiDpiBridge.so
>         linux-gate.so.1 (0xf76eb000)
>         libsds_server.so => not found
>         libxtor_threads_boost.so => not found
>         libaldecpli.so => not found
>         libsvdpi_exp.so => not found
>         libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xf755e000)
>         libsce_mi.so => not found
>         libScemiDpiBridgeApi.so => not found
>         libm.so.6 => /lib/libm.so.6 (0xf7520000)
>         libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7505000)
>         librt.so.1 => /lib/librt.so.1 (0xf74fb000)
>         libc.so.6 => /lib/libc.so.6 (0xf735b000)
>         /lib/ld-linux.so.2 (0xf76ec000)
>         libpthread.so.0 => /lib/libpthread.so.0 (0xf7340000)
> Floating point exception

This DSO is bad in several ways:

[hjl@gnu-6 pr14370]$ readelf -d pr14370.so 

Dynamic section at offset 0x953e0 contains 29 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libsds_server.so]
 0x00000001 (NEEDED)                     Shared library:
[libxtor_threads_boost.so]
 0x00000001 (NEEDED)                     Shared library: [libaldecpli.so]
 0x00000001 (NEEDED)                     Shared library: [libsvdpi_exp.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libsce_mi.so]
 0x00000001 (NEEDED)                     Shared library:
[libScemiDpiBridgeApi.so]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x0000000c (INIT)                       0x1de28
 0x0000000d (FINI)                       0x794d4
 0x00000004 (HASH)                       0xd4
 0x00000005 (STRTAB)                     0x6558
 0x00000006 (SYMTAB)                     0x21d8
 0x0000000a (STRSZ)                      15815 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x955c0
 0x00000002 (PLTRELSZ)                   856 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x1dad0
 0x00000011 (REL)                        0xabf0
 0x00000012 (RELSZ)                      77536 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x00000016 (TEXTREL)                    0x0
 0x6ffffffe (VERNEED)                    0xab90
 0x6fffffff (VERNEEDNUM)                 2
 0x6ffffff0 (VERSYM)                     0xa320
 0x6ffffffa (RELCOUNT)                   3970
 0x00000000 (NULL)                       0x0
[hjl@gnu-6 pr14370]$ readelf -sWr pr14370.so | grep errno | tail -5
00078dcc  0003a502 R_386_PC32             00033110   __errno_location
00033120  0000ad01 R_386_32               00097254   errno
   173: 00097254     4 OBJECT  GLOBAL DEFAULT   27 errno
   933: 00033110    37 FUNC    WEAK   DEFAULT   10 __errno_location
   959: 00097254     4 OBJECT  GLOBAL DEFAULT   27 _errno
[hjl@gnu-6 pr14370]$ 

1. It wasn't compiled with -fPIC.
2. It wasn't linked against libc.so.
3. It defines errno as int.

A testcase:

[hjl@gnu-6 pr14370]$ cat x.c 
int errno = 3;

extern void foo (void);

int
bar (void)
{
  foo ();
  return errno;
}
[hjl@gnu-6 pr14370]$ cat foo.c
void
foo (void)
{
}
[hjl@gnu-6 pr14370]$  gcc -m32 -shared -o libm.so.6 foo.c -fPIC
[hjl@gnu-6 pr14370]$ gcc -m32 x.c -c       
[hjl@gnu-6 pr14370]$ ld -m elf_i386  -shared x.o libm.so.6   
[hjl@gnu-6 pr14370]$ ldd -r a.out  
    linux-gate.so.1 =>  (0xf7ffd000)
    libm.so.6 => /lib/libm.so.6 (0xf7fad000)
    /lib/ld-linux.so.2 (0x56555000)
    libc.so.6 => /lib/libc.so.6 (0xf7dfb000)
/usr/local/bin/ldd: line 118: 17528 Floating point
exceptionLD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes LD_BIND_NOW=yes
LD_LIBRARY_VERSION=$verify_out LD_VERBOSE= "$@"
[hjl@gnu-6 pr14370]$

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2012-09-02 20:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 10:05 [Bug dynamic-link/14370] New: " pluto at agmk dot net
2012-07-18 10:11 ` [Bug dynamic-link/14370] " aj at suse dot de
2012-07-18 10:49 ` pluto at agmk dot net
2012-07-18 10:54 ` jakub at redhat dot com
2012-07-18 11:00 ` pluto at agmk dot net
2012-07-18 12:37 ` pluto at agmk dot net
2012-07-24  2:04 ` carlos_odonell at mentor dot com
2012-07-24  6:14 ` pluto at agmk dot net
2012-09-02 20:00 ` hjl.tools at gmail dot com [this message]
2012-09-02 22:57 ` hjl.tools at gmail dot com
2012-09-03  2:54 ` bugdal at aerifal dot cx
2012-09-03 13:39 ` carlos_odonell at mentor dot com
2012-09-03 15:29 ` pluto at agmk dot net
2012-09-03 18:59 ` hjl.tools at gmail dot com
2012-09-03 20:07 ` aj at suse dot de
2012-09-04 19:09 ` [Bug dynamic-link/14370] ld.so crashes on mismatched TLS/non-TLS symbols hjl.tools at gmail dot com
2012-09-04 19:41 ` carlos_odonell at mentor dot com
2012-09-04 21:32 ` hjl.tools at gmail dot com
2012-09-04 22:03 ` carlos_odonell at mentor dot com
2012-09-04 22:15 ` bugdal at aerifal dot cx
2012-09-04 22:22 ` hjl.tools at gmail dot com
2012-09-04 23:26 ` bugdal at aerifal dot cx
2012-09-05 15:24 ` ppluzhnikov at google dot com
2012-09-05 15:30 ` hjl.tools at gmail dot com
2012-12-04  0:00 ` carlos at systemhalted dot org
2013-10-02 22:44 ` neleai at seznam dot cz
2014-06-17 18:59 ` fweimer at redhat dot com
2023-07-30 16:53 ` sam at gentoo dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-14370-131-rc8rv87y5c@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).