Bug 491542 - Undo Fedora-specific clone() cfi_undefined(pc) removal
Undo Fedora-specific clone() cfi_undefined(pc) removal
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
11
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Andreas Schwab
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 516995
  Show dependency treegraph
 
Reported: 2009-03-22 16:34 EDT by Jan Kratochvil
Modified: 2009-11-30 10:31 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-11-30 10:31:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Kratochvil 2009-03-22 16:34:13 EDT
Description of problem:
On F11 GDB started to backtrace past clone() thread_start.
This was workarounded in GDB by code matching pattern which changed with gcc44.
The workaround in GDB could be dropped as the upstream DWARF based patch now works in F11 and its Fedora specific removal can be stopped.
Originally it was incompatible with libgcc unwinder (although I did not find the specific patch which did fix it).

Version-Release number of selected component (if applicable):
glibc-2.9.90-11.{x86_64,i?86}
gdb-6.8.50.20090302-10.fc11.x86_64

How reproducible:
Always.

Steps to Reproduce:
$ gdb -q ./threadit
(gdb) b start
Breakpoint 1 at 0x400628: file threadit.c, line 31.
(gdb) r
[...]
(gdb) bt
  
Actual results:
#0  start (arg=0x0) at threadit.c:31
#1  0x00000000009a087a in start_thread () from /lib64/libpthread.so.0
#2  0x00007ffff7d5b4cd in clone () from /lib64/libc.so.6
#3  0x0000000000000000 in ?? ()
(gdb) 

Expected results:
#0  start (arg=0x0) at threadit.c:31
#1  0x00000000009a087a in start_thread () from /lib64/libpthread.so.0
#2  0x00007ffff7d5b4cd in clone () from /lib64/libc.so.6
(gdb) 

Additional info:
The removal is by:
* Thu Dec 14 2006 Jakub Jelinek <jakub@redhat.com> 2.5.90-13
- revert i?86/x86_64 clone CFI temporarily
glibc-fedora.patch
+++ glibc-20090320T1944-fedora/sysdeps/unix/sysv/linux/i386/clone.S     14 Dec 2006 09:06:34 -0000      1.22.2.6
+++ glibc-20090320T1944-fedora/sysdeps/unix/sysv/linux/x86_64/clone.S   14 Dec 2006 09:06:34 -0000      1.4.2.4

It was discussed at:
http://sourceware.org/ml/libc-alpha/2006-11/msg00082.html
http://sourceware.org/ml/libc-alpha/2006-12/threads.html#00008

GDB regression on: gdb.threads/bt-clone-stop.exp

glibc scratch build test:
http://koji.fedoraproject.org/scratch/jkratoch/task_1253117/
With no regressions for: grep -i 'make:.*error' *.log

It breaks upstream libunwind for its testcase:
{G,L}test-concurrent
But Fedora libunwind has no (maybe one minor) regressions probably due to its:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/frysk-imports/libunwind/src/dwarf/Gparser.c.diff?r1=1.3&r2=1.4&cvsroot=frysk
libunwind.non-ia64 is currently used only by Frysk now.

Tested that the testcase:
------------------------------------------------------------------------------
#include <pthread.h>
#include <execinfo.h>
#include <stdio.h>
#include <unistd.h>
void *
tf (void *arg)
{
  void *buf[512];
  int i = backtrace (buf, 512);
  printf ("%d\n", i);
  backtrace_symbols_fd (buf, i, STDOUT_FILENO);
  return NULL;
}
int
main (void)
{
  pthread_t th;
  pthread_create (&th, NULL, tf, NULL);
  pthread_join (th, NULL);
  return 0;
}
------------------------------------------------------------------------------
unwinds fine on x86_64+i686:
3
./clone-testcase[0x400692]
/lib64/libpthread.so.0[0x11687a]
/lib64/libc.so.6(clone+0x6d)[0x6e04cd]

and that it really loops with the glibc scratch build o RHEL-5.2:
512
./clone-testcase[0x40065b]
.../glibc-2.9.90-11cfiundef.x86_64/lib64/libpthread.so.0[0x2b1babcc887a]
.../glibc-2.9.90-11cfiundef.x86_64/lib64/libc.so.6(clone+0x6d)[0x2b1babfbd4cd]
.../glibc-2.9.90-11cfiundef.x86_64/lib64/libc.so.6(clone+0x6d)[0x2b1babfbd4cd]
.../glibc-2.9.90-11cfiundef.x86_64/lib64/libc.so.6(clone+0x6d)[0x2b1babfbd4cd]
[...]
.../glibc-2.9.90-11cfiundef.x86_64/lib64/libc.so.6(clone+0x6d)[0x2b1babfbd4cd]
<stop>

If the patch removal stays in glibc sure I can update the workaround in GDB.
Comment 1 Jakub Jelinek 2009-03-24 06:44:35 EDT
To my knowledge GCC unwinder still treats DW_CFA_undefined exactly the same
as DW_CFA_same_value, so this really can't be removed, it breaks a lot of stuff.

I guess I should revive the
http://gcc.gnu.org/ml/gcc/2006-12/msg00312.html
patch, but I'll need support for that from Roland/you/drow.
Comment 2 Bug Zapper 2009-06-09 08:30:05 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 3 Ulrich Drepper 2009-11-22 19:42:49 EST
What is the status of this?
Comment 4 Jakub Jelinek 2009-11-23 05:21:31 EST
The GCC change is now in upstream GCC 4.4.0+ (and of course Fedora GCC 4.4-RH too), so in theory this could be reverted even on the glibc side.
Comment 5 Andreas Schwab 2009-11-30 10:31:10 EST
Fixed in rawhide.

Note You need to log in before you can comment on or make changes to this bug.