From owner-freebsd-arch@FreeBSD.ORG Wed May 7 01:15:27 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2831C37B404; Wed, 7 May 2003 01:15:27 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7052643F85; Wed, 7 May 2003 01:15:25 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h478FOmF099453; Wed, 7 May 2003 12:15:24 +0400 (MSD) Date: Wed, 7 May 2003 12:15:24 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: John Baldwin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: peter@FreeBSD.org cc: freebsd-arch@FreeBSD.org Subject: Re: rfork(RFPROC|RFMEM) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 May 2003 08:15:27 -0000 On Tue, 6 May 2003, John Baldwin wrote: > On 06-May-2003 Igor Sysoev wrote: > > On Mon, 5 May 2003, Terry Lambert wrote: > > > >> Igor Sysoev wrote: > >> > I use rfork_thread(3) wrapper that allows to setup another stack for > >> > rfork()ed process. > > > > By the way I found the bug in x86 rfork_thread(3)'s error handling: > > > > --- /usr/src/lib/libc/i386/gen/rfork_thread.S Wed Feb 7 03:12:45 2001 > > +++ /usr/src/lib/libc/i386/gen/rfork_thread.S Tue May 6 17:45:14 2003 > > @@ -108,5 +108,8 @@ > > * Branch here if the thread creation fails: > > */ > > 2: > > + popl %esi > > + movl %ebp, %esp > > + popl %ebp > > PIC_PROLOGUE > > jmp PIC_PLT(HIDENAME(cerror)) > > Shouldn't this be: > > 2: > + addl $8, %esp > + popl %esi > + movl %ebp, %esp > + popl %ebp > PIC_PROLOGUE > jmp PIC_PLT(HIDENAME(cerror)) > > To match the parent return case above the 1: label? Yes, you are right. My patch does not restore %esi but set it to 0. It seems that my code that I used to test the patch does not depend on %esi in an error case. Igor Sysoev http://sysoev.ru/en/