From owner-freebsd-emulation@FreeBSD.ORG Wed Sep 17 05:17:01 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 96B89106564A; Wed, 17 Sep 2008 05:17:01 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from contrabass.post.ru (contrabass.post.ru [85.21.78.5]) by mx1.freebsd.org (Postfix) with ESMTP id 40CA98FC19; Wed, 17 Sep 2008 05:17:00 +0000 (UTC) (envelope-from root@dchagin.dialup.corbina.ru) Received: from corbina.ru (mail.post.ru [195.14.50.16]) by contrabass.post.ru (Postfix) with ESMTP id 3AE491C7D3F; Wed, 17 Sep 2008 09:16:58 +0400 (MSD) X-Virus-Scanned: by cgpav Uf39PSi9pFi9oFi9 Received: from dchagin.dialup.corbina.ru ([78.107.232.239] verified) by corbina.ru (CommuniGate Pro SMTP 5.1.14) with ESMTPS id 1141239085; Wed, 17 Sep 2008 09:16:58 +0400 Received: from dchagin.dialup.corbina.ru (localhost.chd.net [127.0.0.1]) by dchagin.dialup.corbina.ru (8.14.2/8.14.2) with ESMTP id m8H5Gv9o002425; Wed, 17 Sep 2008 09:16:57 +0400 (MSD) (envelope-from root@dchagin.dialup.corbina.ru) Received: (from root@localhost) by dchagin.dialup.corbina.ru (8.14.2/8.14.2/Submit) id m8H5GphP002424; Wed, 17 Sep 2008 09:16:51 +0400 (MSD) (envelope-from root) Date: Wed, 17 Sep 2008 09:16:51 +0400 From: Chagin Dmitry To: Roman Divacky Message-ID: <20080917051651.GA2390@dchagin.dialup.corbina.ru> Mail-Followup-To: Roman Divacky , freebsd-emulation@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> <20080915204400.GA92022@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080915204400.GA92022@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-emulation@freebsd.org 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: Wed, 17 Sep 2008 05:17:01 -0000 On Mon, Sep 15, 2008 at 10:44:00PM +0200, Roman Divacky wrote: > 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, > I think that better if to move definitions of structures to linux.h > dmitry, you should have commit bit :) i'm ready :) thnx! -- Have fun! chd