From owner-freebsd-emulation@FreeBSD.ORG Mon Sep 15 20:44:05 2008 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807B5106566B for ; Mon, 15 Sep 2008 20:44:05 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 02D8F8FC08 for ; Mon, 15 Sep 2008 20:44:04 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 9667565C2DA; Mon, 15 Sep 2008 22:44:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id syTFxR4Fu3bN; Mon, 15 Sep 2008 22:44:01 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 0077F65C2BA; Mon, 15 Sep 2008 22:44:00 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m8FKi0If092095; Mon, 15 Sep 2008 22:44:00 +0200 (CEST) (envelope-from rdivacky) Date: Mon, 15 Sep 2008 22:44:00 +0200 From: Roman Divacky To: Jose Garcia Juanino , freebsd-emulation@freebsd.org Message-ID: <20080915204400.GA92022@freebsd.org> References: <20080912205202.GA83925@sanabria> <20080913070920.GA1440@dchagin.dialup.corbina.ru> <20080913084412.GA1263@sanabria> <20080913085108.GA2308@dchagin.dialup.corbina.ru> <20080913205515.GA6158@sanabria> <20080914090856.GA51307@freebsd.org> <20080914092519.GA3121@dchagin.dialup.corbina.ru> <20080914184933.GB86425@freebsd.org> <20080915154811.GA3696@dchagin.dialup.corbina.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080915154811.GA3696@dchagin.dialup.corbina.ru> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: sqlplus segfaults when receiving INT signal X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 20:44:05 -0000 On Mon, Sep 15, 2008 at 07:48:11PM +0400, Chagin Dmitry wrote: > On Sun, Sep 14, 2008 at 08:49:33PM +0200, Roman Divacky wrote: > > On Sun, Sep 14, 2008 at 01:25:19PM +0400, Chagin Dmitry wrote: > > > > > > > > please provide ktrace/linux_kdump... the "unknown futex operation" problem is fixed > > > > in this release so there must be something else > > > > > > 1428 sqlplus 0.874520 CALL munmap(0x28066000,0xc41d) > > > 1428 sqlplus 0.874543 RET munmap 0 > > > 1428 sqlplus 0.874553 CALL linux_set_tid_address(0x292cf708) > > > 1428 sqlplus 0.874563 RET linux_set_tid_address 1428/0x594 > > > 1428 sqlplus 0.874572 CALL linux_set_robust_list(0x292cf710,0xc) > > > 1428 sqlplus 0.874580 RET linux_set_robust_list -1 errno 22 (EINVAL) Invali > > > d argument > > > 1428 sqlplus 0.874596 CALL linux_sys_futex(0xffffdbc4,FUTEX_WAKE|FUTEX_PRIVA > > > TE_FLAG,0x1,0x292cf6c0,0x29154ff4,0xffffdbd8) > > > 1428 sqlplus 0.874608 RET linux_sys_futex 1 > > > 1428 sqlplus 0.874641 CALL linux_rt_sigaction(SIG 32,0xffffd87c,0,0x8) > > > 1428 sqlplus 0.874651 RET linux_rt_sigaction 0 > > > > the robust futexes are also implemented in -CURRENT but I dont feel like > > MFcing them.... the error is also harmless > > it amd64, so, set_robust_list() here does not work. look at a patch bellow, > I show it for example only because I don't understand how futexes work :) > > > diff --git a/src/sys/compat/linux/linux_futex.c b/src/sys/compat/linux/linux_futex.c > index 6588d23..73cf3a7 100644 > --- a/src/sys/compat/linux/linux_futex.c > +++ b/src/sys/compat/linux/linux_futex.c > @@ -551,7 +551,7 @@ linux_set_robust_list(struct thread *td, struct linux_set_robust_list_args *args > return (EINVAL); > > em = em_find(td->td_proc, EMUL_DOLOCK); > - em->robust_futexes = args->head; > + em->robust_futexes = PTRIN(args->head); > EMUL_UNLOCK(&emul_lock); > > return (0); > @@ -661,17 +661,17 @@ release_futexes(struct proc *p) > if (head == NULL) > return; > > - if (fetch_robust_entry(&entry, &head->list.next, &pi)) > + if (fetch_robust_entry(&entry, PTRIN(&head->list.next), &pi)) > return; > > if (copyin(&head->futex_offset, &futex_offset, sizeof(l_ulong))) > return; > > - if (fetch_robust_entry(&pending, &head->pending_list, &pip)) > + if (fetch_robust_entry(&pending, PTRIN(&head->pending_list), &pip)) > return; > > while (entry != &head->list) { > - rc = fetch_robust_entry(&next_entry, &entry->next, &next_pi); > + rc = fetch_robust_entry(&next_entry, PTRIN(&entry->next), &next_pi); > > if (entry != pending) > if (handle_futex_death((char *)entry + futex_offset, > diff --git a/src/sys/compat/linux/linux_futex.h b/src/sys/compat/linux/linux_futex.h > index f6a2d4b..67b5115 100644 > --- a/src/sys/compat/linux/linux_futex.h > +++ b/src/sys/compat/linux/linux_futex.h > @@ -66,14 +66,22 @@ > /* This is defined by Linux user-space */ > > struct linux_robust_list { > - struct linux_robust_list *next; > -}; > + l_uintptr_t next; > +} > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > +__packed > +#endif > +; > > struct linux_robust_list_head { > struct linux_robust_list list; > l_ulong futex_offset; > - struct linux_robust_list *pending_list; > -}; > + l_uintptr_t pending_list; > +} > +#if defined(__amd64__) && defined(COMPAT_LINUX32) > +__packed > +#endif > +; > > #define FUTEX_WAITERS 0x80000000 > #define FUTEX_OWNER_DIED 0x40000000 this looks about right... I'll ask kostik to commit this, dmitry, you should have commit bit :)