Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2025 18:27:52 -0800
From:      Yuri <yuri@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: pthread_mutex_trylock crashes because _get_curthread() returns null
Message-ID:  <ceabbb86-cbab-4f82-9a9b-b8e7068cd6b7@freebsd.org>
In-Reply-To: <Z4On_KSHfMRpi4RU@kib.kiev.ua>
References:  <cf547d6a-fcee-4629-87d4-41e0da63dd79@FreeBSD.org> <Z4On_KSHfMRpi4RU@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
With this patch the original crash is gone, but now it crashes in calloc 
with this stack:


#0  0x0000000003b2b1cc in calloc ()
#1  0x000000002fda34e7 in _thr_alloc (curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_list.c:154
#2  0x000000002fda2522 in _libpthread_init 
(curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_init.c:336
#3  0x000000002fda5265 in _thr_check_init () at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_private.h:927
#4  __Tthr_mutex_trylock (mutex=0x415e440 <_rjem_je_arenas_lock+64>) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:622
#5  0x0000000003b29674 in _rjem_je_arena_choose_hard ()
#6  0x0000000003b335da in arena_choose ()
#7  0x0000000003b2b5b3 in calloc ()
#8  0x000000002fda34e7 in _thr_alloc (curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_list.c:154
#9  0x000000002fda2522 in _libpthread_init 
(curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_init.c:336
#10 0x000000002fda5265 in _thr_check_init () at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_private.h:927
#11 __Tthr_mutex_trylock (mutex=0x415e440 <_rjem_je_arenas_lock+64>) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:622
#12 0x0000000003b29674 in _rjem_je_arena_choose_hard ()
#13 0x0000000003b335da in arena_choose ()
#14 0x0000000003b2b5b3 in calloc ()
#15 0x000000002fda34e7 in _thr_alloc (curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_list.c:154
#16 0x000000002fda2522 in _libpthread_init 
(curthread=curthread@entry=0x0) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_init.c:336
#17 0x000000002fda5265 in _thr_check_init () at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_private.h:927
#18 __Tthr_mutex_trylock (mutex=0x415e440 <_rjem_je_arenas_lock+64>) at 
/disk-samsung/freebsd-src/lib/libthr/thread/thr_mutex.c:622


Yuri




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ceabbb86-cbab-4f82-9a9b-b8e7068cd6b7>