Closed adam-fowler closed 6 months ago
With Swift 6 nightly: swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-06-a I get a crash when cancelling ServiceGroup.run
ServiceGroup.run
struct TestService: Service { func run() async throws { try await gracefulShutdown() } } await withThrowingTaskGroup(of: Void.self) { group in let serviceGroup = ServiceGroup( configuration: .init( services: [TestService()], gracefulShutdownSignals: [.sigterm, .sigint], logger: Logger(label: "JobQueueService") ) ) group.addTask { try await serviceGroup.run() } group.cancelAll() }
It crashes on this line with a EXC_BAD_ACCESS https://github.com/swift-server/swift-service-lifecycle/blob/f5780d95bdf3f740f14decb6c8c823815c883451/Sources/ServiceLifecycle/ServiceGroup.swift#L498
EXC_BAD_ACCESS
Swift --version output
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) Target: arm64-apple-macosx14.0
@adam-fowler are you able to reproduce this still?
Ok it seems to have resolved itself
With Swift 6 nightly: swift-6.0-DEVELOPMENT-SNAPSHOT-2024-04-06-a I get a crash when cancelling
ServiceGroup.run
It crashes on this line with a
EXC_BAD_ACCESS
https://github.com/swift-server/swift-service-lifecycle/blob/f5780d95bdf3f740f14decb6c8c823815c883451/Sources/ServiceLifecycle/ServiceGroup.swift#L498Swift --version output