From owner-freebsd-questions@FreeBSD.ORG Wed Jun 3 21:44:24 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C344486 for ; Wed, 3 Jun 2015 21:44:24 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5694114EA for ; Wed, 3 Jun 2015 21:44:24 +0000 (UTC) (envelope-from erichsfreebsdlist@alogt.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=sbxayVmNgUYw1H5/IvrBhDWOlT1wQgQDH1ukQCkMYuM=; b=ebvddLdW1ZVeHsH0CTVVDV1urF+yLDhR885ZTObkKQpEhXogGouxKM1N39glRAejfsYSZCrGuCSm8BAZr9QDDeGac46ZKDOGZU36D64aWbfNucSDq0xRiUhW21DZRpB4VPrqqugWgTtuN5dBigFqBFlMQSzqYQck67jMysAAyHE=; Received: from [114.124.26.56] (port=40091 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpsa (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1Z0GSU-0001rV-Qb; Wed, 03 Jun 2015 15:44:23 -0600 Date: Thu, 4 Jun 2015 05:44:17 +0800 From: Erich Dollansky To: "Andre Meiser" Cc: freebsd-questions@freebsd.org Subject: Re: Many core dumps in pthread_getspecific - how to debug? Message-ID: <20150604054417.5542bcd7@X220.alogt.com> In-Reply-To: References: <20150603164756.06961d69@X220.alogt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2015 21:44:24 -0000 Hi, On Wed, 3 Jun 2015 13:09:39 +0200 "Andre Meiser" wrote: > On Wed, 3 Jun 2015 10:47 +0200 Erich Dollansky wrote: > > Can you get the sources and compile your own FreeBSD? > > I got the source from here: > http://svnweb.freebsd.org/base/releng/10.1/ > this is a good source. > And in lib/libkse/thread/thr_spec.c line 211-214 I found this: > > pthread = _get_curthread(); > > /* Check if there is specific data: */ > if (pthread->specific != NULL && (unsigned int)key < > PTHREAD_KEYS_MAX) { > > If pthread is NULL than this will crash with a core dump. So I made a > quick grep about the sources and at other places the return value of > _get_curthread() is compared with NULL, e.g. thr_kern.c in line 601: > > if ((crit != NULL) && ((curthread = _get_curthread()) != NULL)) > > It looks like _get_curthread() may return NULL and than thr_spec.c > line 214 has to look like this: > > if (pthread != NULL && pthread->specific != NULL && (unsigned > int)key < PTHREAD_KEYS_MAX) { > > But I'm new to FreeBSD, so I'm not sure if this will help to fix the > problem. And I'm not experienced enough to compile my own FreeBSD, > yet. You might be the person with the least experience and the shortest time between start and finding the first error. I would suggest that you file a bug report under: https://bugs.freebsd.org/bugzilla/enter_bug.cgi Include your fix as a diff. Ok, still, I run FreeBSD since decades and never came across this problem. So, you must have another problem on your machine. Erich > > > > Try first the source. The best mailing list for this should be > > 'stable' as it targets only the stable versions like yours. > > Ok, thanks, I'll write it there, too. > > Sincerely yours Andre. > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org"