You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Clang Optimizer SEGFAULT while attempting to compile under certain conditionsΒ #1677
Under the circumstances explained in this test file, clang's optimizer segfaults. I can't tell with certainty what causes this SEGFAULT but hopefully this small test case is sufficient. If -O0 is provided as a compile flag, the SEGFAULT no longer occurs.
changed the title [-][Bug]: Crash while attempting to compile under certain conditions with template arguments[/-][+][Bug]: Clang Optimizer SEGFAULT while attempting to compile under certain conditions[/+]on Mar 8, 2022
The attached preprocessed TestFmt-aa59b0.cpp file appears truncated (last line is #endif // __has_keyword(__is_unsi), so I can't reproduce this more directly. Can you try reattaching that file as well as the TestFmt-aa59b0.sh script (which appears empty in the gist)?
Those work! Thank you for getting back to me quickly. It seems to happen even with our latest toolchains, so I'm going to have to resolve this with upstream LLVM first.
To give a sense of what that means for a timeline to a fix: that makes it very unlikely that it'll be in r23c (which I'm hoping to ship soon, but I've been saying that for quite a while and haven't had the time). If upstream fixes this soon we can probably get it into r25 though (and if not, hopefully one of the r25 minor releases). It won't be in r24 since that's already done and just waiting for the release process to finish, and unless upstream moves very fast this probably won't make it into an r24 minor release before r25 replaces it.
Alright thanks for looking into it! Very amazed to see the fast and helpful response. I'll be looking forward to r25 or the release that ends up incorporating the fix. Good luck!
Let me poke around a bit more, because this likely needs to be an LLVM IR reproducer (crash is during code generation), but this at least is a good point to have reached so far.
Great, thanks for confirming. With that I think all the LLVM issues triaged to r26 (aside from the lldb thing, which is another matter entirely) are fixed in the next toolchain and we're just waiting for prebuilts π
Activity
[-][Bug]: Crash while attempting to compile under certain conditions with template arguments[/-][+][Bug]: Clang Optimizer SEGFAULT while attempting to compile under certain conditions[/+]stephenhines commentedon Mar 9, 2022
The attached preprocessed TestFmt-aa59b0.cpp file appears truncated (last line is
#endif // __has_keyword(__is_unsi), so I can't reproduce this more directly. Can you try reattaching that file as well as the TestFmt-aa59b0.sh script (which appears empty in the gist)?Fernthedev commentedon Mar 9, 2022
Apologies, I should've double checked the provided information. Thank you for looking into it, here's the updated information:
Hopefully this is sufficient for diagnosing though if more information is required I'll be happy to provide.
stephenhines commentedon Mar 9, 2022
Those work! Thank you for getting back to me quickly. It seems to happen even with our latest toolchains, so I'm going to have to resolve this with upstream LLVM first.
DanAlbert commentedon Mar 9, 2022
To give a sense of what that means for a timeline to a fix: that makes it very unlikely that it'll be in r23c (which I'm hoping to ship soon, but I've been saying that for quite a while and haven't had the time). If upstream fixes this soon we can probably get it into r25 though (and if not, hopefully one of the r25 minor releases). It won't be in r24 since that's already done and just waiting for the release process to finish, and unless upstream moves very fast this probably won't make it into an r24 minor release before r25 replaces it.
Fernthedev commentedon Mar 9, 2022
Alright thanks for looking into it! Very amazed to see the fast and helpful response. I'll be looking forward to r25 or the release that ends up incorporating the fix. Good luck!
stephenhines commentedon Mar 10, 2022
Reduced test cpp file (using cvise):
Somewhat reduced command line (but I am sure I can do better here too):
Let me poke around a bit more, because this likely needs to be an LLVM IR reproducer (crash is during code generation), but this at least is a good point to have reached so far.
appujee commentedon Apr 21, 2023
The bug reproduces with clang-13 but clang-14 had the fix.
Crash: https://godbolt.org/z/63PMnzfYG
Using the same test case that @stephenhines mentioned.
$clang-13.0.1 -std=c++20 -Os -fstack-protector-strong -target aarch64-none-linux-android24 -ffunction-sections -fdata-sections -fcxx-exceptions -fexceptions -fvectorize
clang-14 works fine.
https://godbolt.org/z/34Ma4rGjj
DanAlbert commentedon Apr 21, 2023
Great, thanks for confirming. With that I think all the LLVM issues triaged to r26 (aside from the lldb thing, which is another matter entirely) are fixed in the next toolchain and we're just waiting for prebuilts π
Update LLVM to clang-r487747b.