Bug 247665

Summary: emulators/rpcs3: clang 10 crashes during build
Product: Base System Reporter: Jan Beich <jbeich>
Component: binAssignee: freebsd-toolchain (Nobody) <toolchain>
Status: Closed FIXED    
Severity: Affects Some People CC: dim, toolchain
Priority: --- Keywords: crash, needs-patch
Version: CURRENTFlags: koobs: maintainer-feedback? (toolchain)
koobs: mfc-stable12?
koobs: mfc-stable11?
Hardware: Any   
OS: Any   
See Also: https://github.com/llvm/llvm-project/issues/45902
Attachments:
Description Flags
command line args (for clang 10) none

Description Jan Beich freebsd_committer freebsd_triage 2020-06-30 18:23:08 UTC
Assertion failed: (getType() == V->getType() && "All operands to PHI node must be the same type as the PHI node!"), function setIncomingValue, file /usr/src/contrib/llvm-project/llvm/include/llvm/IR/Instructions.h, line 2656.
[...]
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      Utilities/Thread.h:401:16: Generating code for declaration 'named_thread<(lambda at rpcs3/Emu/System.cpp:965:47)>::operator='
#0 0x0000000003e42fce PrintStackTrace /usr/src/contrib/llvm-project/llvm/lib/Support/Unix/Signals.inc:564:13
#1 0x0000000003e41155 RunSignalHandlers /usr/src/contrib/llvm-project/llvm/lib/Support/Signals.cpp:69:18
#2 0x0000000003e450fe HandleCrash /usr/src/contrib/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:77:5
#3 0x0000000003e45281 CrashRecoverySignalHandler /usr/src/contrib/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:0:51
#4 0x000000080506cb10 handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 10.0.1 (git@github.com:llvm/llvm-project.git llvmorg-10.0.0-129-gd24d5c8e308)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jan Beich freebsd_committer freebsd_triage 2020-06-30 18:30:58 UTC
Created attachment 216074 [details]
command line args (for clang 10)

The preprocessed source file is larger than 1Mb even compressed (by xz -9e), so run the following to get it.

$ fetch -qo- https://reviews.freebsd.org/paste/raw/404/ | b64decode -o /dev/stdout | xz -dc >System-095a42.cpp
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2020-06-30 20:27:53 UTC
I have been able to reproduce this with the most recent upstream llvm-project checkout, and am now reducing the test case for submission into their bugzilla.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2020-07-02 13:51:00 UTC
Reduced and reported upstream: https://bugs.llvm.org/show_bug.cgi?id=46557
Comment 4 Jan Beich freebsd_committer freebsd_triage 2020-07-03 08:31:12 UTC
I can't reproduce on 11.4 and 12.1: upstreamed sample and the port build fine. Tested base Clang 8.0.1, base Clang 10.0.0 and ports Clang 10.0.1 rc2.
Note, on -CURRENT even ports Clang 10.0.1 rc2 does NOT crash but it's built with -DNDEBUG due to bug 233506.
Comment 5 commit-hook freebsd_committer freebsd_triage 2020-08-08 00:49:25 UTC
A commit references this bug:

Author: jbeich
Date: Sat Aug  8 00:48:51 UTC 2020
New revision: 544351
URL: https://svnweb.freebsd.org/changeset/ports/544351

Log:
  emulators/rpcs3: switch to clang from ports

  PR:		247665

Changes:
  head/emulators/rpcs3/Makefile
Comment 6 Jan Beich freebsd_committer freebsd_triage 2020-11-06 17:11:42 UTC
I wish it was possible to disable LLVM_ASSERTIONS at runtime, so it was easier to test other projects against -CURRENT on their CI e.g., https://cirrus-ci.com/task/5397938333548544
Comment 7 Jan Beich freebsd_committer freebsd_triage 2023-03-27 19:41:53 UTC
Appears fixed upstream.