Fix segfaults with debug mode code on 64-bit Arm #3875
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While getting pony working on 64-bit Arm, we found a bug where the
test-stdlib-debug
tests would segfault. Everything worked fine withrelease
builds, but
debug
builds would crash.After investigation, we've found that in
codegen_machine
inhost.cc
if theopt_level
is get to eitherCodeGenOpt::Default
orCodeGenOpt::Aggressive
instead of
CodeGenOpt::None
the problem goes away.It seems likely that this is an LLVM bug, but that hasn't been established.
We've committed a fix in
host.cc
that when the target isarm
(which is64-bit arm) that we use
CodeGenOpt::Default
. This is far from ideal, but getsus working compilations until we can investigate further.
The end result of this should either be a patch that we upstream to LLVM or
possibly, the discovery that we are doing something wrong with our Arm code
generation that optimization manages to fix.