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
It took me a long time to narrow down the source of the issue
When compiling the project rnote, which relies on rodio which in turn uses oboe-sys, it gives me symbol issues
= note: ld.lld: error: undefined symbol: operator delete(void*)
>>> referenced by SourceFloatCaller.h:31 (oboe/src/common/SourceFloatCaller.h:31)
>>> 083f6a9c839ae21c-SourceFloatCaller.o:(oboe::SourceFloatCaller::~SourceFloatCaller()) in archive /home/builder/.termux-build/rnote-nuke/src/target/x86_64-linux-android/debug/deps/liboboe_sys-57071089cfae7174.rlib
>>> referenced by locale.cpp
>>> locale.cpp.o:(std::__ndk1::collate<char>::~collate()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ios<char, std::__ndk1::char_traits<char>>::~basic_ios()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 393 more times
ld.lld: error: undefined symbol: operator new(unsigned long)
>>> referenced by locale.cpp
>>> locale.cpp.o:(std::__ndk1::collate<char>::do_transform(char const*, char const*) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__iostream_category::message(int) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by locale.cpp
>>> locale.cpp.o:(std::__ndk1::collate<wchar_t>::do_transform(wchar_t const*, wchar_t const*) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 87 more times
ld.lld: error: undefined symbol: __cxa_allocate_exception
>>> referenced by new_helpers.cpp
>>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__throw_failure[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by hash.cpp
>>> hash.cpp.o:(std::__ndk1::__throw_overflow_error[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 8 more times
ld.lld: error: undefined symbol: std::bad_alloc::bad_alloc()
>>> referenced by new_helpers.cpp
>>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: typeinfo for std::bad_alloc
>>> referenced by new_helpers.cpp
>>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: std::bad_alloc::~bad_alloc()
>>> referenced by new_helpers.cpp
>>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: __cxa_throw
>>> referenced by new_helpers.cpp
>>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__throw_failure[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by hash.cpp
>>> hash.cpp.o:(std::__ndk1::__throw_overflow_error[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 8 more times
ld.lld: error: undefined symbol: std::terminate()
>>> referenced by thread.cpp
>>> thread.cpp.o:(std::__ndk1::thread::~thread()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by call_once.cpp
>>> call_once.cpp.o:(__clang_call_terminate) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by exception.cpp
>>> exception.cpp.o:(std::rethrow_exception(std::exception_ptr)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: __cxa_guard_acquire
>>> referenced by thread.cpp
>>> thread.cpp.o:(std::__ndk1::__thread_local_data()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__throw_failure[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by system_error.cpp
>>> system_error.cpp.o:(std::__ndk1::__system_error_category::default_error_condition(int) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 86 more times
ld.lld: error: undefined symbol: vtable for __cxxabiv1::__class_type_info
>>> referenced by error_category.cpp
>>> error_category.cpp.o:(typeinfo for std::__ndk1::error_category) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by memory.cpp
>>> memory.cpp.o:(typeinfo for std::__ndk1::__shared_count) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(typeinfo for std::__ndk1::ios_base) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 15 more times
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld.lld: error: undefined symbol: __cxa_guard_release
>>> referenced by thread.cpp
>>> thread.cpp.o:(std::__ndk1::__thread_local_data()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__throw_failure[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by system_error.cpp
>>> system_error.cpp.o:(std::__ndk1::__system_error_category::default_error_condition(int) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 85 more times
ld.lld: error: undefined symbol: __cxa_guard_abort
>>> referenced by thread.cpp
>>> thread.cpp.o:(std::__ndk1::__thread_local_data()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by locale.cpp
>>> locale.cpp.o:(std::__ndk1::num_get<char, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char>>>::do_get(std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char>>, std::__ndk1::istreambuf_iterator<char, std::__ndk1::char_traits<char>>, std::__ndk1::ios_base&, unsigned int&, void*&) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by locale.cpp
>>> locale.cpp.o:(std::__ndk1::num_get<wchar_t, std::__ndk1::istreambuf_iterator<wchar_t, std::__ndk1::char_traits<wchar_t>>>::do_get(std::__ndk1::istreambuf_iterator<wchar_t, std::__ndk1::char_traits<wchar_t>>, std::__ndk1::istreambuf_iterator<wchar_t, std::__ndk1::char_traits<wchar_t>>, std::__ndk1::ios_base&, unsigned int&, void*&) const) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 48 more times
ld.lld: error: undefined symbol: __cxa_begin_catch
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>::flush()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by call_once.cpp
>>> call_once.cpp.o:(__clang_call_terminate) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>::sentry::~sentry()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 4 more times
ld.lld: error: undefined symbol: __cxa_end_catch
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>::flush()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>::flush()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>::sentry::~sentry()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 6 more times
ld.lld: error: undefined symbol: vtable for std::logic_error
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::logic_error::logic_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::logic_error::logic_error(char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld.lld: error: undefined symbol: vtable for __cxxabiv1::__vmi_class_type_info
>>> referenced by memory.cpp
>>> memory.cpp.o:(typeinfo for std::__ndk1::__shared_weak_count) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(typeinfo for std::__ndk1::basic_istream<char, std::__ndk1::char_traits<char>>) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by ios.instantiations.cpp
>>> ios.instantiations.cpp.o:(typeinfo for std::__ndk1::basic_ostream<char, std::__ndk1::char_traits<char>>) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 31 more times
>>> the vtable symbol may be undefined because the class is missing its key function (see https://lld.llvm.org/missingkeyfunction)
ld.lld: error: undefined symbol: std::exception::~exception()
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::logic_error::logic_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::logic_error::logic_error(char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::runtime_error::runtime_error(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>> const&)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 1 more times
ld.lld: error: undefined symbol: __cxa_uncaught_exceptions
>>> referenced by exception.cpp
>>> exception.cpp.o:(std::uncaught_exception()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: __cxa_decrement_exception_refcount
>>> referenced by exception.cpp
>>> exception.cpp.o:(std::exception_ptr::~exception_ptr()) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
ld.lld: error: undefined symbol: __cxa_free_exception
>>> referenced by ios.cpp
>>> ios.cpp.o:(std::__ndk1::__throw_failure[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by hash.cpp
>>> hash.cpp.o:(std::__ndk1::__throw_overflow_error[abi:ne180000](char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced by stdexcept.cpp
>>> stdexcept.cpp.o:(std::__ndk1::__throw_runtime_error(char const*)) in archive /home/builder/.termux-build/_cache/android-r27-api-24-v1/bin/../sysroot/usr/lib/x86_64-linux-android/libc++_static.a
>>> referenced 5 more times
ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I managed to resolve these symbol issues by compiling with export RUSTFLAGS='-C link-args=-lc++abi -C link-arg=-L/data/data/com.termux/files/usr/lib -C link-args=-liconv'
But when I ran my application, it kept on giving me an std badcast error
~/.../target/release $ ./rnote
libc++abi: terminating due to uncaught exception of type std::bad_cast: std::bad_cast
Then I learned about the existence of gdb and used it to find the source of the issue
rust-gdb ./rnote
(gdb) catch throw
(gdb) run
Starting program: /data/data/com.termux/files/home/rnote/rnote_unoptimized_debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/data/data/com.termux/files/usr/lib/libthread_db.so".
Catchpoint 1.1 (exception thrown), 0x0000555558646800 in __cxa_throw ()
(gdb) bt full
#0 0x0000555558646800 in __cxa_throw ()
No symbol table info available.
#1 0x00005555586099bc in std::__ndk1::__throw_bad_cast[abi:ne180000]() ()
No symbol table info available.
#2 0x0000555558623553 in std::__ndk1::locale::use_facet(std::__ndk1::locale::id&) const () <-- THIS specifically
No symbol table info available.
#3 0x00007ffff6ba42b6 in ?? () from /data/data/com.termux/files/usr/lib/libc++_shared.so
Then I narrowed down which crate was responsible through looking for symbols in all my objects
find . -name "*.o" -print0 | xargs -0 nm -A | grep -i locale
./target/x86_64-linux-android/debug/build/oboe-sys-f9d3f4424b593fc5/out/library/083f6a9c839ae21c-Utilities.o: U _ZNKSt6__ndk16locale9use_facetERNS0_2idE <-- use facet
./target/x86_64-linux-android/debug/build/oboe-sys-f9d3f4424b593fc5/out/library/083f6a9c839ae21c-Utilities.o:0000000000000000 W _ZNSt6__ndk19use_facetB8nn180000INS_5ctypeIcEEEERKT_RKNS_6localeE <-- use facet
oboe sys is for some reason attempting to call use facet which is failing.
For now, I will abandon using rodio altogether but this was a real headache to figure out ngl. Hopefully this helps out someone who faces a similar issue in the future
Also, may I ask what the issue actually is and how to fix it?
The text was updated successfully, but these errors were encountered:
Android Version: Android 13
NDK Version: r27
It took me a long time to narrow down the source of the issue
When compiling the project rnote, which relies on rodio which in turn uses oboe-sys, it gives me symbol issues
I managed to resolve these symbol issues by compiling with
export RUSTFLAGS='-C link-args=-lc++abi -C link-arg=-L/data/data/com.termux/files/usr/lib -C link-args=-liconv'
But when I ran my application, it kept on giving me an std badcast error
Then I learned about the existence of gdb and used it to find the source of the issue
Then I narrowed down which crate was responsible through looking for symbols in all my objects
find . -name "*.o" -print0 | xargs -0 nm -A | grep -i locale
Dependency tree from rodio(for sound)
cargo tree
oboe sys is for some reason attempting to call use facet which is failing.
For now, I will abandon using rodio altogether but this was a real headache to figure out ngl. Hopefully this helps out someone who faces a similar issue in the future
Also, may I ask what the issue actually is and how to fix it?
The text was updated successfully, but these errors were encountered: