head -r340287 based powerpc64: multimedia/ffmpeg -r484273 gets a system-clang assert failure

Mark Millard marklmi at yahoo.com
Thu Nov 22 21:03:57 UTC 2018


During a (native) poudriere-devel run I got the following failure.
[Unfortunately clang and poudriere are mismatched for where the
preprocessed source(s) and run script(s) are placed as far as
what is in the poudriere tar archive produced. But I did have
kern.corefile set so that the core file was captured.]

This happens to be on powerpc64 where I experiment with using
fairly modern cc/c++ and the like. devel/powerpc64-xtoolchain-gcc
was used for buildworld buildkernel and clang was built as cc.
But the system binutils is from base/binutils . So not an official
gcc 4.2.1 toolchain context, more of a futures-testing context.

The error report from clang (after 332 other ports had built):

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.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: powerpc64-unknown-freebsd13.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: 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/vf_convolution-9639c0.c
cc: note: diagnostic msg: /tmp/vf_convolution-9639c0.sh
cc: note: diagnostic msg: 

********************
gmake[1]: *** [ffbuild/common.mak:60: libavfilter/vf_convolution.o] Error 254
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory '/wrkdirs/usr/ports/multimedia/ffmpeg/work/ffmpeg-4.1'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Core was generated by `/usr/bin/cc -cc1 -triple powerpc64-unknown-freebsd13.0 -emit-obj -disable-free -'.
Program terminated with signal SIGABRT, Aborted.
#0  0x00000000131c69e8 in .__sys_thr_kill () at thr_kill.S:3
3	RSYSCALL(thr_kill)

(gdb) bt
#0  0x00000000131c69e8 in .__sys_thr_kill () at thr_kill.S:3
#1  0x00000000131c5fbc in __raise (s=<optimized out>) at /usr/src/lib/libc/gen/raise.c:52
#2  0x0000000013187bf0 in abort () at /usr/src/lib/libc/stdlib/abort.c:79
#3  0x00000000131b47d8 in __assert (func=<optimized out>, file=<optimized out>, line=<optimized out>, failedexpr=<optimized out>) at /usr/src/lib/libc/gen/assert.c:51
#4  0x0000000011e2d2c8 in llvm::EVT::getSimpleVT () at /usr/src/contrib/llvm/include/llvm/CodeGen/ValueTypes.h:254
#5  llvm::TargetLoweringBase::getSimpleValueType () at /usr/src/contrib/llvm/include/llvm/CodeGen/TargetLowering.h:1047
#6  mightUseCTR () at /usr/src/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp:407
#7  0x0000000011e2fca8 in convertToCTRLoop () at /usr/src/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp:527
#8  0x0000000011e31eec in runOnFunction () at /usr/src/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp:210
#9  0x000000001256c6dc in llvm::FPPassManager::runOnFunction () at /usr/src/contrib/llvm/lib/IR/LegacyPassManager.cpp:1520
#10 0x000000001256c878 in llvm::FPPassManager::runOnModule () at /usr/src/contrib/llvm/lib/IR/LegacyPassManager.cpp:1541
#11 0x000000001256d760 in runOnModule () at /usr/src/contrib/llvm/lib/IR/LegacyPassManager.cpp:1597
#12 llvm::legacy::PassManagerImpl::run () at /usr/src/contrib/llvm/lib/IR/LegacyPassManager.cpp:1700
#13 0x0000000010d4fb9c in EmitAssembly () at /usr/src/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:815
#14 0x0000000010d51758 in clang::EmitBackendOutput () at /usr/src/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp:1181
#15 0x00000000103add10 in clang::BackendConsumer::HandleTranslationUnit () at /usr/src/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:294
#16 0x0000000010912e64 in clang::ParseAST () at /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp:159
#17 0x00000000108fcfb8 in clang::ASTFrontendAction::ExecuteAction () at /usr/src/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:999
#18 0x00000000103accec in clang::CodeGenAction::ExecuteAction () at /usr/src/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp:1031
#19 0x0000000010901ba0 in clang::FrontendAction::Execute () at /usr/src/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:897
#20 0x00000000112625c0 in clang::CompilerInstance::ExecuteAction () at /usr/src/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:991
#21 0x000000001039516c in clang::ExecuteCompilerInvocation () at /usr/src/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:252
#22 0x00000000103894f8 in cc1_main () at /usr/src/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:221
#23 0x00000000103418b4 in ExecuteCC1Tool () at /usr/src/contrib/llvm/tools/clang/tools/driver/driver.cpp:310
#24 main () at /usr/src/contrib/llvm/tools/clang/tools/driver/driver.cpp:389

The assert looks to be the one listed in:

    /// Return the SimpleValueType held in the specified simple EVT.
    MVT getSimpleVT() const {
      assert(isSimple() && "Expected a SimpleValueType!");
      return V;
    }

This is in:

  /// Extended Value Type. Capable of holding value types which are not native
  /// for any processor (such as the i12345 type), as well as the types an MVT
  /// can represent.
  struct EVT {
. . .

in:

/usr/src/contrib/llvm/include/llvm/CodeGen/ValueTypes.h

Used from:

/usr/src/contrib/llvm/include/llvm/CodeGen/TargetLowering.h 's
class TargetLoweringBase 's:

  /// Return the MVT corresponding to this LLVM type. See getValueType.
  MVT getSimpleValueType(const DataLayout &DL, Type *Ty,
                         bool AllowUnknown = false) const {
    return getValueType(DL, Ty, AllowUnknown).getSimpleVT();
  }

in turn used from:

/usr/src/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp 's
bool PPCCTRLoops::mightUseCTR(BasicBlock *BB)  's:

        unsigned Opcode = 0;
        if (F->getIntrinsicID() != Intrinsic::not_intrinsic) {
          switch (F->getIntrinsicID()) {
          default: continue;
          // If we have a call to ppc_is_decremented_ctr_nonzero, or ppc_mtctr
          // we're definitely using CTR.
          case Intrinsic::ppc_is_decremented_ctr_nonzero:
          case Intrinsic::ppc_mtctr:
            return true;

// VisualStudio defines setjmp as _setjmp
#if defined(_MSC_VER) && defined(setjmp) && \
                       !defined(setjmp_undefined_for_msvc)
#  pragma push_macro("setjmp")
#  undef setjmp
#  define setjmp_undefined_for_msvc
#endif

          case Intrinsic::setjmp:

#if defined(_MSC_VER) && defined(setjmp_undefined_for_msvc)
 // let's return it to _setjmp state
#  pragma pop_macro("setjmp")
#  undef setjmp_undefined_for_msvc
#endif

          case Intrinsic::longjmp:

          // Exclude eh_sjlj_setjmp; we don't need to exclude eh_sjlj_longjmp
          // because, although it does clobber the counter register, the
          // control can't then return to inside the loop unless there is also
          // an eh_sjlj_setjmp.
          case Intrinsic::eh_sjlj_setjmp:
          
          case Intrinsic::memcpy:
          case Intrinsic::memmove:
          case Intrinsic::memset:
          case Intrinsic::powi:
          case Intrinsic::log:
          case Intrinsic::log2:
          case Intrinsic::log10:
          case Intrinsic::exp:
          case Intrinsic::exp2:
          case Intrinsic::pow:
          case Intrinsic::sin:
          case Intrinsic::cos:
            return true;
          case Intrinsic::copysign:
            if (CI->getArgOperand(0)->getType()->getScalarType()->
                isPPC_FP128Ty())
              return true;
            else
              continue; // ISD::FCOPYSIGN is never a library call.
          case Intrinsic::sqrt:               Opcode = ISD::FSQRT;      break;
          case Intrinsic::floor:              Opcode = ISD::FFLOOR;     break;
          case Intrinsic::ceil:               Opcode = ISD::FCEIL;      break;
          case Intrinsic::trunc:              Opcode = ISD::FTRUNC;     break;
          case Intrinsic::rint:               Opcode = ISD::FRINT;      break;
          case Intrinsic::nearbyint:          Opcode = ISD::FNEARBYINT; break;
          case Intrinsic::round:              Opcode = ISD::FROUND;     break;
          case Intrinsic::minnum:             Opcode = ISD::FMINNUM;    break;
          case Intrinsic::maxnum:             Opcode = ISD::FMAXNUM;    break;
          case Intrinsic::umul_with_overflow: Opcode = ISD::UMULO;      break;
          case Intrinsic::smul_with_overflow: Opcode = ISD::SMULO;      break;
          }
        }



          // Conversion happens only for FP calls.
          if (!CI->getArgOperand(0)->getType()->isFloatingPointTy())
            return true;
      
          switch (Func) {
          default: return true;
          case LibFunc_copysign:
          case LibFunc_copysignf:
            continue; // ISD::FCOPYSIGN is never a library call.
          case LibFunc_copysignl:
            return true;
          case LibFunc_fabs:
          case LibFunc_fabsf:
          case LibFunc_fabsl:
            continue; // ISD::FABS is never a library call.
          case LibFunc_sqrt:
          case LibFunc_sqrtf:
          case LibFunc_sqrtl:
            Opcode = ISD::FSQRT; break;
          case LibFunc_floor:
          case LibFunc_floorf:
          case LibFunc_floorl:
            Opcode = ISD::FFLOOR; break;
          case LibFunc_nearbyint:
          case LibFunc_nearbyintf:
          case LibFunc_nearbyintl:
            Opcode = ISD::FNEARBYINT; break;
          case LibFunc_ceil:
          case LibFunc_ceilf:
          case LibFunc_ceill:
            Opcode = ISD::FCEIL; break;
          case LibFunc_rint:
          case LibFunc_rintf:
          case LibFunc_rintl:
            Opcode = ISD::FRINT; break;
          case LibFunc_round:
          case LibFunc_roundf:
          case LibFunc_roundl:
            Opcode = ISD::FROUND; break;
          case LibFunc_trunc:
          case LibFunc_truncf:
          case LibFunc_truncl:
            Opcode = ISD::FTRUNC; break;
          case LibFunc_fmin:
          case LibFunc_fminf:
          case LibFunc_fminl:
            Opcode = ISD::FMINNUM; break;
          case LibFunc_fmax:
          case LibFunc_fmaxf:
          case LibFunc_fmaxl:
            Opcode = ISD::FMAXNUM; break;
          }
        }

        if (Opcode) {
          MVT VTy = TLI->getSimpleValueType(
              *DL, CI->getArgOperand(0)->getType(), true);
          if (VTy == MVT::Other)
            return true;

          if (TLI->isOperationLegalOrCustom(Opcode, VTy))
            continue;
          else if (VTy.isVector() &&
                   TLI->isOperationLegalOrCustom(Opcode, VTy.getScalarType()))
            continue;

          return true;
        }
. . .

The compile line from the log was:

cc -I. -I./ -DLIBICONV_PLUG -isystem /usr/local/include -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -DZLIB_CONST -DHAVE_AV_CONFIG_H -DBUILDING_avfilter -O2 -pipe  -DLIBICONV_PLUG -g -isystem /usr/local/include -fno-strict-aliasing    -std=c11 -fomit-frame-pointer -fPIC -maltivec -mabi=altivec -pthread  -I/usr/local/include -I/usr/local/include/p11-kit-1 -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/freetype2 -I/usr/local/include/opus -I/usr/local/include/opus -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -pthread -I/usr/local/include -I/usr/local/include -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -Wno-unused-const-variable -O3 -fno-math-errno -fno-signed-zeros -mstack-alignment=16 -Qunused-arguments -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type  -MMD -MF libavfilter/vf_convolution.d -MT libavfilter/vf_convolution.o -c -o libavfilter/vf_convolution.o libavfilter/vf_convolution.c

As for context vintages:

# svnlite info /usr/ports/multimedia/ffmpeg
Path: /usr/ports/multimedia/ffmpeg
Working Copy Root Path: /usr/ports
URL: svn://svn0.us-west.freebsd.org/ports/head/multimedia/ffmpeg
Relative URL: ^/head/multimedia/ffmpeg
Repository Root: svn://svn0.us-west.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 484783
Node Kind: directory
Schedule: normal
Last Changed Author: jbeich
Last Changed Rev: 484273
Last Changed Date: 2018-11-05 17:50:26 -0800 (Mon, 05 Nov 2018)

# uname -apKU
FreeBSD FBSDG5L 13.0-CURRENT FreeBSD 13.0-CURRENT #1 r340287M: Fri Nov  9 19:30:13 PST 2018     markmi at FBSDFSSD:/usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/src/powerpc.powerpc64/sys/GENERIC64vtsc-NODBG  powerpc powerpc64 1300003 1300003


Right now it looks like the poudriere run still has 3+ hours to
go for the rest of the ports to build.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-multimedia mailing list