Author: aurel32 Date: 2010-06-24 17:41:11 +0000 (Thu, 24 Jun 2010) New Revision: 4356
Added: glibc-package/trunk/debian/patches/hppa/cvs-vfork.diff Modified: glibc-package/trunk/debian/changelog glibc-package/trunk/debian/patches/series Log: * Add patches/hppa/cvs-vfork.diff to fix stack frame creating during vfork in multithreaded environments. Modified: glibc-package/trunk/debian/changelog =================================================================== --- glibc-package/trunk/debian/changelog 2010-06-17 13:01:32 UTC (rev 4355) +++ glibc-package/trunk/debian/changelog 2010-06-24 17:41:11 UTC (rev 4356) @@ -14,8 +14,12 @@ * patches/hurd-i386/local-pthread_posix-option.diff: Avoid letting glibc try to install its own headers for libpthread. - -- Aurelien Jarno <aure...@debian.org> Tue, 15 Jun 2010 11:21:54 +0200 + [ Carlos O'Donell] + * Add patches/hppa/cvs-vfork.diff to fix stack frame creating during + vfork in multithreaded environments. + -- Aurelien Jarno <aure...@debian.org> Thu, 24 Jun 2010 19:40:20 +0200 + eglibc (2.11.2-1) unstable; urgency=low * New upstream stable release: Added: glibc-package/trunk/debian/patches/hppa/cvs-vfork.diff =================================================================== --- glibc-package/trunk/debian/patches/hppa/cvs-vfork.diff (rev 0) +++ glibc-package/trunk/debian/patches/hppa/cvs-vfork.diff 2010-06-24 17:41:11 UTC (rev 4356) @@ -0,0 +1,55 @@ +2010-06-24 Carlos O'Donell <car...@codesourcery.com> + + * sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S: Only create stack + frame around call to SYSCALL_ERROR_HANDLER. Do not restore %rp + from the stack frame on successfull return. + +diff --git a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S +index 83a70b7..15efa98 100644 +--- a/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S ++++ b/ports/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2005 Free Software Foundation, Inc. ++/* Copyright (C) 2005, 2010 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or +@@ -50,10 +50,9 @@ + + /* r26, r25, r24, r23 are free since vfork has no arguments */ + ENTRY(__vfork) +- /* Prologue */ +- stwm %r3, 64(%sp) +- stw %sp, -4(%sp) +- stw %r19, -32(%sp) ++ /* We must not create a frame. When the child unwinds to call ++ exec it will clobber the same frame that the parent ++ needs to unwind. */ + + /* Save the PIC register. */ + #ifdef PIC +@@ -75,12 +74,20 @@ ENTRY(__vfork) + comclr,>>= %r1,%ret0,%r0 /* Note: unsigned compare. */ + b,n .Lerror + +- /* Return, no need to restore the PIC register. */ +- ldw -84(%sp), %rp +- bv %r0(%rp) +- ldwm -64(%sp), %r3 ++ /* Return, and DO NOT restore rp. The child may have called ++ functions that updated the frame's rp. This works because ++ the kernel ensures rp is preserved across the vfork ++ syscall. */ ++ bv,n %r0(%rp) + + .Lerror: ++ /* Now we need a stack to call a function. We are assured ++ that there is no child now, so it's safe to create ++ a frame. */ ++ stw %rp, -20(%sp) ++ stwm %r3, 64(%sp) ++ stw %sp, -4(%sp) ++ + sub %r0,%ret0,%r3 + SYSCALL_ERROR_HANDLER + /* Restore the PIC register (in delay slot) on error */ Modified: glibc-package/trunk/debian/patches/series =================================================================== --- glibc-package/trunk/debian/patches/series 2010-06-17 13:01:32 UTC (rev 4355) +++ glibc-package/trunk/debian/patches/series 2010-06-24 17:41:11 UTC (rev 4356) @@ -82,6 +82,7 @@ hppa/local-dlfptr.diff hppa/local-longjmp-chk.diff hppa/local-lowlevellock.diff +hppa/cvs-vfork.diff hurd-i386/local-dl-dynamic-weak.diff hurd-i386/local-enable-ldconfig.diff -- To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1orqqw-0006ie...@alioth.debian.org