I'm seeing this warning message multiple times whenever I build any SPM (Swift Package Manager) based package: ``` warning: direct reference to protected function `$sSJ12isWhitespaceSbvg' in `/usr/libexec/swift/5.8/bin/../lib/swift/linux/libswiftCore.so' may break pointer equality ``` swift-lang version: 5.8 release: 1.fc38 Reproducible: Always Steps to Reproduce: 1. Open a terminal 2. cd into any SPM-based Swift Package 3. run `swift build` or `swift run` in the terminal Actual Results: The package is built, and it works, but this warning message is displayed multiple times: warning: direct reference to protected function `$sSJ12isWhitespaceSbvg' in `/usr/libexec/swift/5.8/bin/../lib/swift/linux/libswiftCore.so' may break pointer equality Expected Results: Packages being built without showing any warning messages I think this bug started since the update to Swift version 5.8
Taking a look, but there are some even _more_ interesting warnings with 5.9 that I'm also trying to address.
I reproduced this by building the package locally on aarch64, and got a coredump in the %build step. There seems to be only one thread running, see below. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (threadid=281473685749792, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 Downloading source file /usr/src/debug/glibc-2.38-1.fc39.aarch64/nptl/pthread_kill.c 44 return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0; (gdb) t a a bt Thread 1 (Thread 0xffffb30d8020 (LWP 78209)): #0 __pthread_kill_implementation (threadid=281473685749792, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44 #1 0x0000ffffb235f0a8 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78 #2 0x0000ffffb2315680 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #3 0x0000ffffb2300328 in __GI_abort () at abort.c:100 #4 0x0000ffffb230e46c in __assert_fail_base (fmt=0xffffb2438480 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x76bf28e "!FoundVal && \"Key already in new map?\"", file=file@entry=0x76be5a8 "/home/rjones/d/fedora/swift-lang/rawhide/swift-source/llvm-project/llvm/include/llvm/ADT/DenseMap.h", line=line@entry=408, function=function@entry=0x7855449 "void llvm::DenseMapBase<llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function *>, swift::irgen::LinkEntity, llvm::Function *, llvm::DenseMapInfo<swift::irgen::LinkEntity>, llvm::detail::DenseMapPair"...) at assert.c:92 #5 0x0000ffffb230e4e0 in __assert_fail (assertion=0x76bf28e "!FoundVal && \"Key already in new map?\"", file=0x76be5a8 "/home/rjones/d/fedora/swift-lang/rawhide/swift-source/llvm-project/llvm/include/llvm/ADT/DenseMap.h", line=408, function=0x7855449 "void llvm::DenseMapBase<llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function *>, swift::irgen::LinkEntity, llvm::Function *, llvm::DenseMapInfo<swift::irgen::LinkEntity>, llvm::detail::DenseMapPair"...) at assert.c:101 #6 0x0000000000a524e8 in llvm::DenseMapBase<llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function*, llvm::DenseMapInfo<swift::irgen::LinkEntity, void>, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*> >, swift::irgen::LinkEntity, llvm::Function*, llvm::DenseMapInfo<swift::irgen::LinkEntity, void>, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*> >::moveFromOldBuckets(llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*>*, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*>*) () #7 0x0000000000a52374 in llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function*, llvm::DenseMapInfo<swift::irgen::LinkEntity, void>, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*> >::grow(unsigned int) () #8 0x0000000000a522c8 in llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*>* llvm::DenseMapBase<llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function*, llvm::DenseMapInfo<swift::irgen::LinkEntity, void>, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*> >, swift::irgen::LinkEntity, llvm::Function*, llvm::DenseMapInfo<swift::irgen::LinkEntity, void>, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*> >::InsertIntoBucketImpl<swift::irgen::LinkEntity>(swift::irgen::LinkEntity const&, swift::irgen::LinkEntity const&, llvm::detail::DenseMapPair<swift::irgen::LinkEntity, llvm::Function*>*) () #9 0x0000000000a49c08 in swift::irgen::IRGenModule::getAddrOfValueWitness(swift::CanType, swift::irgen::ValueWitness, swift::ForDefinition_t) () #10 0x0000000000b3d658 in addValueWitness(swift::irgen::IRGenModule&, swift::irgen::ConstantStructBuilder&, swift::irgen::ValueWitness, swift::irgen::FixedPacking, swift::CanType, swift::SILType, swift::irgen::TypeInfo const&, llvm::Optional<(anonymous namespace)::BoundGenericTypeCharacteristics>) () #11 0x0000000000b3cdf0 in addValueWitnessesForAbstractType(swift::irgen::IRGenModule&, swift::irgen::ConstantStructBuilder&, swift::CanType, bool&) () #12 0x0000000000b3ca14 in swift::irgen::emitValueWitnessTable(swift::irgen::IRGe--Type <RET> for more, q to quit, c to continue without paging--c nModule&, swift::CanType, bool, bool) () #13 0x0000000000ab97a0 in swift::irgen::emitEnumMetadata(swift::irgen::IRGenModule&, swift::EnumDecl*) () #14 0x0000000000a3923c in swift::irgen::IRGenerator::emitLazyDefinitions() () #15 0x0000000000908e10 in swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const () #16 0x000000000095bbfc in swift::GeneratedModule swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::callDerived<0ul>(swift::Evaluator&, std::integer_sequence<unsigned long, 0ul>) const () #17 0x0000000000917dec in llvm::Expected<swift::IRGenRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenRequest>(swift::IRGenRequest const&) () #18 0x0000000000909d34 in swift::performIRGeneration(swift::ModuleDecl*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, llvm::GlobalVariable**) () #19 0x00000000005ce238 in generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) () #20 0x00000000005ca57c in performCompileStepsPostSILGen(swift::CompilerInstance&, std::unique_ptr<swift::SILModule, std::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) () #21 0x00000000005c991c in swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) () #22 0x00000000005db844 in withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) () #23 0x00000000005cbd0c in performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) () #24 0x00000000005caef8 in swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) () #25 0x000000000044d820 in swift::mainEntry(int, char const**) () #26 0x0000ffffb23009d8 in __libc_start_call_main (main=main@entry=0x44c6b4 <_start+52>, argc=argc@entry=185, argv=argv@entry=0xfffffcc05ee8) at ../sysdeps/nptl/libc_start_call_main.h:58 #27 0x0000ffffb2300ab0 in __libc_start_main_impl (main=0x44c6b4 <_start+52>, argc=185, argv=0xfffffcc05ee8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>) at ../csu/libc-start.c:360 #28 0x000000000044c6b0 in _start ()
Created attachment 1990047 [details] build log
Hmm, looking at the build log closely, I wonder if the two messages are actually related? The crasher assertion is: swift-frontend: /home/rjones/d/fedora/swift-lang/rawhide/swift-source/llvm-proje ct/llvm/include/llvm/ADT/DenseMap.h:408: void llvm::DenseMapBase<llvm::DenseMap< swift::irgen::LinkEntity, llvm::Function *>, swift::irgen::LinkEntity, llvm::Fun ction *, llvm::DenseMapInfo<swift::irgen::LinkEntity>, llvm::detail::DenseMapPai r<swift::irgen::LinkEntity, llvm::Function *>>::moveFromOldBuckets(BucketT *, Bu cketT *) [DerivedT = llvm::DenseMap<swift::irgen::LinkEntity, llvm::Function *>, KeyT = swift::irgen::LinkEntity, ValueT = llvm::Function *, KeyInfoT = llvm::De nseMapInfo<swift::irgen::LinkEntity>, BucketT = llvm::detail::DenseMapPair<swift ::irgen::LinkEntity, llvm::Function *>]: Assertion `!FoundVal && "Key already in new map?"' failed.
I first thought this warning (warning: direct reference to protected function `$sSJ12isWhitespaceSbvg' in `/usr/libexec/swift/5.8/bin/../lib/swift/linux/libswiftCore.so' may break pointer equality) was due to a glibc 2.36+ issue, but it seems this warning is unique to Fedora's Swift package. I tested using Swift 5.9 (-RELEASE-ubi9) from swift.org, and it doesn't have the warning, both on Fedora 38 (glibc 2.37) and Ubuntu 23.04 (also glibc 2.37).
It seems that Apple has been quickly moving to a bug fix release that will come at some point (https://github.com/apple/swift/tags). Building the latest version of 5.9 (currently swift-5.9-DEVELOPMENT-SNAPSHOT-2023-10-04-a as of when I wrote this comment), the stack trace error is gone, but now it doesn't build on neither x86_64 nor aarch64, but in a different spot: [1298/1502][ 86%][1530.764s] cd /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/stdlib/public/libexec/swift-backtrace && /root/rpmbuild/BUILD/swift-source/build/cmake-linux-aarch64/bin/cmake -E make_directory /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/stdlib/public/libexec/swift-backtrace/LINUX/aarch64 && /root/rpmbuild/BUILD/swift-source/build/cmake-linux-aarch64/bin/cmake -E env PYTHONIOENCODING=UTF8 /usr/bin/python3 /root/rpmbuild/BUILD/swift-source/swift/utils/line-directive @/root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/stdlib/public/libexec/swift-backtrace/8ff49ac32da4f9df163a8474884e5675a263eb64.txt -- /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/./bin/swiftc -c -sdk / -target aarch64-unknown-linux-gnu -resource-dir /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/./lib/swift -O -D SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY -D SWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED -D SWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING -D SWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING -D SWIFT_ENABLE_EXPERIMENTAL_OBSERVATION -D SWIFT_RUNTIME_OS_VERSIONING -D SWIFT_STDLIB_ENABLE_UNICODE_DATA -D SWIFT_STDLIB_ENABLE_VECTOR_TYPES -D SWIFT_STDLIB_HAS_COMMANDLINE -D SWIFT_STDLIB_HAS_STDIN -D SWIFT_STDLIB_HAS_ENVIRON -Xcc -DSWIFT_STDLIB_HAS_ENVIRON -D SWIFT_THREADING_LINUX -tools-directory /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/llvm-linux-aarch64/./bin -module-cache-path /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/./module-cache -no-link-objc-runtime -D SWIFT_ENABLE_REFLECTION -module-name swift_backtrace_static_linux_aarch64 -Xfrontend -disable-objc-interop -I/root/rpmbuild/BUILD/swift-source/swift/stdlib/public/Backtracing/modules -Xcc -I/root/rpmbuild/BUILD/swift-source/swift/include -Xcc -I/root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/include -parse-as-library -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -whole-module-optimization -color-diagnostics -resource-dir /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/./lib/swift -I /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/./lib/swift/linux -o /root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/stdlib/public/libexec/swift-backtrace//LINUX/aarch64/swift_backtrace_static_linux_aarch64.o @/root/rpmbuild/BUILD/swift-source/build/buildbot_linux/swift-linux-aarch64/stdlib/public/libexec/swift-backtrace/8ff49ac32da4f9df163a8474884e5675a263eb64.txt FAILED: stdlib/public/libexec/swift-backtrace/LINUX/aarch64/swift_backtrace_static_linux_aarch64.o but I can't find _why_ it's failing.
Created attachment 1992977 [details] Build log on Fedora 38 with latest Swift 5.9
Ugh, sorry, my cat walked over my keyboard and submitted my comment before I was done. Anyway, I added my latest build output with the hopes that maybe someone can find a useful needle on this haystack of why it may be failing to build properly.
Fedora Linux 38 entered end-of-life (EOL) status on 2024-05-21. Fedora Linux 38 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.