From owner-freebsd-threads@FreeBSD.ORG Wed Jun 9 11:21:41 2004 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 2509716A4CE; Wed, 9 Jun 2004 11:21:41 +0000 (GMT) Received: from mail.mcneil.com (rrcs-west-24-199-45-54.biz.rr.com [24.199.45.54]) by mx1.FreeBSD.org (Postfix) with ESMTP id 050C543D1F; Wed, 9 Jun 2004 11:21:41 +0000 (GMT) (envelope-from sean@mcneil.com) Received: from localhost (localhost.mcneil.com [127.0.0.1]) by mail.mcneil.com (Postfix) with ESMTP id EF417FD059; Wed, 9 Jun 2004 04:21:38 -0700 (PDT) Received: from mail.mcneil.com ([127.0.0.1]) by localhost (server.mcneil.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 80195-07; Wed, 9 Jun 2004 04:21:38 -0700 (PDT) Received: from [24.199.45.54] (mcneil.com [24.199.45.54]) by mail.mcneil.com (Postfix) with ESMTP id 7B1CBFD03A; Wed, 9 Jun 2004 04:21:38 -0700 (PDT) From: Sean McNeil To: Marcel Moolenaar In-Reply-To: <20040605194113.GA26707@dhcp50.pn.xcllnt.net> References: <1086458607.18813.37.camel@server.mcneil.com> <20040605194113.GA26707@dhcp50.pn.xcllnt.net> Content-Type: text/plain Message-Id: <1086780098.95500.4.camel@server.mcneil.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 09 Jun 2004 04:21:38 -0700 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mcneil.com cc: freebsd-threads@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: All my amd64 problems appear to be KSE 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: Wed, 09 Jun 2004 11:21:41 -0000 On Sat, 2004-06-05 at 12:41, Marcel Moolenaar wrote: > On Sat, Jun 05, 2004 at 03:21:29PM -0400, Daniel Eischen wrote: > > > > > > I suppose it is really libreadline at fault here and it should check > > > SA_SIGINFO. Do you think there might be others that don't check either? > > > > I don't know; perhaps. > > > > > Why doesn't this show an issue in i386? Is it just luck that info has > > > been null and not caused a bad dereference? > > > > When I write signal handlers, I usually check info and ucp to > > make sure they are not null before using them. Actually, I > > rarely use them anyways so it doesn't matter if they are null > > or not. > > Nevertheless, libpthread has a signal handler that takes 3 arguments > and it apparently gets called from other signal handlers (chaining) > that do not always pass along the full context; just the signal number > in this case. Consequently, info and ucp can be garbage as is the case > here. This is a general problem and potentionally causes failures on > all platforms, not just amd64. > > I tend to give blame to libreadline here, but I don't have a clear or > even complete picture of it all, so I might actually miss a vital > precondition that's being violated and that would clear libreadline... This really isn't libreadline's fault, but it is an issue. They should check to see if the signal hander/action has SA_SIGINFO. The problem I saw should never have happened. It came about because of a symbol binding issue. Removing an incorrect usage of libpthread by libdb41 resolved the issue. In the long run, it would be nice to fix this as there may be a time when someone installs an SA_SIGINFO handler before libreadline is initialized. Cheers, Sean