Bug 203964 - Clang 3.7.0 crash in i386 buildkernel
Summary: Clang 3.7.0 crash in i386 buildkernel
Status: Closed Unable to Reproduce
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 18:18 UTC by Conrad Meyer
Modified: 2017-04-19 06:30 UTC (History)
1 user (show)

See Also:


Attachments
hptnr_config-930780.sh (3.97 KB, application/x-sh)
2015-10-22 18:18 UTC, Conrad Meyer
no flags Details
hptnr_config-930780.c (compressed) (229.13 KB, application/x-gzip)
2015-10-22 18:19 UTC, Conrad Meyer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Conrad Meyer freebsd_committer freebsd_triage 2015-10-22 18:18:19 UTC
Created attachment 162364 [details]
hptnr_config-930780.sh

Assertion failed: ((!RequiresNullTerminator || BufEnd[0] == 0) && "Buffer is not null terminated!"), function init, file /root/workstation-freebsd/lib/clang/libllvmsupport/../../../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 3.7.0 (tags/RELEASE_370/final 246257) 20150906
Target: i386-unknown-freebsd11.0
Thread model: posix
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: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
cc: note: diagnostic msg: /tmp/root/hptnr_config-930780.c
cc: note: diagnostic msg: /tmp/root/hptnr_config-930780.sh
cc: note: diagnostic msg:

********************
*** [hptnr_config.o] Error code 254

make[2]: stopped in /usr/obj.xc/i386.i386/i386.i386/root/workstation-freebsd/sys/NUMA
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2015-10-22 18:19:51 UTC
Created attachment 162365 [details]
hptnr_config-930780.c (compressed)
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2015-10-22 18:55:46 UTC
(Note: the .c attachment seems to have been compressed by gzip twice, you have to uncompress it twice to get at the plaintext.)

Your test case compiles just fine here:

$ clang -cc1 -triple i386-unknown-freebsd11.0 -emit-obj -disable-free -main-file-name hptnr_config.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu i486 -target-feature -mmx -target-feature -sse -target-feature -aes -target-feature -avx -no-implicit-float -gdwarf-2 -dwarf-column-info -nostdsysteminc -nobuiltininc -D _KERNEL -D HAVE_KERNEL_OPTION_HEADERS -D __printf__=__freebsd_kprintf__ -O2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -Wmissing-include-dirs -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 -Werror -std=iso9899:1999 -ferror-limit 19 -fmessage-length 0 -ffreestanding -fwrapv -stack-protector 1 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-loops -vectorize-slp -x c hptnr_config-930780.c

$ ls -l hptnr_config-930780.o
-rw-r--r--  1 dim  dim  3312 2015-10-22 20:54:45 hptnr_config-930780.o

Maybe you were running out of memory?  Does this error reproduce consistently?
Comment 3 Conrad Meyer freebsd_committer freebsd_triage 2015-10-22 19:09:46 UTC
(In reply to Dimitry Andric from comment #2)
> Maybe you were running out of memory?

Perhaps, but if so Clang should distinguish OOM from internal compiler errors to avoid confusing / spurious bug reports.

> Does this error reproduce consistently?

No, this was the first time.  Most of the time buildkernel succeeds.
Comment 4 Conrad Meyer freebsd_committer freebsd_triage 2017-04-19 04:59:18 UTC
Clang 3.7.0 is growing obsolete.  Time to close this as Can't Reproduce?