Skip to content

stderr is not marked as Sendable on Linux #75601

Open
@ahoppen

Description

@ahoppen

Using stderr on Linux in Swift 6 mode fails.

$ cat /tmp/a.swift 
import Foundation

fputs("Hello worlds\n", stderr)
root@jammy-latest:/tmp# swift -swift-version 6 a.swift 
a.swift:3:25: error: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state
1 │ import Foundation
2 │ 
3 │ fputs("Hello worlds\n", stderr)
  │                         ╰─ error: reference to var 'stderr' is not concurrency-safe because it involves shared mutable state
4 │ 

SwiftGlibc.stderr:1:12: note: var declared here
1 │ public var stderr: UnsafeMutablePointer<FILE>!
  │            ╰─ note: var declared here

rdar://125578486

Metadata

Metadata

Assignees

No one assigned

    Labels

    LinuxPlatform: LinuxbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.concurrencyFeature: umbrella label for concurrency language featuresstandard libraryArea: Standard library umbrellaswift 6.0unexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions