From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 92A5A384B13D; Mon, 19 Oct 2020 14:51:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92A5A384B13D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 2294F281170; Mon, 19 Oct 2020 16:51:56 +0200 (CEST) Date: Mon, 19 Oct 2020 16:51:56 +0200 From: Jan Hubicka To: "marxin at gcc dot gnu.org" Cc: gcc-bugs@gcc.gnu.org Subject: Re: [Bug gcov-profile/97461] [11 Regression] allocate_gcov_kvp() deadlocks in firefox LTO+PGO build (overridden malloc() recursion) Message-ID: <20201019145156.GA41258@kam.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2020 14:52:00 -0000 > > They have the very same problem when I disable a statically pre-allocated > buffers with -mllvm -vp-static-alloc=0: > > Program received signal SIGILL, Illegal instruction. > 0x00000000004014e6 in calloc (nmemb=1, size=8) at pr97461.c:103 > 103 if (malloc_depth != 0) __builtin_trap(); > (gdb) bt > #0 0x00000000004014e6 in calloc (nmemb=1, size=8) at pr97461.c:103 > #1 0x0000000000401ae1 in allocateValueProfileCounters (Data=0x40a2c8) at > /home/marxin/Programming/llvm-project/compiler-rt/lib/profile/InstrProfilingValue.c:101 > #2 0x0000000000401c45 in instrumentTargetValueImpl (CountValue=1, > CounterIndex=0, Data=0x40a2c8, TargetValue=4199264) at > /home/marxin/Programming/llvm-project/compiler-rt/lib/profile/InstrProfilingValue.c:146 > #3 __llvm_profile_instrument_target (TargetValue=4199264, Data=0x40a2c8, > CounterIndex=0) at > /home/marxin/Programming/llvm-project/compiler-rt/lib/profile/InstrProfilingValue.c:232 > #4 0x000000000040148f in malloc_impl (size=56) at pr97461.c:85 > #5 0x00000000004013fe in malloc (size=56) at pr97461.c:95 > #6 0x00007ffff7e048a3 in __add_to_environ (name=0x406138 > "__LLVM_PROFILE_RT_INIT_ONCE", value=, combined=, > replace=) at setenv.c:215 > #7 0x0000000000402ce4 in truncateCurrentFile () > #8 0x00000000004039bc in parseAndSetFilename () > #9 0x0000000000404134 in __llvm_profile_initialize () > #10 0x0000000000405e95 in __libc_csu_init (argc=argc@entry=1, > argv=argv@entry=0x7fffffffdfa8, envp=0x7fffffffdfb8) at elf-init.c:89 > #11 0x00007ffff7decd9a in __libc_start_main (main=0x401580
, argc=1, > argv=0x7fffffffdfa8, init=0x405e50 <__libc_csu_init>, fini=, > rtld_fini=, stack_end=0x7fffffffdf98) at ../csu/libc-start.c:270 > #12 0x00000000004012aa in _start () at ../sysdeps/x86_64/start.S:120 Hmm, it seems to me that having some entries prealocated by default would be way to avoid this problem in majority cases w/o having to modify the upstream packages. Honza