Skip to content

[SR-11408] Foundation.Process: can invoke run() again without error #3290

Closed
@weissi

Description

@weissi
Previous ID SR-11408
Radar rdar://problem/54952347
Original Reporter @weissi
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, backport-candidate
Assignee @spevans
Priority Medium

md5: 2a5c53d5eaaf88de193a0076bd76fffb

Issue Description:

the following program should print OK:

import Foundation

let p = Process()
#if os(Linux)
p.executableURL = URL(fileURLWithPath: "/bin/true")
#else
p.executableURL = URL(fileURLWithPath: "/usr/bin/true")
#endif

try! p.run()
p.waitUntilExit()

do {
    try p.run()
    print("ERROR: run ran again!")
} catch {
    print("OK")
}
p.waitUntilExit()

because the second call to run must fail. But it doesn't on Linux (5.0.3):

$ swift repro.swift # Darwin
OK
$ jw-docker-swift-5.0 swift repro.swift # Linux
ERROR: run ran again!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions