-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault 11 on codegen #3445
Comments
Thanks for reporting the issue @Almaz5200. Unfortunately there isn't enough information here to determine the cause. I also cannot replicate the error in our test projects. If you can supply a standalone project that fails in the same way it would definitely help to debug the issue. If you have the full Xcode build log that may help too. |
Thank you for a quick response @calvincestari. I was able to come up with a simple project that replicates the issue: https://github.com/Almaz5200/ApolloSegFault Also note, that for demonstration purposes I've hardcoded project root path, so you'll have to change it in order to run it |
If you’re unable to reproduce the issue, please let me know, and I’ll gladly share build logs and any other information you may need. |
That project isn't failing for me @Almaz5200. There are some oddities in the output but I can get the generated operation as below: // @generated
// This file was automatically generated and should not be edited.
@_exported import ApolloAPI
import APITypes
public class TestQQuery: GraphQLQuery {
public static let operationName: String = "TestQ"
public static let operationDocument: ApolloAPI.OperationDocument = .init(
definition: .init(
#"query TestQ { sectionQueries }"#
))
public init() {}
public struct Data: APITypes.SelectionSet {
public let __data: DataDict
public init(_dataDict: DataDict) { __data = _dataDict }
public static var __parentType: any ApolloAPI.ParentType { APITypes.Objects.Query }
public static var __selections: [ApolloAPI.Selection] { [
.field("sectionQueries", String.self),
] }
public var sectionQueries: String { __data["sectionQueries"] }
}
} Which version of Xcode are you using? |
I've tried it with Xcode 15.4 and 16.0. It works fine on 15.4 and fails on 16.0 |
Are you using the latest Xcode 16.0 release, build |
Yes, I do. However I also use a pre-release macOS version, which may affect something, I'll try it on another device. |
I've tried to replicate the issue on another machine on both macOS Sonoma and macOS Sequoia (release version) with Xcode 16.0 release, and can confirm that it worked fine in all cases. |
Thanks for digging into this further @Almaz5200. It seems that there isn't anything we can debug further though; the Xcode build log isn't helping unfortunately. Given this update I'm inclined to close this issue unless you can replicate it on more than one machine. If you do get to that state then we'd be happy to take another look and try resolve it. |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Summary
I’m experiencing a runtime crash when using Apollo codegen with Xcode 16 in Swift 5 language mode. The project compiles successfully, but upon running, it crashes with a “Segmentation fault: 11” error. When debugging, the crash points to line 15 in Collection+ConcurrentCompactMap.swift.
Version
1.15.1
Steps to reproduce the behavior
Logs
Anything else?
Here's our full script:
The text was updated successfully, but these errors were encountered: