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

error: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0). The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation. #116

Open
youssefavx opened this issue Aug 21, 2020 · 2 comments

Comments

@youssefavx
Copy link

youssefavx commented Aug 21, 2020

Sorry if this is too simple but I'm quite new to Swift so this is all unfamiliar to me. I pasted this code into xcode and got the error above:

import Foundation
import CSV

let stream = OutputStream(toFileAtPath: "file.csv", append: false)!
let csv = try! CSVWriter(stream: stream)

try! csv.write(row: ["id", "name"])
try! csv.write(row: ["1", "foo"])
try! csv.write(row: ["1", "bar"])

csv.stream.close()

Particularly it was pointing at this line: let csv = try! CSVWriter(stream: stream)

In what seems to be the console, I got this:

Fatal error: 'try!' expression unexpectedly raised an error: CSV.CSVError.cannotOpenFile: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang_Fall2018/swiftlang_Fall2018-1000.11.42/src/swift/stdlib/public/core/ErrorType.swift, line 184

@davidecastello
Copy link

@youssefavx Hi, did you by any chance solve this issue? I'm having the same problem here.

@youssefavx
Copy link
Author

@davidecastello Unfortunately not :/ haven't gone back to Swift since then, but if I ever do, reading and writing CSV files is something I do frequently so I might stumble into this situation once more in the future and try to debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants