Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Polly/isl trunk r311629 crashes while building ffmpeg #33412

Open Quuxplusone opened 6 years ago

Quuxplusone commented 6 years ago
Bugzilla Link PR34440
Status NEW
Importance P enhancement
Reported by Jeremy Huddleston Sequoia (jeremyhu@apple.com)
Reported on 2017-09-03 11:02:42 -0700
Last modified on 2017-09-25 12:17:35 -0700
Version unspecified
Hardware PC All
CC llvm-bugs@lists.llvm.org, tobias@grosser.es
Fixed by commit(s)
Attachments clang_2017-09-03-061834_caitsith.crash (15916 bytes, text/plain)
clang_2017-09-25-032650_caitsith.crash (16404 bytes, text/plain)
wmalosslessdec-633bdd.sh (5327 bytes, text/plain)
wmalosslessdec-633bdd.c.bz2 (305392 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 19095
crash log

I haven’t been keeping too close an eye on polly for the past few months, so
I’m not quite sure when this regressed, but here are the data points that I
currently have:

r308713 compiled ffmpeg ok, but it had some had some issues,
http://fate.ffmpeg.org/report.cgi?time=20170831090948&slot=i386-darwin-clang-polly-devel
r306254 produced an ffmpeg build that passed their regression tests,
http://fate.ffmpeg.org/report.cgi?time=20170721062156&slot=i386-darwin-clang-polly-devel

Application Specific Information:
Stack dump:
0.      Program arguments: /opt/local/libexec/llvm-devel/bin/clang -cc1 -triple
i386-apple-macosx10.12.0 -emit-obj -disable-free -main-file-name
wmalosslessdec.c -mrelocation-model dynamic-no-pic -mthread-model posix -fno-
signed-zeros -masm-verbose -munwind-tables -faligned-alloc-unavailable -target-
cpu penryn -target-linker-version 278.4 -dwarf-column-info -debug-info-
kind=standalone -dwarf-version=4 -debugger-tuning=lldb -coverage-notes-file
/Users/jeremy/src/ffmpeg/fate/i386-darwin-clang-polly-nooptimize-
devel/build/libavcodec/wmalosslessdec.gcno -resource-dir
/opt/local/libexec/llvm-devel/lib/clang/6.0.0 -dependency-file
libavcodec/wmalosslessdec.d -MT libavcodec/wmalosslessdec.o -I . -I src/ -D
_ISOC99_SOURCE -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -I
/Users/jeremy/src/ffmpeg/fate/i386-darwin-clang-polly-nooptimize-
devel/src/compat/dispatch_semaphore -D ZLIB_CONST -D HAVE_AV_CONFIG_H -I
/opt/local/include -I /opt/local/include -I /opt/local/include -I
/opt/local/include -O3 -Wno-deprecated -Wno-unused -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 -Werror=implicit-
function-declaration -Werror=missing-prototypes -Werror=return-type -std=c11 -
fconst-strings -fdebug-compilation-dir /Users/jeremy/src/ffmpeg/fate/i386-
darwin-clang-polly-nooptimize-devel/build -ferror-limit 19 -fmessage-length 0 -
pthread -stack-protector 1 -mstack-alignment=16 -fblocks -fobjc-runtime=macosx-
fragile-10.12.0 -fobjc-subscripting-legacy-runtime -fencode-extended-block-
signature -fmax-type-align=16 -fdiagnostics-show-option -vectorize-loops -
vectorize-slp -load /opt/local/libexec/llvm-devel/lib/LLVMPolly.dylib -mllvm -
polly -mllvm -polly-optimizer=none -o libavcodec/wmalosslessdec.o -x c
src/libavcodec/wmalosslessdec.c
1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'Function Pass Manager' on module
'src/libavcodec/wmalosslessdec.c'.
4.      Running pass 'Region Pass Manager' on function '@decode_frame'
5.      Running pass 'Polly - Generate an AST from the SCoP (isl)' on basic
block '%for.body13.us.i.i.i'

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   LLVMPolly.dylib                     0x000000010e83e0fb isl_set_preimage + 82
1   LLVMPolly.dylib                     0x000000010e7f3554 isl_set_wrap_facet +
267
2   LLVMPolly.dylib                     0x000000010e7ee5bb add_wrap + 128
3   LLVMPolly.dylib                     0x000000010e7ee09f add_wraps + 212
4   LLVMPolly.dylib                     0x000000010e7ec469 check_eq_adj_eq + 526
5   LLVMPolly.dylib                     0x000000010e7ebf8d
coalesce_local_pair_reuse + 1647
6   LLVMPolly.dylib                     0x000000010e7eb554 coalesce_range + 1314
7   LLVMPolly.dylib                     0x000000010e7eaeac isl_map_coalesce +
593
8   LLVMPolly.dylib                     0x000000010e896b85 un_entry + 72
9   LLVMPolly.dylib                     0x000000010e807a7f
isl_hash_table_foreach + 86
10  LLVMPolly.dylib                     0x000000010e89449d un_op + 190
11  LLVMPolly.dylib                     0x000000010e89484e
isl_union_map_coalesce + 49
12  LLVMPolly.dylib                     0x000000010e6ea733
polly::Dependences::calculateDependences(polly::Scop&) + 2875
13  LLVMPolly.dylib                     0x000000010e6ebc17
polly::DependenceInfo::recomputeDependences(polly::Dependences::AnalysisLevel)
+ 161
14  LLVMPolly.dylib                     0x000000010e747984
polly::IslAstInfoWrapperPass::runOnScop(polly::Scop&) + 72
15  LLVMPolly.dylib                     0x000000010e734e8d
polly::ScopPass::runOnRegion(llvm::Region*, llvm::RGPassManager&) + 59
16  libLLVM.dylib                       0x0000000112e0fa3e
llvm::RGPassManager::runOnFunction(llvm::Function&) + 752
Quuxplusone commented 6 years ago

Attached clang_2017-09-03-061834_caitsith.crash (15916 bytes, text/plain): crash log

Quuxplusone commented 6 years ago

A few more data points.

5.0 r308713 and rc2 had some issues that on quick glance look the same as in trunk r308713.

I updated 5.0 to rc4 last night and it is all green.

I'm updating trunk to r312520 today.

Quuxplusone commented 6 years ago
Hi Jeremy,

we resolved a couple of bugs recently. Would be interesting to see if these
resolved the latest issues.

Best,
Tobias
Quuxplusone commented 6 years ago

There was no change with r312520. I'll try updating to current trunk and should have some results this week.

Quuxplusone commented 6 years ago

Thank you!

Quuxplusone commented 6 years ago
Unfortunately, r314087 fails to build at roughly the same place:

See http://fate.ffmpeg.org/report.cgi?time=20170925144543&slot=x86_64-darwin-
clang-polly-devel

0  libLLVM.dylib            0x0000000103b320c1
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  libLLVM.dylib            0x0000000103b317b6 llvm::sys::RunSignalHandlers() +
83
2  libLLVM.dylib            0x0000000103b32534 SignalHandler(int) + 193
3  libsystem_platform.dylib 0x00007fffb2805b3a _sigtramp + 26
4  libsystem_platform.dylib 0x0000000000000002 _sigtramp + 1300210914
5  LLVMPolly.dylib          0x0000000107db9db4 isl_set_wrap_facet + 267
6  LLVMPolly.dylib          0x0000000107db4e1b add_wrap + 128
7  LLVMPolly.dylib          0x0000000107db48ff add_wraps + 212
8  LLVMPolly.dylib          0x0000000107db2cc9 check_eq_adj_eq + 526
9  LLVMPolly.dylib          0x0000000107db27ed coalesce_local_pair_reuse + 1647
10 LLVMPolly.dylib          0x0000000107db1db4 coalesce_range + 1314
11 LLVMPolly.dylib          0x0000000107db170c isl_map_coalesce + 593
12 LLVMPolly.dylib          0x0000000107e5d3e5 un_entry + 72
13 LLVMPolly.dylib          0x0000000107dce2df isl_hash_table_foreach + 86
14 LLVMPolly.dylib          0x0000000107e5acfd un_op + 190
15 LLVMPolly.dylib          0x0000000107e5b0ae isl_union_map_coalesce + 49
16 LLVMPolly.dylib          0x0000000107cae53a
polly::Dependences::calculateDependences(polly::Scop&) + 2882
17 LLVMPolly.dylib          0x0000000107cafa07
polly::DependenceInfo::recomputeDependences(polly::Dependences::AnalysisLevel)
+ 161
18 LLVMPolly.dylib          0x0000000107d5c28f (anonymous
namespace)::IslScheduleOptimizer::runOnScop(polly::Scop&) + 77
19 LLVMPolly.dylib          0x0000000107cf99a5
polly::ScopPass::runOnRegion(llvm::Region*, llvm::RGPassManager&) + 59
20 libLLVM.dylib            0x000000010459e01a
llvm::RGPassManager::runOnFunction(llvm::Function&) + 752
21 libLLVM.dylib            0x0000000103bffbc9
llvm::FPPassManager::runOnFunction(llvm::Function&) + 293
22 libLLVM.dylib            0x0000000103bffd85
llvm::FPPassManager::runOnModule(llvm::Module&) + 63
23 libLLVM.dylib            0x0000000103c000cc
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 618
24 clang                    0x0000000101b641b8
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions
const&, clang::CodeGenOptions const&, clang::TargetOptions const&,
clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*,
clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream,
std::__1::default_delete<llvm::raw_pwrite_stream> >) + 12887
25 clang                    0x0000000101cdacc8
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 904
26 clang                    0x000000010206b4a8 clang::ParseAST(clang::Sema&,
bool, bool) + 392
27 clang                    0x0000000101e7c3c0 clang::FrontendAction::Execute()
+ 76
28 clang                    0x0000000101e49c0d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 885
29 clang                    0x0000000101eae1db
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3859
30 clang                    0x0000000101af5f8b cc1_main(llvm::ArrayRef<char
const*>, char const*, void*) + 1233
31 clang                    0x0000000101af4e60 main + 8026
32 libdyld.dylib            0x00007fffb25f6235 start + 1
33 libdyld.dylib            0x0000000000000077 start + 1302371907
Stack dump:
0.  Program arguments: /opt/local/libexec/llvm-devel/bin/clang -cc1 -triple
x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-
isa-usage -emit-obj -disable-free -main-file-name wmalosslessdec.c -mrelocation-
model pic -pic-level 2 -mthread-model posix -fno-signed-zeros -masm-verbose -
munwind-tables -faligned-alloc-unavailable -target-cpu penryn -dwarf-column-
info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -target-
linker-version 278.4 -coverage-notes-file /Users/jeremy/src/ffmpeg/fate/x86_64-
darwin-clang-polly-devel/build/libavcodec/wmalosslessdec.gcno -resource-dir
/opt/local/libexec/llvm-devel/lib/clang/6.0.0 -dependency-file
libavcodec/wmalosslessdec.d -MT libavcodec/wmalosslessdec.o -I . -I src/ -D
_ISOC99_SOURCE -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -I
/Users/jeremy/src/ffmpeg/fate/x86_64-darwin-clang-polly-
devel/src/compat/dispatch_semaphore -D PIC -D ZLIB_CONST -D HAVE_AV_CONFIG_H -D
_THREAD_SAFE -I /opt/local/include/SDL2 -I /opt/local/include -I
/opt/local/include -I /opt/local/include -I /opt/local/include -I
/opt/local/include -O3 -Wno-deprecated -Wno-unused -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 -Werror=implicit-
function-declaration -Werror=missing-prototypes -Werror=return-type -std=c11 -
fconst-strings -fdebug-compilation-dir /Users/jeremy/src/ffmpeg/fate/x86_64-
darwin-clang-polly-devel/build -ferror-limit 19 -fmessage-length 0 -pthread -
stack-protector 1 -mstack-alignment=16 -fblocks -fencode-extended-block-
signature -fobjc-runtime=macosx-10.12.0 -fmax-type-align=16 -fdiagnostics-show-
option -vectorize-loops -vectorize-slp -load /opt/local/libexec/llvm-
devel/lib/LLVMPolly.dylib -mllvm -polly -o libavcodec/wmalosslessdec.o -x c
src/libavcodec/wmalosslessdec.c
1.  <eof> parser at end of file
2.  Per-module optimization passes
3.  Running pass 'Function Pass Manager' on module
'src/libavcodec/wmalosslessdec.c'.
4.  Running pass 'Region Pass Manager' on function '@decode_frame'
5.  Running pass 'Polly - Optimize schedule of SCoP' on basic block
'%for.body15.us.i.i.i'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 6.0.0 (trunk 314087)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /opt/local/libexec/llvm-devel/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
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/t8/wgpbl9511f35snrz9_03y9w40000gn/T/wmalosslessdec-633bdd.c
clang: note: diagnostic msg:
/var/folders/t8/wgpbl9511f35snrz9_03y9w40000gn/T/wmalosslessdec-633bdd.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg:
/Users/jeremy/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your
crash)
clang: note: diagnostic msg:

********************

Attaching relevant pieces.

Interestingly, the crash log shows that your signal handler is calling
malloc().  Don't do that.  I'll file a separate ticket for that.
Quuxplusone commented 6 years ago

Attached clang_2017-09-25-032650_caitsith.crash (16404 bytes, text/plain): r314087 clang_2017-09-25-032650_caitsith.crash

Quuxplusone commented 6 years ago

Attached wmalosslessdec-633bdd.sh (5327 bytes, text/plain): wmalosslessdec-633bdd.sh

Quuxplusone commented 6 years ago

Attached wmalosslessdec-633bdd.c.bz2 (305392 bytes, application/octet-stream): wmalosslessdec-633bdd.bz2

Quuxplusone commented 6 years ago

See bug #34718 regarding the issue of malloc being called from within the signal handler if you want to followup on that as well.