From owner-freebsd-stable@freebsd.org Wed Jul 22 10:21:02 2015 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B7779A6CC1 for ; Wed, 22 Jul 2015 10:21:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDB611A1B for ; Wed, 22 Jul 2015 10:21:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t6MAKtY1066132 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 22 Jul 2015 13:20:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t6MAKtY1066132 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t6MAKt94066130; Wed, 22 Jul 2015 13:20:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 Jul 2015 13:20:55 +0300 From: Konstantin Belousov To: Andre Meiser Cc: freebsd-stable@freebsd.org Subject: Re: Many core dumps in pthread_getspecific. Message-ID: <20150722102055.GA2072@kib.kiev.ua> References: <20150603145838.GX2499@kib.kiev.ua> <20150614190504.GT2080@kib.kiev.ua> <20150616073637.GO2080@kib.kiev.ua> <20150703211111.GZ2080@kib.kiev.ua> <20150719205722.GT2404@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2015 10:21:02 -0000 On Wed, Jul 22, 2015 at 11:46:35AM +0200, Andre Meiser wrote: > On Sun, Jul 19, 2015 at 22:57 +0200, Konstantin Belousov wrote: > > It seems that besides sigreturn(), ucontext symbols must be pre-resolved > > as well. Try this update (it includes the previous change). > > thanks for looking into this, but this patch wasn't funny at all. Did you tested your patch? Almost every programme crashed with a core dump. Here the example for simply starting vim: > > % readelf -d vim | grep NEEDED > 0x0000000000000001 (NEEDED) Shared library: [libm.so.5] > 0x0000000000000001 (NEEDED) Shared library: [libncurses.so.8] > 0x0000000000000001 (NEEDED) Shared library: [libintl.so.8] > 0x0000000000000001 (NEEDED) Shared library: [libpython2.7.so.1] > 0x0000000000000001 (NEEDED) Shared library: [libthr.so.3] > 0x0000000000000001 (NEEDED) Shared library: [libc.so.7] > > > (gdb) bt > #0 0x00000008014a30d4 in _thr_rtld_init () at /usr/src/lib/libthr/thread/thr_rtld.c:239 > #1 0x00000008014a2f03 in _libpthread_init (curthread=) at /usr/src/lib/libthr/thread/thr_init.c:372 > #2 0x00000008014a5c22 in _thread_printf () from /lib/libthr.so.3 > #3 0x0000000801498d06 in _init () from /lib/libthr.so.3 > #4 0x00007fffffffe000 in ?? () > #5 0x000000080083d6bf in r_debug_state () from /libexec/ld-elf.so.1 > #6 0x000000080083cd17 in __tls_get_addr () from /libexec/ld-elf.so.1 > #7 0x000000080083b129 in .text () from /libexec/ld-elf.so.1 > #8 0x0000000000000000 in ?? () > > > (gdb) info locals > li = {rtli_version = 0, lock_create = 0x8014a30f0 <_thr_rtld_lock_create>, lock_destroy = 0x8014a3160 <_thr_rtld_lock_destroy>, > rlock_acquire = 0x8014a31b0 <_thr_rtld_rlock_acquire>, wlock_acquire = 0x8014a3270 <_thr_rtld_wlock_acquire>, > lock_release = 0x8014a3300 <_thr_rtld_lock_release>, thread_set_flag = 0x8014a33c0 <_thr_rtld_set_flag>, > thread_clr_flag = 0x8014a33d0 <_thr_rtld_clr_flag>, at_fork = 0} > dummy = -1 > curthread = (struct pthread *) 0x7fffff0f2650 > uc_len = > > (gdb) info registers > rax 0xf0b470 15774832 > rbx 0x7fffff0f2650 140737472570960 > rcx 0x0 0 > rdx 0xca0000 13238272 > rsi 0x8024064e8 34397512936 > rdi 0x7fffff0f2650 140737472570960 > rbp 0x7fffffffdb20 0x7fffffffdb20 > rsp 0x7fffff0f2650 0x7fffff0f2650 > r8 0x0 0 > r9 0xfffff8000e35f4c0 -8795854605120 > r10 0x0 0 > r11 0x246 582 > r12 0x800a54a28 34370570792 > r13 0x800a545b0 34370569648 > r14 0x1 1 > r15 0x800855420 34368476192 > rip 0x8014a30d4 0x8014a30d4 <_thr_rtld_init+244> > eflags 0x10206 66054 > cs 0x43 67 > ss 0x3b 59 > ds 0x0 0 > es 0x0 0 > fs 0x0 0 > gs 0x0 0 %rbp-%rsp == 0xf0b4d0 == 15774928 Can you do the following: 1. Compile and run the program at the end of the message and send me the output. 2. Also send me the first 40 lines of the dmesg for bootverbose boot. 3. (Optional) Install x86info program, compiled from the sources on github, https://github.com/dankamongmen/x86info, then run, as root kldload cpuctl x86info -a #include extern int __getcontextx_size(void); int main(void) { printf("%#x\n", __getcontextx_size()); }