Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Aug 2011 13:08:25 +0400
From:      Test Rat <ttsestt@gmail.com>
To:        freebsd-toolchain@freebsd.org
Subject:   [clang] rtld-elf/rtld.c and stack traces in gdb(1)
Message-ID:  <86fwkvt9me.fsf@gmail.com>

next in thread | raw e-mail | index | archive | help
I often get corrupted traces with clang world, the cause seems to be in rtld.

  $ cd /usr/src/libexec/rtld-elf; env -i __MAKE_CONF=/dev/null TERM=$TERM sh
  $ make CC=gcc all install

  $ gdb yes
  [...]
  y
  y
  ^C
  Program received signal SIGINT, Interrupt.
  0x00000008009455ac in write () from /lib/libc.so.7
  (gdb) bt
  #0  0x00000008009455ac in write () from /lib/libc.so.7
  #1  0x0000000800944fa7 in _swrite (fp=<value optimized out>, buf=<value optimized out>, n=<value optimized out>)
      at /usr/src/lib/libc/stdio/stdio.c:133
  #2  0x0000000800944c7b in __fflush (fp=<value optimized out>) at /usr/src/lib/libc/stdio/fflush.c:123
  #3  0x000000080094412d in __sfvwrite (fp=<value optimized out>, uio=<value optimized out>)
      at /usr/src/lib/libc/stdio/fvwrite.c:194
  #4  0x000000080091c434 in puts (s=<value optimized out>) at /usr/src/lib/libc/stdio/puts.c:68
  #5  0x00000000004005fa in main (argc=<value optimized out>, argv=find_location_expression: Corrupted DWARF expression.
  ) at /usr/src/usr.bin/yes/yes.c:54

  $ touch rtld.c
  $ PATH=/usr/bin:$PATH make CC=clang all install

  $ gdb yes
  [...]
  y
  y
  ^C
  Program received signal SIGINT, Interrupt.
  0x00000008009455ac in ?? ()
  (gdb) bt
  #0  0x00000008009455ac in ?? ()
  #1  0x0000000800944fa7 in ?? ()
  #2  0x0000000000000002 in ?? ()
  #3  0x000000080094d560 in ?? ()
  #4  0x0000000800b73560 in ?? ()
  #5  0x0000000800c08000 in ?? ()
  #6  0x00007fffffffd160 in ?? ()
  #7  0x0000000800944c7b in ?? ()
  #8  0x0000000000000001 in ?? ()
  #9  0x0000000000000001 in ?? ()
  #10 0x0000000000000001 in ?? ()
  #11 0x0000000800b73560 in ?? ()
  #12 0x00007fffffffd1c0 in ?? ()
  #13 0x000000080094412d in ?? ()
  #14 0x00007fffffffc648 in ?? ()
  #15 0x0000000000000001 in ?? ()
  #16 0x0000000100400656 in ?? ()
  #17 0x00007fffffffd1f8 in ?? ()
  #18 0x00007fffffffd1f8 in ?? ()
  #19 0x0000000000400656 in _fini ()
  #20 0x00007fffffffd280 in ?? ()
  #21 0x0000000000000000 in ?? ()

And compiling rtld with clang + -O0 makes it crash.

--
FreeBSD 9.0-BETA1 r225055M amd64



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86fwkvt9me.fsf>