From owner-freebsd-current@freebsd.org Thu Nov 9 16:01:19 2017 Return-Path: Delivered-To: freebsd-current@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 E4B37E54507 for ; Thu, 9 Nov 2017 16:01:19 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D23DE6C13E for ; Thu, 9 Nov 2017 16:01:19 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: by mailman.ysv.freebsd.org (Postfix) id D1902E54505; Thu, 9 Nov 2017 16:01:19 +0000 (UTC) Delivered-To: current@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 D12D7E54504 for ; Thu, 9 Nov 2017 16:01:19 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [IPv6:2a01:4f8:201:6350::2]) by mx1.freebsd.org (Postfix) with ESMTP id 841A06C13B for ; Thu, 9 Nov 2017 16:01:19 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from [192.168.19.110] (unknown [89.113.128.32]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id 71403887 for ; Thu, 9 Nov 2017 19:01:17 +0300 (MSK) To: current@freebsd.org Reply-To: lev@FreeBSD.org From: Lev Serebryakov Subject: clang crashes on "make -j4 buildkernel" at 12-CURRENT Organization: FreeBSD Message-ID: <39ba47c5-6457-be9a-1937-f29e823884b6@FreeBSD.org> Date: Thu, 9 Nov 2017 19:01:16 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 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: Thu, 09 Nov 2017 16:01:20 -0000 I'm trying to build new NanoBSD "firmware" and have semi-reproducable clang crash. System is 12-CURRENT amd64 r325554, sources is 12-CURRENt r325594 It is guest running on VirtualBox 5.2. Memory & CPU of host is Ok for sure. On "build kernel" stage with "make -j4" I get clang crash (output and backtrace are at the end of this message). It is always at same place, so it doesn't look like random memory error, but what is strange — "make -j1" works. Previous versions of FreeBSD didn't have this problem. Maybe, it is same problem as with lld and latest ZFS changes? cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/nanobsd/data/src/amd64.amd64/tmp -B/usr/obj/nanobsd/data/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I/data/src/sys/netgraph/bluetooth/include -I/data/src/sys/netgraph/bluetooth/drivers/ubt -DHAVE_KERNEL_OPTION_HEADERS -include /usr/obj/nanobsd/data/src/amd64.amd64/sys/D2500CC/opt_global.h -I. -I/data/src/sys -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/obj/nanobsd/data/src/amd64.amd64/sys/D2500CC -MD -MF.depend.ng_ubt.o -MTng_ubt.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -c /data/src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c -o ng_ubt.o Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file /data/src/contrib/llvm/lib/Support/MemoryBuffer.cpp, line 48. cc: error: unable to execute command: Abort trap (core dumped) cc: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 5.0.0 (tags/RELEASE_500/final 312559) (based on LLVM 5.0.0svn) Target: x86_64-unknown-freebsd12.0 Thread model: posix InstalledDir: /usr/bin cc: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script. cc: error: unable to execute command: Abort trap (core dumped) cc: note: diagnostic msg: Error generating preprocessed source(s). *** [ng_ubt.o] Error code 254 Backtrace is * frame #0: 0x0000000002dfa86a cc`thr_kill at thr_kill.S:3 frame #1: 0x0000000002dfa83f cc`__raise(s=6) at raise.c:52 frame #2: 0x0000000002dfa806 cc`abort at abort.c:77 frame #3: 0x0000000002e2398a cc`__assert(func=, file=, line=, failedexpr=) at assert.c:51 frame #4: 0x0000000002c1dbc0 cc`::getOpenFileImpl() [inlined] init at MemoryBuffer.cpp:47 frame #5: 0x0000000002c1dba7 cc`::getOpenFileImpl() [inlined] MemoryBufferMMapFile at MemoryBuffer.cpp:216 frame #6: 0x0000000002c1dba7 cc`::getOpenFileImpl() at MemoryBuffer.cpp:369 frame #7: 0x0000000002c1d806 cc`llvm::MemoryBuffer::getOpenFile(int, llvm::Twine const&, unsigned long, bool, bool) at MemoryBuffer.cpp:415 frame #8: 0x0000000000e5c8c1 cc`(anonymous namespace)::RealFile::getBuffer(llvm::Twine const&, long, bool, bool) at VirtualFileSystem.cpp:177 frame #9: 0x0000000000e3e872 cc`clang::FileManager::getBufferForFile(clang::FileEntry const*, bool, bool) + 146 frame #10: 0x0000000000a08452 cc`::getBuffer() at SourceManager.cpp:98 frame #11: 0x00000000005db4a7 cc`::getBuffer() at SourceManager.h:929 frame #12: 0x0000000000768068 cc`clang::Preprocessor::EnterSourceFile(clang::FileID, clang::DirectoryLookup const*, clang::SourceLocation) + 184 frame #13: 0x0000000000774da7 cc`::HandleIncludeDirective() at PPDirectives.cpp:2019 frame #14: 0x00000000007709f7 cc`::HandleDirective() at PPDirectives.cpp:966 frame #15: 0x0000000000e4a376 cc`clang::Lexer::LexTokenInternal(clang::Token&, bool) + 4422 frame #16: 0x0000000000e480d5 cc`clang::Lexer::Lex(clang::Token&) + 117 frame #17: 0x000000000073f1c2 cc`::Lex() at Preprocessor.cpp:751 frame #18: 0x00000000004833fd cc`::RewriteIncludesInInput() at InclusionRewriter.cpp:619 frame #19: 0x000000000040eaa2 cc`::ExecuteAction() at FrontendActions.cpp:313 frame #20: 0x00000000007d5bcc cc`::Execute() at FrontendAction.cpp:902 frame #21: 0x0000000000d0faf1 cc`clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1217 frame #22: 0x000000000040b91e cc`::ExecuteCompilerInvocation() at ExecuteCompilerInvocation.cpp:251 frame #23: 0x0000000000400943 cc`::cc1_main() at cc1_main.cpp:221 frame #24: 0x0000000000408f48 cc`main [inlined] ExecuteCC1Tool at driver.cpp:306 frame #25: 0x0000000000408f22 cc`main at driver.cpp:387 frame #26: 0x000000000040035f cc`_start(ap=, cleanup=) at crt1.c:72 -- // Lev Serebryakov