From owner-freebsd-questions@FreeBSD.ORG Wed Jun 3 11:09:43 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 84269FD for ; Wed, 3 Jun 2015 11:09:43 +0000 (UTC) (envelope-from ortadur@web.de) Received: from mout.web.de (mout.web.de [212.227.17.11]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.web.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FF6E1239 for ; Wed, 3 Jun 2015 11:09:42 +0000 (UTC) (envelope-from ortadur@web.de) Received: from [131.169.214.139] by 3capp-webde-bs60.server.lan (via HTTP); Wed, 3 Jun 2015 13:09:39 +0200 MIME-Version: 1.0 Message-ID: From: "Andre Meiser" To: freebsd-questions@freebsd.org Subject: Aw: Re: Many core dumps in pthread_getspecific - how to debug? Content-Type: text/plain; charset=UTF-8 Date: Wed, 3 Jun 2015 13:09:39 +0200 Importance: normal Sensitivity: Normal In-Reply-To: <20150603164756.06961d69@X220.alogt.com> References: , <20150603164756.06961d69@X220.alogt.com> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K0:br91KGs7tpKlNi6VLK2k5PNJbFQV09zkXIjXwluIFoI ntSBIKhQfH6o7RIdZ1VmWpqdQDE2hvszxp1ak3C+ecO1G7biE2 Hc+KLQxDjDC4lacrifkkb17gMd8Y2xqmskrz/89i9TRBb+JB8r ZpSh/aCY5ZPyhqe5MfbcGBUBUoLvrshcXTxkFtdUJrpSMPbtXC KBUHvVSa4s8k3kP/5v2779Bc77MEAWjqHu7gqgf9jjXlBGe0QH uixKnleJZF2DPQksD9HpGJmoMr+TObNRWTh3xVDPHlE/QEjsYr ZPJnoA= X-UI-Out-Filterresults: notjunk:1; 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 11:09:43 -0000 On Wed, 3 Jun 2015 10:47 +0200 Erich Dollansky wrote: > welcome! thx ;) > Can you get the sources and compile your own FreeBSD? I got the source from here: http://svnweb.freebsd.org/base/releng/10.1/ 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. > 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.