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-8689] Ubuntu 18.04: Crash on carriage return and linefeed #3639

Closed
swift-ci opened this issue Sep 4, 2018 · 3 comments
Closed

[SR-8689] Ubuntu 18.04: Crash on carriage return and linefeed #3639

swift-ci opened this issue Sep 4, 2018 · 3 comments

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Sep 4, 2018

Previous ID SR-8689
Radar None
Original Reporter Jerrot (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

4.2 CONVERGENCE branch for Ubuntu 18.04 (August 8, 2018)

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 8962bfa51fb14e30587f7d3e202069cf

is duplicated by:

  • SR-9299 "\r\n".replacingOccurrences(of: "\n", with: "_") crashes the program

Issue Description:

I installed the 4.2 CONVERGENCE branch for Ubuntu 18.04 (August 8, 2018)

I have a 100% reproducible runtime crash in a compiled swift program when using carriage return characters (also linefeeds, I didn't test others) in this line:

var logOutput = received.replacingOccurrences(of: "\r", with: "\\r")

Notice the first parameter is the problem. \r or \n crash at runtime. This does not happen in the REPL or on macOS.

@belkadan
Copy link

belkadan commented Sep 4, 2018

Can you attach the whole program?

@swift-ci
Copy link
Contributor Author

swift-ci commented Sep 5, 2018

Comment by Timo Wälisch (JIRA)

Yes, I packaged a minimal project that causes the crash here and attached it.

This is my output:

> swift run
Compile Swift Module 'SR_8689_Sample' (1 sources)
Linking ./.build/x86_64-unknown-linux/debug/SR-8689_Sample
[1]    9690 illegal hardware instruction (core dumped)  swift run

It works perfectly fine if e.g. I remove the backslash of the first parameter.

Thanks for looking into.

@spevans
Copy link
Collaborator

spevans commented Sep 13, 2018

This PR #1687 should fix the issue. It has been merged into master.

@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