clang on 12-CURRENT traps on its internal assertion when build kernel under nanobsd.sh control

From: Lev Serebryakov <lev_at_FreeBSD.org>
Date: Fri, 22 Jun 2018 17:18:00 +0300
 I tripped over very strange, but repeateable (in my conditions) bug in
clang on 12-CURRENT. This message will be rather long, as I need to
describe all details.

 I have VBox-based (Windows 10 is host) virtual machine with very fresh
12-CURRENT FreeBSD guest (r335478 now). I'm using this VM to build
NanoBSD "firmware" for my router and I'm updating this VM via
"buildworld buildkernel" ~weekly.

 This VM has 4 core CPU, 8GiB of "physical" RAM and 16GiB of swap.

 I *never* have problem when I make "make -j4 buidlworld buildkernel" to
update VM itself. It works rock-solid.

 But when I try to build NanoBSD image from SAME SOURCES (exactly the
same!) with SAME compiler (I'm using system compiler as cross-compiler
to decrease time of build) clang fails every second time.

 Other problem is, that "nanobsd.sh" with "make -j1", but it is NOT
out-of-memory, as swap isn't used at all!

 Message is always the same, and file is the same (asterisks are by me,
to highlight assert):

/usr/bin/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/ubtbcmfw
-DHAVE_KERNEL_OPTION_HEADERS -include
/usr/obj/nanobsd/data/src/amd64.amd64/sys/D2500CC/opt_global.h -I.
-I/data/src/sys -I/data/src/sys/contrib/ck/include -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.ubtbcmfw.o -MTubtbcmfw.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 -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-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c
/data/src/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c -o ubtbcmfw.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 6.0.0 (tags/RELEASE_600/final 326565) (based on
LLVM 6.0.0)
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.


-- 
// Lev Serebryakov


Received on Fri Jun 22 2018 - 12:18:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:16 UTC