Skip to content
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

[SR-10240] Illegal instruction when writing to FileHandle on Linux #3501

Closed
florianreinhart opened this issue Mar 30, 2019 · 2 comments
Closed

Comments

@florianreinhart
Copy link

Previous ID SR-10240
Radar None
Original Reporter @florianreinhart
Type Bug
Status Resolved
Resolution Done
Environment

Official Docker image for Swift 5.0

Swift version 5.0 (swift-5.0-RELEASE)

Target: x86_64-unknown-linux-gnu

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, 5.0Regression
Assignee @spevans
Priority Medium

md5: fc6ebb046c3f6caa70d8bace8de15f7f

Issue Description:

Running the following Swift code with the official Swift 4.2 Docker image works as expected. However, with the Swift 5 Docker image it prints this output and exits with code 132:

Creating UTF-8 data for string ''
Writing data for string '' to file handle
Illegal instruction

Sample code:

import Foundation

class FileHandleOutputStream: TextOutputStream {
    let fileHandle: FileHandle

    init(_ fileHandle: FileHandle) {
        self.fileHandle = fileHandle
    }

    func write(_ string: String) {
        print("Creating UTF-8 data for string '\(string)'")
        let data = string.data(using: .utf8)!
        
        print("Writing data for string '\(string)' to file handle")
        self.fileHandle.write(data)
    }
}

var standardOutputStream = FileHandleOutputStream(FileHandle.standardOutput)

print("Hello", to: &standardOutputStream)
@belkadan
Copy link

belkadan commented Apr 1, 2019

cc @millenomi, @spevans

@spevans
Copy link
Collaborator

spevans commented Apr 22, 2019

#2053

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants