ponyc: LLVM Optimization Pass Crash on Merge successive reallocations of the same variable
I’m going through the this book. When I compile my tests on this branch of my code I sometimes get this issue during the optimization step.
$ (cd test && ponyc)
Building builtin -> /usr/lib/pony/0.28.0/packages/builtin
Building . -> /home/jwashton/Projects/ray_tracer_challenge/test
Building ponytest -> /usr/lib/pony/0.28.0/packages/ponytest
Building time -> /usr/lib/pony/0.28.0/packages/time
Building collections -> /usr/lib/pony/0.28.0/packages/collections
Building random -> /usr/lib/pony/0.28.0/packages/random
Building .. -> /home/jwashton/Projects/ray_tracer_challenge
Building promises -> /usr/lib/pony/0.28.0/packages/promises
Generating
Reachability
Selector painting
Data prototypes
Data types
Function prototypes
Functions
Descriptors
Optimising
Stack dump:
0. Running pass 'Function Pass Manager' on module 'test'.
1. Running pass 'Merge successive reallocations of the same variable' on function '@_TestCanvas_ref_apply_oo'
Sometimes it works, sometimes it doesn’t. Sometimes the issue disappears if I just try to compile again. Other times I find that any change I make to the code will make it go away (for example commenting out any one of the test suites in test/main.pony
). This fact has so far frustrated my attempts to make a more minimal test case, but I’ll keep trying.
Is the issue perhaps related to this loop from the _TestCanvas
test?
This is on Fedora 29, kernel 5.0.4-200, using ponyc straight from the Fedora copr repository, per the readme.
$ ponyc --version
0.28.0 [release]
compiled with: llvm 3.9.1 -- cc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)
Defaults: pic=false ssl=openssl_1.1.0
I’m very willing to provide more information upon request.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (16 by maintainers)
If this is looking like a bug in earlier versions of LLVM, I’m tempted to say we shouldn’t bother investigating further until it’s been reproduced on a more recent version of LLVM.
I tested this on my Arch Linux desktop:
I tried 7.0.1 and 3.9.1:
It worked 10 times with 7.0.1 and failed 5 in 10 times with 3.9.1:
I can try testing this in conjunction with #3122 for multiple LLVM versions.