ponyc: Segfault in 'Simplify the CFG' pass with Pony 0.22.6
Got a segfault compiling my hobby project on Arch Linux x86_64: https://bitbucket.org/bytefu/funky/src/simplify-cfg-fail/
$ ponyc
Building builtin -> /usr/lib/pony/0.22.6/packages/builtin
Building . -> /home/burjui/Devel/funky
Building libfunky -> /home/burjui/Devel/funky/libfunky
Building files -> /usr/lib/pony/0.22.6/packages/files
Building time -> /usr/lib/pony/0.22.6/packages/time
Building collections -> /usr/lib/pony/0.22.6/packages/collections
Building ponytest -> /usr/lib/pony/0.22.6/packages/ponytest
Building buffered -> /usr/lib/pony/0.22.6/packages/buffered
Building term -> /usr/lib/pony/0.22.6/packages/term
Building promises -> /usr/lib/pony/0.22.6/packages/promises
Building strings -> /usr/lib/pony/0.22.6/packages/strings
Building signals -> /usr/lib/pony/0.22.6/packages/signals
Building capsicum -> /usr/lib/pony/0.22.6/packages/capsicum
Building format -> /usr/lib/pony/0.22.6/packages/format
Building itertools -> /usr/lib/pony/0.22.6/packages/itertools
Building libfunky/ast -> /home/burjui/Devel/funky/libfunky/ast
Generating
Reachability
Selector painting
Data prototypes
Data types
Function prototypes
Functions
Descriptors
Optimising
Stack dump:
0. Running pass 'Simplify the CFG' on function '@Main_val_process_ooo'
[1] 9226 segmentation fault (core dumped) ponyc
Though the segfault goes away after uncommenting the line 66 in main.pony
:
token_count = token_count + 1
GDB shows the following stacktrace:
#0 0x00007ffff4f747c4 in llvm::removeUnreachableBlocks(llvm::Function&, llvm::LazyValueInfo*) () from /usr/lib/libLLVM-6.0.so
#1 0x00007ffff5376dab in ?? () from /usr/lib/libLLVM-6.0.so
#2 0x00007ffff47efdc1 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
from /usr/lib/libLLVM-6.0.so
#3 0x00007ffff47efebd in llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&)
() from /usr/lib/libLLVM-6.0.so
#4 0x00007ffff47f0405 in llvm::legacy::FunctionPassManager::run(llvm::Function&) ()
from /usr/lib/libLLVM-6.0.so
#5 0x00005555555fc8b4 in optimise(compile_t*, bool) ()
#6 0x00005555555fca40 in genopt ()
#7 0x000055555560b031 in genexe ()
#8 0x000055555559a96e in codegen ()
#9 0x0000555555579be7 in compile_package ()
#10 0x000055555557978d in main ()
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (12 by maintainers)
Commits related to this issue
- Fix incorrect tuple handling I don't know the compiler well and I went off what I knew and believe I found the root cause for our tuple bugs that started with 9222f08. Which was in turn fixing https:... — committed to ponylang/ponyc by SeanTAllen 6 years ago
- Fix incorrect tuple handling I don't know the compiler well and I went off what I knew and believe I found the root cause for our tuple bugs that started with 9222f08. Which was in turn fixing https:... — committed to ponylang/ponyc by SeanTAllen 6 years ago
@burjui https://github.com/ponylang/ponyc/pull/2763 fixes your issue. I’ve tested both my minimal example and your full project.