From patchwork Tue Jun 22 15:39:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos O'Donell X-Patchwork-Id: 107421 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5MFdYbb027514 for ; Tue, 22 Jun 2010 15:39:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753742Ab0FVPjd (ORCPT ); Tue, 22 Jun 2010 11:39:33 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:49230 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751052Ab0FVPjd (ORCPT ); Tue, 22 Jun 2010 11:39:33 -0400 Received: by wyb33 with SMTP id 33so3272199wyb.19 for ; Tue, 22 Jun 2010 08:39:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=orKaLGo9Qc++WWxcKcVodchybqm3sRSVN8ZWRRTZCjc=; b=AuCtfGBoXpmNwQaBz9uZuf+6+4XTJegDZ5hsbV2ZFUBqfCRT03A1ahkgyjPSoXSl+A LBEQRIrG3hXaIQ42wvb2Y94p05vnc1NGCM9mdrpRqXudTc90xkcatl4oURgaHaterNZ8 voZmXEDfV/5Pcml4jJwfCopaJFXr1rBuIz/to= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=q/saKECWjPHr00ps3XDSNpewV5V8i+dTO+uBOTodtI0Vmgt5XlO+GSqrlZHhRu8Qq6 tWeFxJt7mDeakcH0VTnNSXaRlSudZLgiZxG/TjvcQQJR15z6PxJ8pirCk8s8IxTmsWwQ PPezzecpVPZT4uGYks8QotNRF8zcQgXIyF/uk= MIME-Version: 1.0 Received: by 10.227.136.75 with SMTP id q11mr6202323wbt.26.1277221172154; Tue, 22 Jun 2010 08:39:32 -0700 (PDT) Received: by 10.216.22.149 with HTTP; Tue, 22 Jun 2010 08:39:31 -0700 (PDT) In-Reply-To: References: <119aab440912061319y5b863203ve5dc3dc568a6ccec@mail.gmail.com> <20100620042814.ECC205160@hiauly1.hia.nrc.ca> Date: Tue, 22 Jun 2010 11:39:31 -0400 X-Google-Sender-Auth: Qw4MaXRL3DulKqOBLilS3TODsXs Message-ID: Subject: Re: vfork test case. From: "Carlos O'Donell" To: John David Anglin Cc: dave.anglin@nrc-cnrc.gc.ca, linux-parisc@vger.kernel.org, kyle@mcmartin.ca, James.Bottomley@hansenpartnership.com Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 22 Jun 2010 15:39:35 +0000 (UTC) diff --git a/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S b/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S index 83a70b7..3c685cb 100644 --- a/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S +++ b/sysdeps/unix/sysv/linux/hppa/nptl/pt-vfork.S @@ -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, otherwise 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 @@ -76,11 +75,16 @@ ENTRY(__vfork) b,n .Lerror /* Return, no need to restore the PIC register. */ - ldw -84(%sp), %rp - bv %r0(%rp) - ldwm -64(%sp), %r3 + ldw -20(%sp), %rp + bv,n %r0(%rp) .Lerror: + /* Now we need a stack to record the error. We are assured + that there is no child now, so it's safe to create + a frame. */ + stwm %r3, 64(%sp) + stw %sp, -4(%sp) + sub %r0,%ret0,%r3 SYSCALL_ERROR_HANDLER /* Restore the PIC register (in delay slot) on error */