Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-18 failed with exit code 139 #170773

Open
4 tasks done
teshields opened this issue May 3, 2024 · 2 comments
Open
4 tasks done

clang-18 failed with exit code 139 #170773

teshields opened this issue May 3, 2024 · 2 comments
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed

Comments

@teshields
Copy link

teshields commented May 3, 2024

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config
HOMEBREW_VERSION: 4.2.20
ORIGIN: https://github.com/Homebrew/brew
HEAD: c2ed3327c605c3e738359c9807b8f4cd6fec09eb
Last commit: 5 days ago
Core tap JSON: 03 May 22:22 UTC
Core cask tap JSON: 03 May 22:22 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_EMOJI: set
Homebrew Ruby: 3.1.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.1.4/bin/ruby
CPU: 10-core 64-bit arm_blizzard_avalanche
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.4.0 => /usr/bin/curl
macOS: 14.4.1-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: 15.3
Rosetta 2: false


brew doctor [Note: the warnings are due to non-Homebrew installed packaged]
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  bison@2.7

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libcutl-1.11.dylib
  /usr/local/lib/libicudata-65.dylib
  /usr/local/lib/libicui18n-65.dylib
  /usr/local/lib/libicuuc-65.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/unicode/alphaindex.h
  /usr/local/include/unicode/appendable.h
  /usr/local/include/unicode/basictz.h
  /usr/local/include/unicode/brkiter.h
  /usr/local/include/unicode/bytestream.h
  /usr/local/include/unicode/bytestrie.h
  /usr/local/include/unicode/bytestriebuilder.h
  /usr/local/include/unicode/calendar.h
  /usr/local/include/unicode/caniter.h
  /usr/local/include/unicode/casemap.h
  /usr/local/include/unicode/char16ptr.h
  /usr/local/include/unicode/chariter.h
  /usr/local/include/unicode/choicfmt.h
  /usr/local/include/unicode/coleitr.h
  /usr/local/include/unicode/coll.h
  /usr/local/include/unicode/compactdecimalformat.h
  /usr/local/include/unicode/curramt.h
  /usr/local/include/unicode/currpinf.h
  /usr/local/include/unicode/currunit.h
  /usr/local/include/unicode/datefmt.h
  /usr/local/include/unicode/dbbi.h
  /usr/local/include/unicode/dcfmtsym.h
  /usr/local/include/unicode/decimfmt.h
  /usr/local/include/unicode/docmain.h
  /usr/local/include/unicode/dtfmtsym.h
  /usr/local/include/unicode/dtintrv.h
  /usr/local/include/unicode/dtitvfmt.h
  /usr/local/include/unicode/dtitvinf.h
  /usr/local/include/unicode/dtptngen.h
  /usr/local/include/unicode/dtrule.h
  /usr/local/include/unicode/edits.h
  /usr/local/include/unicode/enumset.h
  /usr/local/include/unicode/errorcode.h
  /usr/local/include/unicode/fieldpos.h
  /usr/local/include/unicode/filteredbrk.h
  /usr/local/include/unicode/fmtable.h
  /usr/local/include/unicode/format.h
  /usr/local/include/unicode/formattedvalue.h
  /usr/local/include/unicode/fpositer.h
  /usr/local/include/unicode/gender.h
  /usr/local/include/unicode/gregocal.h
  /usr/local/include/unicode/icudataver.h
  /usr/local/include/unicode/icuplug.h
  /usr/local/include/unicode/idna.h
  /usr/local/include/unicode/listformatter.h
  /usr/local/include/unicode/localebuilder.h
  /usr/local/include/unicode/localematcher.h
  /usr/local/include/unicode/localpointer.h
  /usr/local/include/unicode/locdspnm.h
  /usr/local/include/unicode/locid.h
  /usr/local/include/unicode/measfmt.h
  /usr/local/include/unicode/measunit.h
  /usr/local/include/unicode/measure.h
  /usr/local/include/unicode/messagepattern.h
  /usr/local/include/unicode/msgfmt.h
  /usr/local/include/unicode/normalizer2.h
  /usr/local/include/unicode/normlzr.h
  /usr/local/include/unicode/nounit.h
  /usr/local/include/unicode/numberformatter.h
  /usr/local/include/unicode/numberrangeformatter.h
  /usr/local/include/unicode/numfmt.h
  /usr/local/include/unicode/numsys.h
  /usr/local/include/unicode/parseerr.h
  /usr/local/include/unicode/parsepos.h
  /usr/local/include/unicode/platform.h
  /usr/local/include/unicode/plurfmt.h
  /usr/local/include/unicode/plurrule.h
  /usr/local/include/unicode/ptypes.h
  /usr/local/include/unicode/putil.h
  /usr/local/include/unicode/rbbi.h
  /usr/local/include/unicode/rbnf.h
  /usr/local/include/unicode/rbtz.h
  /usr/local/include/unicode/regex.h
  /usr/local/include/unicode/region.h
  /usr/local/include/unicode/reldatefmt.h
  /usr/local/include/unicode/rep.h
  /usr/local/include/unicode/resbund.h
  /usr/local/include/unicode/schriter.h
  /usr/local/include/unicode/scientificnumberformatter.h
  /usr/local/include/unicode/search.h
  /usr/local/include/unicode/selfmt.h
  /usr/local/include/unicode/simpleformatter.h
  /usr/local/include/unicode/simpletz.h
  /usr/local/include/unicode/smpdtfmt.h
  /usr/local/include/unicode/sortkey.h
  /usr/local/include/unicode/std_string.h
  /usr/local/include/unicode/strenum.h
  /usr/local/include/unicode/stringoptions.h
  /usr/local/include/unicode/stringpiece.h
  /usr/local/include/unicode/stringtriebuilder.h
  /usr/local/include/unicode/stsearch.h
  /usr/local/include/unicode/symtable.h
  /usr/local/include/unicode/tblcoll.h
  /usr/local/include/unicode/timezone.h
  /usr/local/include/unicode/tmunit.h
  /usr/local/include/unicode/tmutamt.h
  /usr/local/include/unicode/tmutfmt.h
  /usr/local/include/unicode/translit.h
  /usr/local/include/unicode/tzfmt.h
  /usr/local/include/unicode/tznames.h
  /usr/local/include/unicode/tzrule.h
  /usr/local/include/unicode/tztrans.h
  /usr/local/include/unicode/ubidi.h
  /usr/local/include/unicode/ubiditransform.h
  /usr/local/include/unicode/ubrk.h
  /usr/local/include/unicode/ucal.h
  /usr/local/include/unicode/ucasemap.h
  /usr/local/include/unicode/ucat.h
  /usr/local/include/unicode/uchar.h
  /usr/local/include/unicode/ucharstrie.h
  /usr/local/include/unicode/ucharstriebuilder.h
  /usr/local/include/unicode/uchriter.h
  /usr/local/include/unicode/uclean.h
  /usr/local/include/unicode/ucnv.h
  /usr/local/include/unicode/ucnv_cb.h
  /usr/local/include/unicode/ucnv_err.h
  /usr/local/include/unicode/ucnvsel.h
  /usr/local/include/unicode/ucol.h
  /usr/local/include/unicode/ucoleitr.h
  /usr/local/include/unicode/uconfig.h
  /usr/local/include/unicode/ucpmap.h
  /usr/local/include/unicode/ucptrie.h
  /usr/local/include/unicode/ucsdet.h
  /usr/local/include/unicode/ucurr.h
  /usr/local/include/unicode/udat.h
  /usr/local/include/unicode/udata.h
  /usr/local/include/unicode/udateintervalformat.h
  /usr/local/include/unicode/udatpg.h
  /usr/local/include/unicode/udisplaycontext.h
  /usr/local/include/unicode/uenum.h
  /usr/local/include/unicode/ufieldpositer.h
  /usr/local/include/unicode/uformattable.h
  /usr/local/include/unicode/uformattedvalue.h
  /usr/local/include/unicode/ugender.h
  /usr/local/include/unicode/uidna.h
  /usr/local/include/unicode/uiter.h
  /usr/local/include/unicode/uldnames.h
  /usr/local/include/unicode/ulistformatter.h
  /usr/local/include/unicode/uloc.h
  /usr/local/include/unicode/ulocdata.h
  /usr/local/include/unicode/umachine.h
  /usr/local/include/unicode/umisc.h
  /usr/local/include/unicode/umsg.h
  /usr/local/include/unicode/umutablecptrie.h
  /usr/local/include/unicode/unifilt.h
  /usr/local/include/unicode/unifunct.h
  /usr/local/include/unicode/unimatch.h
  /usr/local/include/unicode/unirepl.h
  /usr/local/include/unicode/uniset.h
  /usr/local/include/unicode/unistr.h
  /usr/local/include/unicode/unorm.h
  /usr/local/include/unicode/unorm2.h
  /usr/local/include/unicode/unum.h
  /usr/local/include/unicode/unumberformatter.h
  /usr/local/include/unicode/unumsys.h
  /usr/local/include/unicode/uobject.h
  /usr/local/include/unicode/upluralrules.h
  /usr/local/include/unicode/uregex.h
  /usr/local/include/unicode/uregion.h
  /usr/local/include/unicode/ureldatefmt.h
  /usr/local/include/unicode/urename.h
  /usr/local/include/unicode/urep.h
  /usr/local/include/unicode/ures.h
  /usr/local/include/unicode/uscript.h
  /usr/local/include/unicode/usearch.h
  /usr/local/include/unicode/uset.h
  /usr/local/include/unicode/usetiter.h
  /usr/local/include/unicode/ushape.h
  /usr/local/include/unicode/uspoof.h
  /usr/local/include/unicode/usprep.h
  /usr/local/include/unicode/ustring.h
  /usr/local/include/unicode/ustringtrie.h
  /usr/local/include/unicode/utext.h
  /usr/local/include/unicode/utf.h
  /usr/local/include/unicode/utf16.h
  /usr/local/include/unicode/utf32.h
  /usr/local/include/unicode/utf8.h
  /usr/local/include/unicode/utf_old.h
  /usr/local/include/unicode/utmscale.h
  /usr/local/include/unicode/utrace.h
  /usr/local/include/unicode/utrans.h
  /usr/local/include/unicode/utypes.h
  /usr/local/include/unicode/uvernum.h
  /usr/local/include/unicode/uversion.h
  /usr/local/include/unicode/vtzone.h

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/libcutl.shared.pc
  /usr/local/lib/pkgconfig/libicudata.pc
  /usr/local/lib/pkgconfig/libicudata.shared.pc
  /usr/local/lib/pkgconfig/libicudata.static.pc
  /usr/local/lib/pkgconfig/libicui18n.pc
  /usr/local/lib/pkgconfig/libicui18n.shared.pc
  /usr/local/lib/pkgconfig/libicui18n.static.pc
  /usr/local/lib/pkgconfig/libicuuc.pc
  /usr/local/lib/pkgconfig/libicuuc.shared.pc
  /usr/local/lib/pkgconfig/libicuuc.static.pc
  /usr/local/lib/pkgconfig/libxerces-c.pc
  /usr/local/lib/pkgconfig/libxerces-c.shared.pc
  /usr/local/lib/pkgconfig/libxerces-c.static.pc
  /usr/local/lib/pkgconfig/libxsd-frontend.shared.pc
  /usr/local/lib/pkgconfig/libxsd.pc
  /usr/local/lib/pkgconfig/libxsd.shared.pc
  /usr/local/lib/pkgconfig/libxsd.static.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libicudata.a
  /usr/local/lib/libicui18n.a
  /usr/local/lib/libicuuc.a

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  pkg-config

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I am running the regression tests for the next release of Ox, prior to the release.

The regression test runs through all of the C/C++ installed compilers (Apple's C/C++, Homebrew GNU C/C++ and Homebrew LLVM C/C++). I had just added the latest release of Homebrew clang (version 18.1.4) prior to running the test.

The failure occurred on 2 of 48 test cases for 1 of the source files in each of those 2 test cases (both generated by Homebrew Bison version 3.8.2). The failure did not occur using earlier releases of Homebrew clang (versions 17.0.6, 16.0.6, 15.0.7, 14.0.6 & 13.0.1).

The crash backtrace file does not exist, but here are the other two requested files:
crash.zip

What happened (include all command output)?

/opt/homebrew/opt/llvm@18/bin/clang -DHAVE_CONFIG_H -I. -I../../../ox-1.12/testsuite/bison-2.3-calc-pure -I../..     -I/opt/homebrew/opt/llvm@18/include  -g  -MT parser.o -MD -MP -MF .deps/parser.Tpo -c -o parser.o parser.c
PLEASE submit a bug report to https://github.com/Homebrew/homebrew-core/issues and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /opt/homebrew/opt/llvm@18/bin/clang -DHAVE_CONFIG_H -I. -I../../../ox-1.12/testsuite/bison-2.3-calc-pure -I../.. -I/opt/homebrew/opt/llvm@18/include -g -MT parser.o -MD -MP -MF .deps/parser.Tpo -c -o parser.o parser.c
1.	<eof> parser at end of file
2.	Code generation
3.	Running pass 'Function Pass Manager' on module 'parser.c'.
4.	Running pass 'RegBankSelect' on function '@yyparse'
 #0 0x0000000116ec5800 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x4695800)
 #1 0x0000000112984d20 llvm::sys::CleanupOnSignal(unsigned long) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x154d20)
 #2 0x0000000116eb7068 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x4687068)
 #3 0x0000000116eb7144 CrashRecoverySignalHandler(int) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x4687144)
 #4 0x0000000199cbb584 (/usr/lib/system/libsystem_platform.dylib+0x180477584)
 #5 0x0000000114cac6fc llvm::AArch64RegisterBankInfo::getInstrMapping(llvm::MachineInstr const&) const (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x247c6fc)
 #6 0x00000001136b10e0 llvm::RegBankSelect::assignInstr(llvm::MachineInstr&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0xe810e0)
 #7 0x00000001136b14dc llvm::RegBankSelect::assignRegisterBanks(llvm::MachineFunction&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0xe814dc)
 #8 0x00000001136b1604 llvm::RegBankSelect::runOnMachineFunction(llvm::MachineFunction&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0xe81604)
 #9 0x0000000112e88694 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x658694)
#10 0x0000000112b43920 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x313920)
#11 0x0000000112b37c4c llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x307c4c)
#12 0x000000010676af70 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>, clang::BackendConsumer*) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x1596f70)
#13 0x0000000106b1060c clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x193c60c)
#14 0x00000001053dffc8 clang::ParseAST(clang::Sema&, bool, bool) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x20bfc8)
#15 0x0000000107271acc clang::FrontendAction::Execute() (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x209dacc)
#16 0x00000001071f47d0 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x20207d0)
#17 0x00000001072c48e8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x20f08e8)
#18 0x000000010032eb28 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/homebrew/Cellar/llvm/18.1.4/bin/clang-18+0x100006b28)
#19 0x000000010032d218 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) (/opt/homebrew/Cellar/llvm/18.1.4/bin/clang-18+0x100005218)
#20 0x0000000106e72b04 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_0>(long) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x1c9eb04)
#21 0x00000001128bc460 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libLLVM.dylib+0x8c460)
#22 0x0000000106e72300 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::__1::optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x1c9e300)
#23 0x0000000106e32f68 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x1c5ef68)
#24 0x0000000106e53bd8 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) (/opt/homebrew/Cellar/llvm/18.1.4/lib/libclang-cpp.dylib+0x1c7fbd8)
#25 0x000000010032bd44 clang_main(int, char**, llvm::ToolContext const&) (/opt/homebrew/Cellar/llvm/18.1.4/bin/clang-18+0x100003d44)
#26 0x0000000100338e38 main (/opt/homebrew/Cellar/llvm/18.1.4/bin/clang-18+0x100010e38)
#27 0x00000001999020e0 
clang: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Homebrew clang version 18.1.4
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm@18/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/jf/3bw023rj4_q4rh9jxzcwrgc40000gn/T/parser-455ae9.c
clang: note: diagnostic msg: /var/folders/jf/3bw023rj4_q4rh9jxzcwrgc40000gn/T/parser-455ae9.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/shields/Library/Logs/DiagnosticReports/clang-18_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

********************
make: *** [parser.o] Error 1

What did you expect to happen?

I expected clang to compile the source file with no issues.

Step-by-step reproduction instructions (by running brew commands)

/opt/homebrew/opt/llvm@18/bin/clang -g -c -o parser.o parser-455ae9.c
@teshields teshields added the bug Reproducible Homebrew/homebrew-core bug label May 3, 2024
@fxcoudert
Copy link
Member

Hi @teshields thanks for the report. Given it's an internal compiler crash during code generation, it seems very likely that this is an upstream issue, i.e., a bug in LLVM itself, rather than a specific issue with Homebrew's installation and packaging. I would recommend you try it again with LLVM's own binaries to confirm, and if so, report it directly to them so they can fix it.

@teshields
Copy link
Author

OK, I checked that the error occurs with Homebrew LLVM 18.1.5, and then downloaded & built the LLVM 18.1.5 source distribution.

The error occurs with clang 18.1.5 as built from source, so I reported the issue to the LLVM Project: clang (18.1.5) frontend command failed with exit code 134.

@fxcoudert fxcoudert added the upstream issue An upstream issue report is needed label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

2 participants