Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Jun 2015 13:09:39 +0200
From:      "Andre Meiser" <ortadur@web.de>
To:        freebsd-questions@freebsd.org
Subject:   Aw: Re: Many core dumps in pthread_getspecific - how to debug?
Message-ID:  <trinity-cc434a7f-87f5-4308-82d1-72c9e02913aa-1433329779257@3capp-webde-bs60>
In-Reply-To: <20150603164756.06961d69@X220.alogt.com>
References:  <trinity-75eb1594-6ceb-4d11-84fe-c10f9ce82b04-1433315382930@3capp-webde-bs56>, <20150603164756.06961d69@X220.alogt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?trinity-cc434a7f-87f5-4308-82d1-72c9e02913aa-1433329779257>