From a139a6f5bbbf10aba99a179bfa94196369235924 Mon Sep 17 00:00:00 2001 From: Anders Fugmann Date: Thu, 12 Mar 2026 13:31:47 +0100 Subject: [PATCH] Swift: disable stack protection in extractor to fix Linux crash The FunctionStackProtection SIL pass crashes on Linux when processing standard library functions like withUnsafePointer(to:_:). This is a known upstream Swift compiler bug (swiftlang/swift#69768). The extractor does not need stack protection since it only extracts semantic information from the AST and never produces executable code. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- swift/extractor/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swift/extractor/main.cpp b/swift/extractor/main.cpp index 8019d1bfc66..b8f720b6246 100644 --- a/swift/extractor/main.cpp +++ b/swift/extractor/main.cpp @@ -81,6 +81,9 @@ static void turnOffSilVerifications(swift::SILOptions& options) { options.VerifyExclusivity = false; options.VerifyNone = true; options.VerifySILOwnership = false; + // Stack protection is not needed for extraction and causes a crash on Linux + // (https://github.com/swiftlang/swift/issues/69768) + options.EnableStackProtection = false; } codeql::TrapDomain invocationTrapDomain(codeql::SwiftExtractorState& state);