Kitura / SwiftyRequest

SwiftyRequest is an HTTP networking library built for Swift.
Apache License 2.0
110 stars 19 forks source link

SwiftyRequest crashes randomly on Linux due to NSUnimplemented #25

Closed mman closed 6 years ago

mman commented 6 years ago

Using SwiftyRequest in production randomly crashes the process with

Fatal error: seekInputStream(to:) is not yet implemented: file Foundation/URLSession/NativeProtocol.swift, line 264

Not sure where is this called from but looks like somewhere deep in Linux URLSession code, not necessarily the SwiftyRequest code.

ianpartridge commented 6 years ago

Hmm yes I think this is a limitation in the current implementation of URLSession on Linux. @pushkarnk @nethraravindran do you have any thoughts on this? Could we implement seekInputStream()?

ianpartridge commented 6 years ago

As this is not a SwiftyRequest issue per se but caused by the implementation of URLSession on Linux I'm closing this for now.

mman commented 6 years ago

This issue should not be closed as it falsely leads people to believe that SwiftyRequest works on Linux, whereas if I am not missing anything it still randomly crashes via NSUnimplemented as seekInputStream() still remains unimplemented. Thus using this library on Linux will crash randomly as of swift 4.2.

ianpartridge commented 6 years ago

I'd accept PRs updating the documentation to make this clearer. However, seekInputStream() is in the process of being implemented so this is all going to resolve itself in due course.

mman commented 6 years ago

Whatever works for you @ianpartridge. It's just that I came back after 6 months and almost accidentally pulled in SwiftyRequest believing it's all good and shiny while it still crashes.

ianpartridge commented 6 years ago

That's fair. I've just updated the README to warn people accordingly. Thank you.

mman commented 6 years ago

@ianpartridge 👍

hyouuu commented 5 years ago

Do you guys know why it happens randomly and not every time?

hyouuu commented 5 years ago
Screen Shot 2019-04-25 at 12 06 06 PM

Found someone's explanation for anyone interested