-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] armv7a + simd ld.lld segmentation fault during linking NEON code #1248
Comments
I think clang usually generates a tarball of the repro case for a crash. Does LLD not do that? If you have that, that'll help. Otherwise, it looks like we have the preprocessed source and the build commands, so hopefully that's enough (thanks for providing those!) |
r21c is already being finalized, so this will be in r21d at the earliest. |
Not in case of linker failure (ld.lld segfault), ld.lld fails at the end of entire build when starts generating assembly from precompiled byte code. The only clue is hopefully source function name. |
BTW: If You need any other output just let me know and supply clang/ld.lld command to execute. |
The input file here isn't enough to reproduce the issue unfortunately. If you pass |
Cant attach it here, after compressing with xz it take 62MB and here is 10MB file limit |
Wow, ok. I just pulled it down locally here. I can attach it internally to a bug as needed, so that others can look if necessary. You can remove your copy from your server. Thanks. |
I would be glad if You dont put my entire code here, there are all my archives after compilation. |
I'm not going to upload it to the public tracker (or even internally if I can avoid it). NDK r21b reproduces it exactly:
Using our latest toolchain, I see that the bug is still there. We'll track it down.
|
With a build from TOT LLVM, I see that we are hitting an assertion in the ARM backend. I can try to reduce this down and fix it.
|
Running just |
Have You checked ndk r20 ? |
https://bugs.llvm.org/show_bug.cgi?id=45824 is the upstream LLVM bug I filed for this. I changed to using the original reduced input file, since Pirama pointed out that I might be causing different problems when stripping away various attributes. |
Hope You will have more luck, maybe bug will be more importand, I've reported 5 bugs there all still have status NEW, 4 of them were reported 7 years ago |
I have just run into this issue today as well. My ndk is r21 as well. Have not tried on 20 though. But I did try with |
For my case I see that it is not necessarily due to any specific intrinsic. I think this is strongly tied to optimization pass as mentioned in the bug, since when I remove certain code path I was able to compile it. It was not important what I removed though. So I suspect it just triggers some optimization path that results in seg fault. |
This comment has been minimized.
This comment has been minimized.
For r22, this bug was fixed in the r399163b clang, in https://android-review.googlesource.com/c/toolchain/llvm_android/+/1440863. (The NDK bugs #1248 and #1303 might be duplicates: see https://bugs.llvm.org/show_bug.cgi?id=46615#c5.) |
5f1cad4d29 [ARM] Skip combining base updates for vld1x NEON intrinsics Bug: http://b/155835175 Bug: android/ndk#1248 Bug: android/ndk#1303 Test: ./build.py Change-Id: Id1e025241c062e8db2ea179ae141ae1ba572e85c
Description
With ndk r-21.* clang ld.lld started to fail generating neon instructions when source code uses neon intrinsics for armeabi-v7a. With ndk r-20 there is no problem and no segmentation fault during linking stage.
ndk-r21 still generates proper code for armv-8a
#0 0x0000000000e59f92 (/opt/android-sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/bin/ld.lld+0xe59f92)
#1 0x0000000000e5a727 (/opt/android-sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/bin/ld.lld+0xe5a727)
#2 0x00007f0ddea1b0b0 __restore_rt (/lib64/libpthread.so.0+0x130b0)
#3 0x000000000143b92d (/opt/android-sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/bin/ld.lld+0x143b92d)
#4 0x00007ffc234315f0
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: linker command failed due to signal (use -v to see invocation)
ninja: build stopped: subcommand failed.
Environment Details
I attached linking output with seg fault and preprocessed source code of function mentioned in linker fault. I cannot narrow down more what causes seg fault than preprocessed source file.
linking_fault.txt
yuv_to_rgb_alligned.cc.txt
The text was updated successfully, but these errors were encountered: