Bug 234480 - devel/llvm70: Crashes with multimedia/aom >= 1.0.0.1109
Summary: devel/llvm70: Crashes with multimedia/aom >= 1.0.0.1109
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Brooks Davis
URL: http://www.ipv6proxy.net/go.php?u=htt...
Keywords:
Depends on:
Blocks: 230355
  Show dependency treegraph
 
Reported: 2018-12-28 22:57 UTC by Jan Beich
Modified: 2019-02-09 12:01 UTC (History)
6 users (show)

See Also:
jbeich: maintainer-feedback? (brooks)
brooks: merge-quarterly+


Attachments
av1/encoder/x86/av1_fwd_txfm2d_avx2.c (compressed, preprocessed) (201.30 KB, application/xz)
2018-12-28 22:57 UTC, Jan Beich
no flags Details
command line args (for clang 7) (4.91 KB, text/plain)
2018-12-28 22:58 UTC, Jan Beich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2018-12-28 22:57:12 UTC
Created attachment 200593 [details]
av1/encoder/x86/av1_fwd_txfm2d_avx2.c (compressed, preprocessed)

After https://aomedia.googlesource.com/aom/+/aa7195d608e0%5E%21/ the port no longer builds on -CURRENT:

$ make
[...]
FAILED: CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o
/usr/bin/cc  -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec -I. -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/apps -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/common -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/examples -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/stats -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/third_party/libyuv/include -I/wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/third_party/libwebm -O2 -pipe  -fstack-protector -fno-strict-aliasing -O2 -pipe  -fstack-protector -fno-strict-aliasing -std=c99 -Wall -Wdisabled-optimization -Wextra -Wfloat-conversion -Wimplicit-function-declaration -Wpointer-arith -Wsign-compare -Wstring-conversion -Wtype-limits -Wuninitialized -Wunused -Wvla -Wshorten-64-to-32 -Wshadow -Wundef -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC   -mavx2 -MD -MT CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o -MF CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o.d -o CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o   -c /wrkdirs/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/av1/encoder/x86/av1_fwd_txfm2d_avx2.c
Assertion failed: ((VT.getVectorNumElements() + N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) && "Extract subvector overflow!"), function getNode, file /poudriere/jails/head-amd64/usr/src/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 4708.
cc: error: unable to execute command: Abort trap
cc: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 7.0.1 (branches/release_70 348686) (based on LLVM 7.0.1)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-12-28 22:58:03 UTC
Created attachment 200594 [details]
command line args (for clang 7)
Comment 2 Jan Beich freebsd_committer freebsd_triage 2018-12-28 23:12:36 UTC
Outside my scope. I can mark it as BROKEN_FreeBSD_13 or USES=compiler:gcc-c++11-lib. Clang 6 reached EOL upstream, so it isn't good idea to downgrade to.
Comment 3 Dimitry Andric freebsd_committer freebsd_triage 2018-12-29 12:15:42 UTC
Reproduced, minimized and reported upstream:
https://bugs.llvm.org/show_bug.cgi?id=40181
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-12-29 15:13:55 UTC
A commit references this bug:

Author: dim
Date: Sat Dec 29 15:13:49 UTC 2018
New revision: 342592
URL: https://svnweb.freebsd.org/changeset/base/342592

Log:
  Pull in r342397 from upstream llvm trunk (by Amara Emerson):

    Revert "Revert r342183 "[DAGCombine] Fix crash when store merging
    created an extract_subvector with invalid index.""

    Fixed the assertion failure.

    Differential Revision: https://reviews.llvm.org/D51831

  This fixes 'Assertion failed: ((VT.getVectorNumElements() +
  N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) &&
  "Extract subvector overflow!"), function getNode' when building the
  multimedia/aom port (with AVX2 enabled).

  Reported by:	jbeich
  PR:		234480
  MFC after:	6 weeks
  X-MFC-With:	r341825

Changes:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2018-12-29 15:16:59 UTC
Please re-check after base r342592, and close if it is now fixed.
Comment 6 commit-hook freebsd_committer freebsd_triage 2018-12-29 15:22:05 UTC
A commit references this bug:

Author: dim
Date: Sat Dec 29 15:21:51 UTC 2018
New revision: 342593
URL: https://svnweb.freebsd.org/changeset/base/342593

Log:
  Pull in r342863 from upstream llvm trunk (by Hans Wennborg):

    Remove debug printf leftover from r342397

  PR:		234480
  MFC after:	6 weeks
  X-MFC-With:	r341825

Changes:
  head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Comment 7 doctor 2018-12-29 18:27:35 UTC
Crash on compile now

Assertion failed: ((VT.getVectorNumElements() + N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) && "Extract subvector overflow!"), function getNode, file /usr/ports/devel/llvm70/work/llvm-7.0.1.src/lib/CodeGen/SelectionDAG/SelectionDAG.cpp, line 4708.
Stack dump:
0.      Program arguments: /usr/local/llvm70/bin/clang-7 -cc1 -triple x86_64-portbld-freebsd11.2 -emit-obj -disable-free -main-file-name av1_fwd_txfm2d_avx2.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +avx2 -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /usr/ports/multimedia/aom/work/.build/CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.gcno -resource-dir /usr/local/llvm70/lib/clang/7.0.1 -dependency-file CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o.d -sys-header-deps -MT CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec -I . -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/apps -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/common -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/examples -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/stats -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/third_party/libyuv/include -I /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/third_party/libwebm -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=0 -D _LARGEFILE_SOURCE -D _FILE_OFFSET_BITS=64 -O2 -Wall -Wdisabled-optimization -Wextra -Wfloat-conversion -Wimplicit-function-declaration -Wpointer-arith -Wsign-compare -Wstring-conversion -Wtype-limits -Wuninitialized -Wunused -Wvla -Wshorten-64-to-32 -Wshadow -Wundef -std=c99 -fdebug-compilation-dir /usr/ports/multimedia/aom/work/.build -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fobjc-runtime=gnustep -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o CMakeFiles/aom_av1_encoder_avx2_intrinsics.dir/av1/encoder/x86/av1_fwd_txfm2d_avx2.c.o -x c /usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/av1/encoder/x86/av1_fwd_txfm2d_avx2.c -faddrsig 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '/usr/ports/multimedia/aom/work/aom-1.0.0-1115-ga1ebb57ec/av1/encoder/x86/av1_fwd_txfm2d_avx2.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@lowbd_fwd_txfm2d_16x8_avx2'
#0 0x0000000802fc5ef8 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/llvm70/lib/libLLVM-7.so+0x9c5ef8)
#1 0x0000000802fc41c5 llvm::sys::RunSignalHandlers() (/usr/local/llvm70/lib/libLLVM-7.so+0x9c41c5)
#2 0x0000000802fc6502 (/usr/local/llvm70/lib/libLLVM-7.so+0x9c6502)
#3 0x00000008023a2946 handle_signal /usr/src/lib/libthr/thread/thr_sig.c:0:3
#4 0x00000008023a1eb2 thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:190:1
clang-7: error: unable to execute command: Abort trap (core dumped)
clang-7: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 7.0.1 (tags/RELEASE_701/final)
Target: x86_64-portbld-freebsd11.2
Thread model: posix
InstalledDir: /usr/local/llvm70/bin
clang-7: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-7: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-7: note: diagnostic msg: /tmp/av1_fwd_txfm2d_avx2-53ee92.c
clang-7: note: diagnostic msg: /tmp/av1_fwd_txfm2d_avx2-53ee92.sh
clang-7: note: diagnostic msg: 

********************
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/multimedia/aom
Comment 8 Dimitry Andric freebsd_committer freebsd_triage 2018-12-29 22:17:25 UTC
(In reply to doctor from comment #7)
> Crash on compile now
> 
> Assertion failed: ((VT.getVectorNumElements() + N2C->getZExtValue() <=
> N1.getValueType().getVectorNumElements()) && "Extract subvector overflow!"),
> function getNode, file
> /usr/ports/devel/llvm70/work/llvm-7.0.1.src/lib/CodeGen/SelectionDAG/
> SelectionDAG.cpp, line 4708.
> Stack dump:
> 0.      Program arguments: /usr/local/llvm70/bin/clang-7

Ah, you're using the port version of clang 7.0, which doesn't yet have the patch.  It's a little annoying that we have to apply those in two places.

Brooks, are you OK with adding the patches of base r342592 and base r342593 to the llvm70 port?  I can put up review if you like
Comment 9 Jan Beich freebsd_committer freebsd_triage 2018-12-30 01:38:14 UTC
(In reply to Dimitry Andric from comment #5)
> Please re-check after base r342592, and close if it is now fixed.

I confirm, builds fine on -CURRENT with base Clang 7:
- 13.0 i386:  https://ptpb.pw/-noq (CPUTYPE=native)
- 13.0 amd64: https://ptpb.pw/qPa_

Leaving open per comment 8.
Comment 10 Dimitry Andric freebsd_committer freebsd_triage 2018-12-30 19:40:31 UTC
Created https://reviews.freebsd.org/D18691 for adding those patches to the devel/llvm70 port.
Comment 11 commit-hook freebsd_committer freebsd_triage 2019-01-03 18:10:30 UTC
A commit references this bug:

Author: brooks
Date: Thu Jan  3 18:10:22 UTC 2019
New revision: 489195
URL: https://svnweb.freebsd.org/changeset/ports/489195

Log:
  Backport two Objective-C bug fixes (D18672)

  Add patches for head rS342592 and rS342593 (D18691)

  Add patch files for head rS342592 and rS342593, which correspond to the
  following upstream revisions:

  https://reviews.llvm.org/rL342397
  https://reviews.llvm.org/rL342397

  These fix an 'Assertion failed: ((VT.getVectorNumElements() +
  N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) &&
  "Extract subvector overflow!"), function getNode' when building the
  multimedia/aom port (with AVX2 enabled).

  PR:		234480
  Submitted by:	theraven, dim
  Differential Revision:	https://reviews.freebsd.org/D18672
  Differential Revision:	https://reviews.freebsd.org/D18691

Changes:
  head/devel/llvm70/Makefile
  head/devel/llvm70/files/clang/patch-tools_clang_lib_CodeGen_CGObjCGNU.cpp
  head/devel/llvm70/files/patch-head-r342592.diff
  head/devel/llvm70/files/patch-head-r342593.diff
Comment 12 Jan Beich freebsd_committer freebsd_triage 2019-01-04 02:23:42 UTC
MFH of crash fixes is covered by "ports-secteam blanket".
https://www.freebsd.org/doc/en/articles/committers-guide/ports.html#ports-qa-blanket
Comment 13 commit-hook freebsd_committer freebsd_triage 2019-01-04 16:16:47 UTC
A commit references this bug:

Author: brooks
Date: Fri Jan  4 16:16:32 UTC 2019
New revision: 489257
URL: https://svnweb.freebsd.org/changeset/ports/489257

Log:
  MFH: r489195 (reliability fix blanket)

  Backport two Objective-C bug fixes (D18672)

  Add patches for head rS342592 and rS342593 (D18691)

  Add patch files for head rS342592 and rS342593, which correspond to the
  following upstream revisions:

  https://reviews.llvm.org/rL342397
  https://reviews.llvm.org/rL342397

  These fix an 'Assertion failed: ((VT.getVectorNumElements() +
  N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) &&
  "Extract subvector overflow!"), function getNode' when building the
  multimedia/aom port (with AVX2 enabled).

  PR:		234480
  Submitted by:	theraven, dim
  Differential Revision:	https://reviews.freebsd.org/D18672
  Differential Revision:	https://reviews.freebsd.org/D18691
  Approved by:	ports-secteam (reliability fix blanket)

Changes:
_U  branches/2019Q1/
  branches/2019Q1/devel/llvm70/Makefile
  branches/2019Q1/devel/llvm70/files/clang/patch-tools_clang_lib_CodeGen_CGObjCGNU.cpp
  branches/2019Q1/devel/llvm70/files/patch-head-r342592.diff
  branches/2019Q1/devel/llvm70/files/patch-head-r342593.diff
Comment 14 commit-hook freebsd_committer freebsd_triage 2019-02-09 12:01:59 UTC
A commit references this bug:

Author: dim
Date: Sat Feb  9 12:01:11 UTC 2019
New revision: 343935
URL: https://svnweb.freebsd.org/changeset/base/343935

Log:
  MFC r342592:

  Pull in r342397 from upstream llvm trunk (by Amara Emerson):

    Revert "Revert r342183 "[DAGCombine] Fix crash when store merging
    created an extract_subvector with invalid index.""

    Fixed the assertion failure.

    Differential Revision: https://reviews.llvm.org/D51831

  This fixes 'Assertion failed: ((VT.getVectorNumElements() +
  N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) &&
  "Extract subvector overflow!"), function getNode' when building the
  multimedia/aom port (with AVX2 enabled).

  Reported by:	jbeich
  PR:		234480

Changes:
_U  stable/11/
  stable/11/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
_U  stable/12/
  stable/12/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp