Hi 👋
I'm experiencing two separate but related issues when using Periphery with Xcode 16 (Swift 6) in a real-world iOS workspace (CocoaPods-based project).
1️⃣ Segmentation fault during Analyzing… (v3.3.0)
Version
Periphery 3.3.0
Xcode 16.0
Swift 6 toolchain
macOS (Apple Silicon)
Symptom
make periphery fails with:
Segmentation fault: 11 (exit 139)
The crash happens during the:
* Inspecting project...
* Building Rewards...
* Indexing...
* Analyzing...
Build and indexing complete successfully. The crash occurs specifically during the analysis phase.
Observations
- Project builds successfully via
xcodebuild.
- Index store is generated.
- Crash occurs inside the Periphery binary during analysis (reading the index store and performing reference / unused code analysis via SwiftParser / IndexStore).
- Not caused by incorrect paths or failed build.
- Workspace contains CocoaPods + SPM tooling.
This appears to be an internal crash during analysis rather than a configuration issue.
2️⃣ Swift 6 compilation failure from v3.4.0+
Starting from Periphery 3.4.0, the package fails to compile under Swift 6 (Xcode 16).
Error
/Tools/.build/checkouts/periphery/Sources/Shared/JobPool.swift:33:13:
error: 'results' used after consume
Relevant code snippet (JobPool.swift)
public func flatMap<Result>(_ block: @escaping (Job) throws -> [Result]) throws -> [Result] {
var error: Error?
let results = Mutex<[Result]>([])
DispatchQueue.concurrentPerform(iterations: jobs.count) { idx in
guard error == nil else { return }
do {
let jobResults = try block(jobs[idx])
results.withLock { $0.append(contentsOf: jobResults) }
} catch {
error = error
}
}
if let error {
throw error
}
return results.withLock { $0 }
}
Root cause hypothesis
Swift 6 introduces stricter ownership and concurrency rules.
The compiler now reports:
'results' used after consumption
This appears to be due to Mutex usage combined with concurrentPerform and Swift 6's stricter move/consume checking.
Versions ≤ 3.3.0 compile because they were built under Swift 5 rules (pre–Swift 6 enforcement).
Expected behavior
- Periphery should compile under Swift 6 / Xcode 16.
- Periphery should not crash during the
Analyzing… stage for a valid indexed workspace.
What we tested
- Running via SPM (
swift run -c release periphery)
- Running isolated via Tools/Package.swift
- Using
.xcworkspace
- Using
--skip-build
- Using existing DerivedData index
Results:
- v3.3.0 compiles but crashes during analysis (SIGSEGV).
- v3.4.0+ fails to compile under Swift 6 due to JobPool.swift.
Request
Could you confirm:
- Is there known Swift 6 compatibility work ongoing?
- Is the segmentation fault during analysis a known issue with larger CocoaPods-based workspaces?
- Is there a recommended version for Xcode 16 compatibility?
Happy to provide:
- Full crash logs
- Sample project reproduction
- Toolchain / macOS details
Thank you 🙏
Se você quiser, posso também preparar uma versão ainda mais técnica (com stack trace formatting e sugestão de patch no JobPool.swift).
Hi 👋
I'm experiencing two separate but related issues when using Periphery with Xcode 16 (Swift 6) in a real-world iOS workspace (CocoaPods-based project).
1️⃣ Segmentation fault during
Analyzing…(v3.3.0)Version
Periphery 3.3.0
Xcode 16.0
Swift 6 toolchain
macOS (Apple Silicon)
Symptom
make peripheryfails with:The crash happens during the:
Build and indexing complete successfully. The crash occurs specifically during the analysis phase.
Observations
xcodebuild.This appears to be an internal crash during analysis rather than a configuration issue.
2️⃣ Swift 6 compilation failure from v3.4.0+
Starting from Periphery 3.4.0, the package fails to compile under Swift 6 (Xcode 16).
Error
Relevant code snippet (JobPool.swift)
Root cause hypothesis
Swift 6 introduces stricter ownership and concurrency rules.
The compiler now reports:
This appears to be due to
Mutexusage combined withconcurrentPerformand Swift 6's stricter move/consume checking.Versions ≤ 3.3.0 compile because they were built under Swift 5 rules (pre–Swift 6 enforcement).
Expected behavior
Analyzing…stage for a valid indexed workspace.What we tested
swift run -c release periphery).xcworkspace--skip-buildResults:
Request
Could you confirm:
Happy to provide:
Thank you 🙏
Se você quiser, posso também preparar uma versão ainda mais técnica (com stack trace formatting e sugestão de patch no JobPool.swift).