From owner-freebsd-current@FreeBSD.ORG Sat Mar 21 09:20:43 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2B4D356; Sat, 21 Mar 2015 09:20:43 +0000 (UTC) Received: from ivan-labs.com (ivan-labs.com [162.243.251.239]) by mx1.freebsd.org (Postfix) with ESMTP id 8887CCFA; Sat, 21 Mar 2015 09:20:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ivan-labs.com (Postfix) with ESMTP id 794F5121117; Sat, 21 Mar 2015 12:20:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at Received: from ivan-labs.com ([127.0.0.1]) by localhost (ivan-labs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F1DlbEx99VDg; Sat, 21 Mar 2015 12:20:41 +0300 (MSK) Received: from [192.168.1.143] (cable-84-43-203-116.mnet.bg [84.43.203.116]) by ivan-labs.com (Postfix) with ESMTPSA id 35D9712039E; Sat, 21 Mar 2015 12:20:41 +0300 (MSK) Message-ID: <550D37DA.7060105@ivan-labs.com> Date: Sat, 21 Mar 2015 11:20:26 +0200 From: "Ivan A. Kosarev" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: Use of chunksize before initialization References: <550C27D8.2010105@ivan-labs.com> <20150321010218.GD2379@kib.kiev.ua> In-Reply-To: <20150321010218.GD2379@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org, Ed Maste X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Mar 2015 09:20:43 -0000 On 03/21/2015 03:02 AM, Konstantin Belousov wrote: > On Fri, Mar 20, 2015 at 03:59:52PM +0200, Ivan A. Kosarev wrote: >> #12 0x00000008011b428d in malloc_init_hard () at jemalloc_jemalloc.c:698 >> #13 malloc_init () at jemalloc_jemalloc.c:296 >> #14 0x0000000801243ea2 in ?? () from /lib/libc.so.7 >> #15 0x00000008006a5400 in ?? () >> #16 0x000000080089e5b0 in ?? () from /libexec/ld-elf.so.1 >> #17 0x00007fffffffe0b0 in ?? () >> #18 0x0000000801139d06 in _init () from /lib/libc.so.7 >> #19 0x00007fffffffe0b0 in ?? () > The backtrace is strange. Did you compiled malloc with the debugging > symbols, while keep rest of libc without -g ? I've just added the -g flag to CC_FLAGS in the Makefile and made sure to install an unstripped version of the .so . I could investigate more on why the early calls omit debug symbols, if it does any matter. > Does it happen always, on only for the early initialization of the > mutexes ? I'm not sure I understand the whole logic of the initialization process, but we could put a statement initializing the chunksize variable to 0 to the beginning of malloc_init_hard() and see if the assertion (or any other before it) fails. Since my suspicion is that the variable get random values at base_boot(), the presence of the failure depends on random factors. For a simple one-line program calling malloc() it is known to not to fail, of course. I should be able to to more tests on Mon. > It might be related to r276630. Can you test on, say, 10.1 ? The Tsan tests mentioned below that cause mass (alignment != 0) failures are known to work fine on 10.1. > : jemalloc_chunk.c:152: Failed assertion: "alignment != 0" > > Here's more of failures of this kind around: > > http://lab.llvm.org:8011/builders/sanitizer_x86_64-freebsd/builds/4758/steps/make-check-tsan/logs/stdio > > Can you please let me know if the analysis is correct and there's > something to fix about initialization of the variable? > > Backtrace looks valid. Thanks. --