Date: Wed, 7 May 2003 12:15:24 +0400 (MSD) From: Igor Sysoev <is@rambler-co.ru> To: John Baldwin <jhb@FreeBSD.org> Cc: freebsd-arch@FreeBSD.org Subject: Re: rfork(RFPROC|RFMEM) Message-ID: <Pine.BSF.4.21.0305071201390.68981-100000@is> In-Reply-To: <XFMail.20030506161215.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0305071201390.68981-100000>