Skip to content
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] Failed compiling Android 14 with HWASan enabled #1903

Closed
zienn opened this issue Jul 6, 2023 · 12 comments
Closed

[BUG] Failed compiling Android 14 with HWASan enabled #1903

zienn opened this issue Jul 6, 2023 · 12 comments
Labels

Comments

@zienn
Copy link

zienn commented Jul 6, 2023

Description

Failed when build android os

[2023-07-06T02:11:41.727Z] LLVM ERROR: Broken module found, compilation aborted!
[2023-07-06T02:11:41.727Z] PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace.
[2023-07-06T02:11:41.727Z]  #0 0x0000000002a047d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a047d8)
[2023-07-06T02:11:41.727Z]  #1 0x0000000002a03940 llvm::sys::RunSignalHandlers() (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a03940)
[2023-07-06T02:11:41.727Z]  #2 0x0000000002a04c2a (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a04c2a)
[2023-07-06T02:11:41.727Z]  #3 0x00007f227250f980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
[2023-07-06T02:11:41.727Z]  #4 0x00007f2271450e87 raise /build/glibc-CVJwZb/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
[2023-07-06T02:11:41.727Z]  #5 0x00007f22714527f1 abort /build/glibc-CVJwZb/glibc-2.27/stdlib/abort.c:81:0
[2023-07-06T02:11:41.727Z]  #6 0x0000000001f432e2 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x1f432e2)
[2023-07-06T02:11:41.727Z]  #7 0x0000000001ca7c45 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x1ca7c45)
[2023-07-06T02:11:41.727Z]  #8 0x000000000229cc07 llvm::UpgradeDebugInfo(llvm::Module&) (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x229cc07)
[2023-07-06T02:11:41.727Z]  #9 0x000000000285b86c (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x285b86c)
[2023-07-06T02:11:41.727Z] #10 0x000000000203e70a llvm::Module::materializeAll() (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x203e70a)
[2023-07-06T02:11:41.727Z] #11 0x000000000203e3fa llvm::BitcodeModule::getModuleImpl(llvm::LLVMContext&, bool, bool, bool, llvm::function_ref<llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (llvm::StringRef)>) (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x203e3fa)
[2023-07-06T02:11:41.727Z] #12 0x000000000228b9db llvm::BitcodeModule::parseModule(llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > (llvm::StringRef)>) (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b9db)
[2023-07-06T02:11:41.727Z] #13 0x000000000228b8c4 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b8c4)
[2023-07-06T02:11:41.727Z] #14 0x000000000228b672 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b672)
[2023-07-06T02:11:41.727Z] #15 0x000000000228b3cd (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b3cd)
[2023-07-06T02:11:41.727Z] #16 0x000000000228b2cb (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b2cb)
[2023-07-06T02:11:41.727Z] #17 0x00000000026da333 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x26da333)
[2023-07-06T02:11:41.727Z] #18 0x000000000274aea4 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274aea4)
[2023-07-06T02:11:41.727Z] #19 0x000000000274ad9f (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274ad9f)
[2023-07-06T02:11:41.727Z] #20 0x000000000274ad86 (/home/work/data/miui_codes/build_home_rom-system-merged/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274ad86)
[2023-07-06T02:11:41.727Z] #21 0x00007f22725046db start_thread /build/glibc-CVJwZb/glibc-2.27/nptl/pthread_create.c:463:0
[2023-07-06T02:11:41.727Z] #22 0x00007f227153361f __clone /build/glibc-CVJwZb/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97:0

Affected versions

r25

Canary version

No response

Host OS

Linux

Host OS version

ubuntu 20.04

Affected ABIs

arm64-v8a

Build system

ndk-build

Other build system

No response

minSdkVersion

23

Device API level

No response

@zienn zienn added the bug label Jul 6, 2023
@zienn
Copy link
Author

zienn commented Jul 6, 2023

#1899 the same issue

@pirama-arumuga-nainar
Copy link
Collaborator

Similar to #1899, re-open with a reproducer if this occurs with the newest AOSP compiler (clang-r487747c) in ToT Android sources.

@pirama-arumuga-nainar pirama-arumuga-nainar closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
@VijayLi11
Copy link

@zienn Have you solved this problem yet?

@zienn
Copy link
Author

zienn commented Jul 7, 2023

@zienn Have you solved this problem yet?

not yet. I attempted to update clang version to clang-r487747, but this issue still persists and other errors have emerged. And the call stack still print clang-r450784d

@zienn zienn changed the title [BUG] [BUG] Failed compiling Android 14 with HWASan enabled Jul 7, 2023
@pirama-arumuga-nainar
Copy link
Collaborator

And the call stack still print clang-r450784d

... which means you're not using clang-r487747. Are you building directly from AOSP or a different downstream branch?

@zienn
Copy link
Author

zienn commented Jul 11, 2023

not build from AOSP. Update in the way below.

diff --git a/cc/config/global.go b/cc/config/global.go
index e715d98..18b6cfb 100644
--- a/cc/config/global.go
+++ b/cc/config/global.go
@@ -388,9 +388,8 @@
 
 	// prebuilts/clang default settings.
 	ClangDefaultBase = "prebuilts/clang/host"
-	// TODO(b/243545528) Match upstream version
-	ClangDefaultVersion      = "clang-r450784d"
-	ClangDefaultShortVersion = "14.0.6"
+	ClangDefaultVersion      = "clang-r487747"
+	ClangDefaultShortVersion = "17"
 
 	// Directories with warnings from Android.bp files.
 	WarningAllowedProjects = []string{

@VijayLi11
Copy link

@zienn I've tried to compile with the clang-r487747, but it seems not available on android U, do you have the same issue with me?(clang-r46 have other module's error)

error: prebuilts/clang/host/linux-x86/Android.bp:390:1: module "llvm-tools": module source path "prebuilts/clang/host/linux-x86/clang-r487747/lib64/libc++.so.1" does not exist

@pirama-arumuga-nainar
Copy link
Collaborator

Only changing soong/cc/config/global.go is insufficient. We make a lot of changes/fixes in other places to get AOSP to compile (and sometimes follow-up fixes as well). Your best bet is to sync/update all projects in the source tree.

@zienn
Copy link
Author

zienn commented Jul 11, 2023

@pirama-arumuga-nainar @VijayLi11 It build successfully after updating from AOSP. I notice that the clang version is r475365b.

@VijayLi11
Copy link

VijayLi11 commented Jul 11, 2023

@pirama-arumuga-nainar @VijayLi11 It build successfully after updating from AOSP. I notice that the clang version is r475365b.

I still met the below error with the clang version clang-r475365b

(error: prebuilts/clang/host/linux-x86/Android.bp:390:1: module "llvm-tools": module source path "prebuilts/clang/host/linux-x86/clang-r475365b/lib64/libc++.so.1" does not exist)

@VijayLi11
Copy link

VijayLi11 commented Jul 11, 2023

@zienn Do you build successfully after the baseline upgrade?

@zienn
Copy link
Author

zienn commented Jul 11, 2023

@VijayLi11 yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants