Skip to content

Fix Swift 6 / Xcode 26 compile crash in HybridBarcodeScannerOutput.sw…#3832

Open
web-iou wants to merge 1 commit intomrousavy:mainfrom
web-iou:fix/ios-swift6-buildError
Open

Fix Swift 6 / Xcode 26 compile crash in HybridBarcodeScannerOutput.sw…#3832
web-iou wants to merge 1 commit intomrousavy:mainfrom
web-iou:fix/ios-swift6-buildError

Conversation

@web-iou
Copy link
Copy Markdown

@web-iou web-iou commented May 2, 2026

Summary

Fix Swift 6 / Xcode 26 compile crash in HybridBarcodeScannerOutput.swift.

Changes

  • Avoid retain cycle in barcode scanning closure
  • Fix MLImage conversion error path
  • Improve compatibility with Swift 6 compiler

Tested

  • Xcode 26.1.1
  • iOS 26.2 device

@vercel
Copy link
Copy Markdown

vercel Bot commented May 2, 2026

Someone is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

@mrousavy
Copy link
Copy Markdown
Owner

mrousavy commented May 4, 2026

Thanks for the PR - what is the full stack trace of the crash? Why can't this be reproduced in the CI pipeline here? It builds wiht Xcode 26 as far as I know.

@web-iou
Copy link
Copy Markdown
Author

web-iou commented May 4, 2026

@node_modules/react-native-vision-camera-barcode-scanner/ios/HybridBarcodeScannerOutput.swift 1. Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1) 2. Compiling with effective version 5.10 3. While evaluating request IRGenRequest(IR Generation for file "/Users/cc/Desktop/yi_city_rn/node_modules/react-native-vision-camera-barcode-scanner/ios/HybridBarcodeScannerOutput.swift") Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 swift-frontend 0x000000010b295eb4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56 1 swift-frontend 0x000000010b293844 llvm::sys::RunSignalHandlers() + 112 2 swift-frontend 0x000000010b2964e0 SignalHandler(int, __siginfo*, void*) + 344 3 libsystem_platform.dylib 0x00000001834df744 _sigtramp + 56 4 swift-frontend 0x00000001053b2cb0 swift::irgen::IRGenModule::getAddrOfLLVMVariable(swift::irgen::LinkEntity, swift::irgen::ConstantInit, swift::irgen::DebugTypeInfo, llvm::Type*) + 136 5 swift-frontend 0x00000001054651b0 swift::irgen::emitLazyTypeMetadata(swift::irgen::IRGenModule&, swift::NominalTypeDecl*) + 104 6 swift-frontend 0x00000001053a2858 swift::irgen::IRGenerator::emitLazyDefinitions() + 644 7 swift-frontend 0x000000010553b178 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 4528 8 swift-frontend 0x000000010558c050 swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)17>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 180 9 swift-frontend 0x0000000105544734 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 856 10 swift-frontend 0x000000010553dda8 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 176 11 swift-frontend 0x0000000104ed4be8 generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 156 12 swift-frontend 0x0000000104ed0204 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2108 13 swift-frontend 0x0000000104ecf204 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1032 14 swift-frontend 0x0000000104ed2534 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1764 15 swift-frontend 0x0000000104ed1144 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3580 16 swift-frontend 0x0000000104e52724 swift::mainEntry(int, char const**) + 5412 17 dyld 0x000000018310dd54 start + 7184

Thanks for the PR - what is the full stack trace of the crash? Why can't this be reproduced in the CI pipeline here? It builds wiht Xcode 26 as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants