ponyc: Compile error: "Pass 'Move heap allocations to the stack' is not initialized"
I’ve just tried to build trivial helloworld from tutorial, and it fails to compile. I’ve tried the build from bintray and manually compiled, all of the output something like this:
Building builtin ->
/home/avsej/.local/lib/pony/0.3.1-1-g8a8ee28/packages/builtin
Building . -> /home/avsej/code/pony/helloworld
Generating
Reachability
Selector painting
Data prototypes
Data types
Function prototypes
Functions
Descriptors
Optimising
Pass 'Move heap allocations to the stack' is not initialized.
Verify if there is a pass dependency cycle.
Required Passes:
Segmentation fault (core dumped)
Backtrace:
Thread 1 (Thread 0x7f88c13f0980 (LWP 10246)):
#0 llvm::PassInfo::createPass (this=0x0) at /usr/src/debug/llvm-3.8.0.src/include/llvm/PassInfo.h:118
#1 llvm::PMTopLevelManager::schedulePass (this=0x2533828, P=0x25402f0) at /usr/src/debug/llvm-3.8.0.src/lib/IR/LegacyPassManager.cpp:669
#2 0x000000000048b9b8 in addHeapToStackPass (pmb=..., pm=...) at src/libponyc/codegen/genopt.cc:484
#3 0x00007f88bf9c84d3 in llvm::PassManagerBuilder::addExtensionsToPM (this=this@entry=0x7ffe78c8de70, ETy=ETy@entry=llvm::PassManagerBuilder::EP_Peephole, PM=...) at /usr/src/debug/llvm-3.8.0.src/lib/Transforms/IPO/PassManagerBuilder.cpp:154
#4 0x00007f88bf9c8f96 in llvm::PassManagerBuilder::populateModulePassManager (this=0x7ffe78c8de70, MPM=...) at /usr/src/debug/llvm-3.8.0.src/lib/Transforms/IPO/PassManagerBuilder.cpp:236
#5 0x000000000048bdda in optimise (c=0x7ffe78c8e0b0, pony_specific=0x1) at src/libponyc/codegen/genopt.cc:946
#6 0x000000000048c0a9 in genopt (c=0x7ffe78c8e0b0, pony_specific=0x1) at src/libponyc/codegen/genopt.cc:984
#7 0x000000000045a004 in genexe (c=0x7ffe78c8e0b0, program=0x7f88bd06ed40) at src/libponyc/codegen/genexe.c:424
#8 0x0000000000455c5f in codegen (program=0x7f88bd06ed40, opt=0x7ffe78c8e460) at src/libponyc/codegen/codegen.c:717
#9 0x0000000000425391 in generate_passes (program=0x7f88bd06ed40, options=0x7ffe78c8e460) at src/libponyc/pass/pass.c:286
#10 0x000000000040b445 in compile_package (path=0x4b59e6 ".", opt=0x7ffe78c8e460, print_program_ast=0x0, print_package_ast=0x0) at src/ponyc/main.c:245
#11 0x000000000040b867 in main (argc=0x1, argv=0x7ffe78c8e5d8) at src/ponyc/main.c:368
Although when I disable optimizations (-d) it works as expected
$ lsb_release -rid
Distributor ID: Fedora
Description: Fedora release 24 (Twenty Four)
Release: 24
$ llvm-config --version --build-mode --host-target --assertion-mode --shared-mode --has-rtti
3.8.0
RelWithDebInfo
x86_64-unknown-linux-gnu
OFF
YES
shared
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (14 by maintainers)
Commits related to this issue
- Resolves issue #1225 - compiler segfault on optimization pass. — committed to KaroLaunonen/ponyc by KaroLaunonen 7 years ago
- Resolves issue #1225 - compiler segfault on optimization pass. (#1910) — committed to ponylang/ponyc by KaroLaunonen 7 years ago
The problem only arises with optimization. If I use
--debug
withponyc
it works fine.So then I saw this: http://stackoverflow.com/questions/30114849/crash-on-au-addrequiredloopinfo-in-llvm-pass
And tried this:
…and now it works!