From owner-freebsd-threads@FreeBSD.ORG Sun Aug 10 21:17:00 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51DDB37B6F8 for ; Sun, 10 Aug 2003 21:16:19 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3415544509 for ; Sun, 10 Aug 2003 17:10:32 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp42.pn.xcllnt.net (dhcp42.pn.xcllnt.net [192.168.4.242]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7B0AVwO069837 for ; Sun, 10 Aug 2003 17:10:31 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp42.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7B0AVFr028018 for ; Sun, 10 Aug 2003 17:10:31 -0700 (PDT) (envelope-from marcel@dhcp42.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7B0AVGD028017 for threads@FreeBSD.org; Sun, 10 Aug 2003 17:10:31 -0700 (PDT) (envelope-from marcel) Date: Sun, 10 Aug 2003 17:10:30 -0700 From: Marcel Moolenaar To: threads@FreeBSD.org Message-ID: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 04:17:00 -0000 Gang, There seems to be a bug in libkse where we dereference the thread pointer in situations where it's NULL. I suspect this bug is specific to platforms that have per-thread thread pointers. I have some rough gdb(1) support to help out with the analysis: itanium% /nfs/gnu/obj/gdb/gdb kse kse.core GNU gdb 5.3 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ia64-unknown-freebsd5.1"... Core was generated by `kse'. Program terminated with signal 4, Illegal instruction. #0 _thr_sig_add (pthread=0x600000000010e000, sig=11, info=0x6000000000112a40) at /nfs/freebsd/5.x/src/lib/libpthread/arch/ia64/include/pthread_md.h:189 189 return (_tcb->tcb_thread); (gdb) l 184 } 185 186 static __inline struct pthread * 187 _get_curthread(void) 188 { 189 return (_tcb->tcb_thread); 190 } 191 192 /* 193 * Get the current kse. (gdb) bt #0 _thr_sig_add (pthread=0x6000000000172000, sig=11, info=0x6000000000176a40) at /nfs/freebsd/5.x/src/lib/libpthread/arch/ia64/include/pthread_md.h:189 #1 0x40000000000099e0 in kse_check_completed (kse=0x600000000001a000) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_kern.c:1556 #2 0x40000000000063c0 in kse_sched_multi (kmbx=0x600000000001a000) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_kern.c:1001 #3 0x0000000000000000 in ?? () The illegal instruction fault is caused by a NULL thread pointer: Dump of assembler code for function _thr_sig_add: 0x400000000001eac0 <_thr_sig_add>: [MII] alloc r40=ar.pfs,13,10,0 0x400000000001eac1 <_thr_sig_add+1>: adds r12=-80,r12 0x400000000001eac2 <_thr_sig_add+2>: mov r41=r1 0x400000000001ead0 <_thr_sig_add+16>: [MII] nop.m 0x0 0x400000000001ead1 <_thr_sig_add+17>: mov r39=b0 0x400000000001ead2 <_thr_sig_add+18>: mov r38=r0 0x400000000001eae0 <_thr_sig_add+32>: [MMI] adds r14=-32,r13;; 0x400000000001eae1 <_thr_sig_add+33>: ld8 r16=[r14] The fault is given on the last instruction if the disassembly given above (the thread pointer is r13): (gdb) info register r13 r13 0x0 0 (gdb) info register r14 r14 0xffffffffffffffe0 -32 Q: Shouldn't we call _tcb_set() somewhere in the code stream to make sure we have a valid thread pointer? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Sun Aug 10 23:30:26 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F352837B401 for ; Sun, 10 Aug 2003 23:30:25 -0700 (PDT) Received: from exchhz01.viatech.com.cn (ip-167-164-97-218.anlai.com [218.97.164.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9684943FB1 for ; Sun, 10 Aug 2003 23:30:22 -0700 (PDT) (envelope-from davidxu@viatech.com.cn) Received: from davidwnt (ip-240-1-168-192.rev.dyxnet.com [192.168.1.240]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id QBL3MXLR; Mon, 11 Aug 2003 14:12:33 +0800 Message-ID: <00a801c35fd2$9139a1b0$f001a8c0@davidwnt> From: "David Xu" To: "Marcel Moolenaar" , References: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> Date: Mon, 11 Aug 2003 14:34:08 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: base64 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 06:30:26 -0000 LS0tLS0gT3JpZ2luYWwgTWVzc2FnZSAtL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bw0KcmV0aGluayBpdC4NCg0KPiAtLSANCj4gIE1hcmNlbCBNb29s ZW5hYXIgICBVU1BBOiBBLTM5MDA0IG1hcmNlbEB4Y2xsbnQubmV0DQo+IF9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQo+IGZyZWVic2QtdGhyZWFkc0BmcmVl YnNkLm9yZyBtYWlsaW5nIGxpc3QNCj4gaHR0cDovL2xpc3RzLmZyZWVic2Qub3JnL21haWxtYW4v bGlzdGluZm8vZnJlZWJzZC10aHJlYWRzDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWls IHRvICJmcmVlYnNkLXRocmVhZHMtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmci From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 07:22:55 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2911537B401 for ; Mon, 11 Aug 2003 07:22:55 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82DC243F85 for ; Mon, 11 Aug 2003 07:22:54 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7BEMouN014004; Mon, 11 Aug 2003 10:22:50 -0400 (EDT) Date: Mon, 11 Aug 2003 10:22:50 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 14:22:55 -0000 On Sun, 10 Aug 2003, Marcel Moolenaar wrote: > Gang, > > There seems to be a bug in libkse where we dereference the thread > pointer in situations where it's NULL. I suspect this bug is > specific to platforms that have per-thread thread pointers. I > have some rough gdb(1) support to help out with the analysis: _thr_sig_add() does look at the current thread but it doesn't dereference it. I think it's OK for it to be null. Is it possible that _tp (which points to the tcb) isn't set? So that when you dereference it you get the error? Is the upcall somehow clearing _tp? > The fault is given on the last instruction if the disassembly > given above (the thread pointer is r13): > > (gdb) info register r13 > r13 0x0 0 > (gdb) info register r14 > r14 0xffffffffffffffe0 -32 Right, that's what I was guessing. > Q: Shouldn't we call _tcb_set() somewhere in the code stream to make > sure we have a valid thread pointer? Once its set, it should always be set, right? The kernel doesn't change it, right? I think that's the idea anyways. If you look at the beginning of _thr_sched_multi(), we handle first time initialization: if ((curkse->k_flags & KF_INITIALIZED) == 0) { /* Setup this KSEs specific data. */ _kcb_set(curkse->k_kcb); /* Set this before grabbing the context. */ curkse->k_flags |= KF_INITIALIZED; } That should set it up so that we always have TP set to something (in this case, it's the fake tcb). But from then on, we rely on the kernel not to touch it. Are you sure the kernel doesn't destroy it somehow? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 08:05:45 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF14737B405 for ; Mon, 11 Aug 2003 08:05:43 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 087B043FBF for ; Mon, 11 Aug 2003 08:05:42 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp42.pn.xcllnt.net (dhcp42.pn.xcllnt.net [192.168.4.242]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7BF5fwO073892; Mon, 11 Aug 2003 08:05:41 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp42.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7BF5fJI000606; Mon, 11 Aug 2003 08:05:41 -0700 (PDT) (envelope-from marcel@dhcp42.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7BF5fnu000605; Mon, 11 Aug 2003 08:05:41 -0700 (PDT) (envelope-from marcel) Date: Mon, 11 Aug 2003 08:05:41 -0700 From: Marcel Moolenaar To: Daniel Eischen Message-ID: <20030811150541.GA566@dhcp42.pn.xcllnt.net> References: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 15:05:46 -0000 On Mon, Aug 11, 2003 at 10:22:50AM -0400, Daniel Eischen wrote: > > The fault is given on the last instruction if the disassembly > > given above (the thread pointer is r13): > > > > (gdb) info register r13 > > r13 0x0 0 > > (gdb) info register r14 > > r14 0xffffffffffffffe0 -32 > > Right, that's what I was guessing. > > > Q: Shouldn't we call _tcb_set() somewhere in the code stream to make > > sure we have a valid thread pointer? > > Once its set, it should always be set, right? The kernel doesn't > change it, right? I think that's the idea anyways. If you look at > the beginning of _thr_sched_multi(), we handle first time initialization: The kernel creates a new context by virtue of the upcall. Since we established earlier that the thread pointer itself is not part of the context, you cannot assume that the thread pointer is not destroyed. > if ((curkse->k_flags & KF_INITIALIZED) == 0) { > /* Setup this KSEs specific data. */ > _kcb_set(curkse->k_kcb); > > /* Set this before grabbing the context. */ > curkse->k_flags |= KF_INITIALIZED; > } > > That should set it up so that we always have TP set to something > (in this case, it's the fake tcb). But from then on, we rely > on the kernel not to touch it. Are you sure the kernel doesn't > destroy it somehow? I'm positive that the kernel *does* clear _tp. It's by design. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 08:24:04 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F58737B401 for ; Mon, 11 Aug 2003 08:24:04 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E22C43FCB for ; Mon, 11 Aug 2003 08:24:03 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7BFO2uN024575; Mon, 11 Aug 2003 11:24:02 -0400 (EDT) Date: Mon, 11 Aug 2003 11:24:02 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030811150541.GA566@dhcp42.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 15:24:04 -0000 On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > On Mon, Aug 11, 2003 at 10:22:50AM -0400, Daniel Eischen wrote: > > > > The fault is given on the last instruction if the disassembly > > > given above (the thread pointer is r13): > > > > > > (gdb) info register r13 > > > r13 0x0 0 > > > (gdb) info register r14 > > > r14 0xffffffffffffffe0 -32 > > > > Right, that's what I was guessing. > > > > > Q: Shouldn't we call _tcb_set() somewhere in the code stream to make > > > sure we have a valid thread pointer? > > > > Once its set, it should always be set, right? The kernel doesn't > > change it, right? I think that's the idea anyways. If you look at > > the beginning of _thr_sched_multi(), we handle first time initialization: > > The kernel creates a new context by virtue of the upcall. Since > we established earlier that the thread pointer itself is not part > of the context, you cannot assume that the thread pointer is not > destroyed. OK, that's different than x86/amd64 then. > > if ((curkse->k_flags & KF_INITIALIZED) == 0) { > > /* Setup this KSEs specific data. */ > > _kcb_set(curkse->k_kcb); > > > > /* Set this before grabbing the context. */ > > curkse->k_flags |= KF_INITIALIZED; > > } > > > > That should set it up so that we always have TP set to something > > (in this case, it's the fake tcb). But from then on, we rely > > on the kernel not to touch it. Are you sure the kernel doesn't > > destroy it somehow? > > I'm positive that the kernel *does* clear _tp. It's by design. Try David's patch. It sets the current thread in the upcall handler. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 09:11:10 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 20D5837B401 for ; Mon, 11 Aug 2003 09:11:10 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FE6143FBF for ; Mon, 11 Aug 2003 09:11:09 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc11) with ESMTP id <2003081116110801300i3vnfe>; Mon, 11 Aug 2003 16:11:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id JAA63157; Mon, 11 Aug 2003 09:11:06 -0700 (PDT) Date: Mon, 11 Aug 2003 09:11:05 -0700 (PDT) From: Julian Elischer To: Daniel Eischen In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: Marcel Moolenaar Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 16:11:10 -0000 I think that david's patch is the correct answer. an upcall has no thread so teh tp must be set to the dummy. The only alternative would be to register a value for the TP that the kernel could set when creating upcall context. On Mon, 11 Aug 2003, Daniel Eischen wrote: > On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > > > On Mon, Aug 11, 2003 at 10:22:50AM -0400, Daniel Eischen wrote: > > > > > > The fault is given on the last instruction if the disassembly > > > > given above (the thread pointer is r13): > > > > > > > > (gdb) info register r13 > > > > r13 0x0 0 > > > > (gdb) info register r14 > > > > r14 0xffffffffffffffe0 -32 > > > > > > Right, that's what I was guessing. > > > > > > > Q: Shouldn't we call _tcb_set() somewhere in the code stream to make > > > > sure we have a valid thread pointer? > > > > > > Once its set, it should always be set, right? The kernel doesn't > > > change it, right? I think that's the idea anyways. If you look at > > > the beginning of _thr_sched_multi(), we handle first time initialization: > > > > The kernel creates a new context by virtue of the upcall. Since > > we established earlier that the thread pointer itself is not part > > of the context, you cannot assume that the thread pointer is not > > destroyed. > > OK, that's different than x86/amd64 then. > > > > if ((curkse->k_flags & KF_INITIALIZED) == 0) { > > > /* Setup this KSEs specific data. */ > > > _kcb_set(curkse->k_kcb); > > > > > > /* Set this before grabbing the context. */ > > > curkse->k_flags |= KF_INITIALIZED; > > > } > > > > > > That should set it up so that we always have TP set to something > > > (in this case, it's the fake tcb). But from then on, we rely > > > on the kernel not to touch it. Are you sure the kernel doesn't > > > destroy it somehow? > > > > I'm positive that the kernel *does* clear _tp. It's by design. > > Try David's patch. It sets the current thread in the upcall > handler. > > -- > Dan Eischen > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 11:01:29 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13B8237B407 for ; Mon, 11 Aug 2003 11:01:29 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E7FA243FF7 for ; Mon, 11 Aug 2003 11:01:20 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7BI1KUp080874 for ; Mon, 11 Aug 2003 11:01:20 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7BI1KH3080868 for freebsd-threads@freebsd.org; Mon, 11 Aug 2003 11:01:20 -0700 (PDT) Date: Mon, 11 Aug 2003 11:01:20 -0700 (PDT) Message-Id: <200308111801.h7BI1KH3080868@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 18:01:29 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2002/01/16] kern/33951 threads pthread_cancel is ignored 2 problems total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/01/19] bin/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] bin/24632 threads libc_r delicate deviation from libc in ha o [2001/04/02] bin/26307 threads libc_r aborts when using the KDE media pl o [2001/10/31] bin/31661 threads pthread_kill signal handler doesn't get s o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/03/07] bin/35622 threads sigaltstack is missing in libc_r o [2002/06/27] bin/39922 threads [PATCH?] Threaded applications executed w o [2003/03/02] bin/48856 threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] bin/49087 threads Signals lost in programs linked with libc a [2003/04/08] bin/50733 threads buildworld won't build, because of linkin o [2003/05/07] bin/51949 threads thread in accept cannot be cancelled o [2002/02/01] i386/34536 threads accept() blocks other threads o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/10/10] kern/43887 threads abnormal CPU useage when use pthread_mute o [2003/05/30] kern/52817 threads top(1) shows garbage for threaded process o [2000/08/26] misc/20861 threads libc_r does not honor socket timeouts o [2001/01/25] misc/24641 threads pthread_rwlock_rdlock can deadlock o [2002/08/04] misc/41331 threads Pthread library open sets O_NONBLOCK flag 19 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2001/09/09] bin/30464 threads pthread mutex attributes -- pshared o [2002/05/02] bin/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwri o [2000/05/25] misc/18824 threads gethostbyname is not thread safe o [2000/10/21] misc/22190 threads A threaded read(2) from a socketpair(2) f o [2002/07/16] misc/40671 threads pthread_cancel doesn't remove thread from 5 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 16:41:11 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D02C37B401 for ; Mon, 11 Aug 2003 16:41:11 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 548D543FA3 for ; Mon, 11 Aug 2003 16:41:10 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7BNfAwO076515; Mon, 11 Aug 2003 16:41:10 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7BNf9F1001161; Mon, 11 Aug 2003 16:41:09 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7BNewkm001160; Mon, 11 Aug 2003 16:40:58 -0700 (PDT) (envelope-from marcel) Date: Mon, 11 Aug 2003 16:40:58 -0700 From: Marcel Moolenaar To: David Xu Message-ID: <20030811234058.GA944@athlon.pn.xcllnt.net> References: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> <00a801c35fd2$9139a1b0$f001a8c0@davidwnt> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00a801c35fd2$9139a1b0$f001a8c0@davidwnt> User-Agent: Mutt/1.5.4i cc: threads@FreeBSD.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 23:41:11 -0000 On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > I have a patch trying to fix the problem, I haven't tested it, > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > I think some calls of kse_set_curthread is bogus, Dan might need to > rethink it. I think this is it. I now get sig 11, but it looks like a faulty use of random(). It appears random() is not thread safe and this particular test program uses random. I'll continue to run tests, but so far it looks like the patch is fixing KSE/ia64. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 16:53:37 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14BD137B401; Mon, 11 Aug 2003 16:53:37 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA3FF43FA3; Mon, 11 Aug 2003 16:53:36 -0700 (PDT) (envelope-from davidxu@FreeBSD.org) Received: from localhost (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7BNrYUp039009; Mon, 11 Aug 2003 16:53:35 -0700 (PDT) (envelope-from davidxu@FreeBSD.org) From: David Xu To: Marcel Moolenaar Date: Tue, 12 Aug 2003 07:56:36 +0800 User-Agent: KMail/1.5.2 References: <20030811001030.GA27859@dhcp42.pn.xcllnt.net> <00a801c35fd2$9139a1b0$f001a8c0@davidwnt> <20030811234058.GA944@athlon.pn.xcllnt.net> In-Reply-To: <20030811234058.GA944@athlon.pn.xcllnt.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200308120756.36583.davidxu@FreeBSD.org> cc: threads@FreeBSD.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: davidxu@FreeBSD.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 23:53:37 -0000 On Tuesday 12 August 2003 07:40, Marcel Moolenaar wrote: > On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > I have a patch trying to fix the problem, I haven't tested it, > > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > > I think some calls of kse_set_curthread is bogus, Dan might need to > > rethink it. > > I think this is it. I now get sig 11, but it looks like a faulty > use of random(). It appears random() is not thread safe and this > particular test program uses random. > > I'll continue to run tests, but so far it looks like the patch is > fixing KSE/ia64. It would be nice if you can run tests under directory libpthread/test, mutex_d is useful test when I am modifying libkse. David Xu From owner-freebsd-threads@FreeBSD.ORG Mon Aug 11 17:06:44 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0434437B401 for ; Mon, 11 Aug 2003 17:06:44 -0700 (PDT) Received: from letters.cs.ucsb.edu (letters.cs.ucsb.edu [128.111.41.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BE4843F85 for ; Mon, 11 Aug 2003 17:06:43 -0700 (PDT) (envelope-from krishna@cs.ucsb.edu) Received: from ella (ella [128.111.43.201]) by letters.cs.ucsb.edu (8.11.7+Sun/8.11.6) with ESMTP id h7C06gS20766 for ; Mon, 11 Aug 2003 17:06:43 -0700 (PDT) Date: Mon, 11 Aug 2003 17:06:42 -0700 (PDT) From: "Krishna N. Ramachandran" X-Sender: krishna@ella To: threads@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: benchmarks? recommendations for app developers? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2003 00:06:44 -0000 Hi, I am interested in running a few benchmark tests to gauge the performance of libc_r, lkse, and libthr under FreeBSD 5.1. Specifically, I am interested in benchmarking thread management and synchronization management in the thread libraries. Are there any freely available tools that can do this for me? Also, would you know of some recorded performance comparisons out there that I can look up? Also, I wonder if there are any recommendations as to which library to use for a particular class of application? For instance, if an app creates only 5-10 threads, would it be better to use libThr over KSE? If an app creates 1000s of threads, would it be best to use KSE? I know this question isn't very concrete and has probably been covered many times in bits-and-pieces on the mailing list, but it would certainly help app-developers if a design ideology/principle doc is put up somewhere. Thank you in advance, Krishna p.s. Sorry, if this email turns out to be a duplicate. The previous one i sent has still not made it to the group. From owner-freebsd-threads@FreeBSD.ORG Sat Aug 16 03:13:38 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BD0B37B401 for ; Sat, 16 Aug 2003 03:13:38 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A5F4143FE1 for ; Sat, 16 Aug 2003 03:13:37 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7GADauN006657; Sat, 16 Aug 2003 06:13:36 -0400 (EDT) Date: Sat, 16 Aug 2003 06:13:36 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030811234058.GA944@athlon.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 10:13:38 -0000 On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > > > I have a patch trying to fix the problem, I haven't tested it, > > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > > I think some calls of kse_set_curthread is bogus, Dan might need to > > rethink it. > > I think this is it. I now get sig 11, but it looks like a faulty > use of random(). It appears random() is not thread safe and this > particular test program uses random. > > I'll continue to run tests, but so far it looks like the patch is > fixing KSE/ia64. So as of now, where do we stand for KSE on ia64? Do ACE tests pass? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Aug 16 09:13:33 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF7FE37B401; Sat, 16 Aug 2003 09:13:33 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A31D4400E; Sat, 16 Aug 2003 09:13:33 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp42.pn.xcllnt.net (dhcp42.pn.xcllnt.net [192.168.4.242]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7GGDWwO090963; Sat, 16 Aug 2003 09:13:32 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp42.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7GGDWtV039952; Sat, 16 Aug 2003 09:13:32 -0700 (PDT) (envelope-from marcel@dhcp42.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7GGDWf3039951; Sat, 16 Aug 2003 09:13:32 -0700 (PDT) (envelope-from marcel) Date: Sat, 16 Aug 2003 09:13:32 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030816161332.GA39823@dhcp42.pn.xcllnt.net> References: <20030811234058.GA944@athlon.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 16:13:34 -0000 On Sat, Aug 16, 2003 at 06:13:36AM -0400, Daniel Eischen wrote: > On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > > > On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > > > > > I have a patch trying to fix the problem, I haven't tested it, > > > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > > > I think some calls of kse_set_curthread is bogus, Dan might need to > > > rethink it. > > > > I think this is it. I now get sig 11, but it looks like a faulty > > use of random(). It appears random() is not thread safe and this > > particular test program uses random. > > > > I'll continue to run tests, but so far it looks like the patch is > > fixing KSE/ia64. > > So as of now, where do we stand for KSE on ia64? Do ACE tests > pass? Good question. I don't know. I wanted to try it at home in case I ran into other kernel panics, but I cannot compile. There's at least a problem with the mutex_d test, so I suspect that we still have some lingering issues. This does not look to be related to thread pointers. I don't know to what extend it will affect ACE. I think I fixed all of the kernel panics that were caused by using KSE on ia64, so I would suggest to try ACE on pluto1. The machine does not have the absolute latest libkse (aug 12) but it should be good enough for a first try. Note that pluto1 is building packages, so you're not on an idle machine. Please don't use pluto2 for now. It hasn't got the latest kernel... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Sat Aug 16 14:13:36 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D59237B401 for ; Sat, 16 Aug 2003 14:13:36 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8F2543F3F for ; Sat, 16 Aug 2003 14:13:35 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7GLDYuN004322; Sat, 16 Aug 2003 17:13:34 -0400 (EDT) Date: Sat, 16 Aug 2003 17:13:34 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030816161332.GA39823@dhcp42.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 21:13:36 -0000 On Sat, 16 Aug 2003, Marcel Moolenaar wrote: > On Sat, Aug 16, 2003 at 06:13:36AM -0400, Daniel Eischen wrote: > > On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > > > > > On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > > > > > > > I have a patch trying to fix the problem, I haven't tested it, > > > > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > > > > I think some calls of kse_set_curthread is bogus, Dan might need to > > > > rethink it. > > > > > > I think this is it. I now get sig 11, but it looks like a faulty > > > use of random(). It appears random() is not thread safe and this > > > particular test program uses random. > > > > > > I'll continue to run tests, but so far it looks like the patch is > > > fixing KSE/ia64. > > > > So as of now, where do we stand for KSE on ia64? Do ACE tests > > pass? > > Good question. I don't know. I wanted to try it at home in case I > ran into other kernel panics, but I cannot compile. > > There's at least a problem with the mutex_d test, so I suspect that > we still have some lingering issues. This does not look to be > related to thread pointers. I don't know to what extend it will affect > ACE. Well, it works for i386 and amd64, so if it doesn't for ia64, then most likely it has something to do with per-thread TP handling. I suppose it could also be time related (quantum, time-of-day) also. > I think I fixed all of the kernel panics that were caused by using > KSE on ia64, so I would suggest to try ACE on pluto1. The machine > does not have the absolute latest libkse (aug 12) but it should be > good enough for a first try. Note that pluto1 is building packages, > so you're not on an idle machine. Please don't use pluto2 for now. > It hasn't got the latest kernel... I'll try the mutex_d test and see what happens. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Aug 16 16:29:14 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3B4A837B401 for ; Sat, 16 Aug 2003 16:29:14 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CDC843F3F for ; Sat, 16 Aug 2003 16:29:13 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h7GNTCuN022392; Sat, 16 Aug 2003 19:29:12 -0400 (EDT) Date: Sat, 16 Aug 2003 19:29:12 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20030816161332.GA39823@dhcp42.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 23:29:14 -0000 On Sat, 16 Aug 2003, Marcel Moolenaar wrote: > On Sat, Aug 16, 2003 at 06:13:36AM -0400, Daniel Eischen wrote: > > On Mon, 11 Aug 2003, Marcel Moolenaar wrote: > > > > > On Mon, Aug 11, 2003 at 02:34:08PM +0800, David Xu wrote: > > > > > > > > I have a patch trying to fix the problem, I haven't tested it, > > > > http://people.freebsd.org/~davidxu/kse/thr_kern.c.diff > > > > I think some calls of kse_set_curthread is bogus, Dan might need to > > > > rethink it. > > > > > > I think this is it. I now get sig 11, but it looks like a faulty > > > use of random(). It appears random() is not thread safe and this > > > particular test program uses random. > > > > > > I'll continue to run tests, but so far it looks like the patch is > > > fixing KSE/ia64. > > > > So as of now, where do we stand for KSE on ia64? Do ACE tests > > pass? > > Good question. I don't know. I wanted to try it at home in case I > ran into other kernel panics, but I cannot compile. > > There's at least a problem with the mutex_d test, so I suspect that > we still have some lingering issues. This does not look to be > related to thread pointers. I don't know to what extend it will affect > ACE. One question. When you call (the syscall) setcontext() from _ia64_break_setcontext(), do you ignore the signal mask (uc.uc_sigmask)? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Aug 16 17:49:57 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DDC7B37B401; Sat, 16 Aug 2003 17:49:57 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FA9343F75; Sat, 16 Aug 2003 17:49:56 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp42.pn.xcllnt.net (dhcp42.pn.xcllnt.net [192.168.4.242]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7H0nuwO093367; Sat, 16 Aug 2003 17:49:56 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp42.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h7H0nutV052270; Sat, 16 Aug 2003 17:49:56 -0700 (PDT) (envelope-from marcel@dhcp42.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp42.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h7H0nunh052269; Sat, 16 Aug 2003 17:49:56 -0700 (PDT) (envelope-from marcel) Date: Sat, 16 Aug 2003 17:49:56 -0700 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20030817004956.GA52247@dhcp42.pn.xcllnt.net> References: <20030816161332.GA39823@dhcp42.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: threads@freebsd.org Subject: Re: KSE/ia64: NULL thread pointer in _thr_sig_add() X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2003 00:49:58 -0000 On Sat, Aug 16, 2003 at 07:29:12PM -0400, Daniel Eischen wrote: > On Sat, 16 Aug 2003, Marcel Moolenaar wrote: > > > On Sat, Aug 16, 2003 at 06:13:36AM -0400, Daniel Eischen wrote: > > > > There's at least a problem with the mutex_d test, so I suspect that > > we still have some lingering issues. This does not look to be > > related to thread pointers. I don't know to what extend it will affect > > ACE. > > One question. When you call (the syscall) setcontext() from > _ia64_break_setcontext(), do you ignore the signal mask (uc.uc_sigmask)? Good point. I don't think so. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net