[swift-users] Is URLSession actually working on Linux
alblue at apple.com
Wed Oct 4 03:48:33 CDT 2017
> On 3 Oct 2017, at 19:15, Geordie Jay via swift-users <swift-users at swift.org> wrote:
> 2017-10-03 20:10 GMT+02:00 Georgios Moschovitis via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>>:
> I implemented a simple RSS feed aggregator. I used code like...
> let data = try! Data(contentsOf: feedURL)
> let session = URLSession(configuration: URLSessionConfiguration.default)
> let task = session.dataTask(with: url, completionHandler: completionHandler)
> ...to fetch the data.
> While my application worked perfectly when running on macOS, when I tried to run
> it on Ubuntu it started crashing randomly with errors like...
> *** Error in `bin/….': double free or corruption (fasttop): 0x00007f3880000ff0 ***
There were some issues which were fixed on the swift-4 branch but which didn't make it in before the swift 4.0 release was cut. These fixes will be in the next point release of Swift.
Have you tried the code with the latest nightly build to verify whether that has fixed the issue you're seeing?
> Are there any issues with the implementation of Foundation for Linux?
> tldr; Pretty sure, yes.
There has been a reasonable amount of work put in recently, particularly with Data and URLSession.
You can have a look at the list of open issues for Foundation on Linux:
Note that some of the issues may have been recently closed but not made it into a release.
One of my colleagues recently fixed an issue with concurrent data races, which has a similar effect to the one you're describing but may not be the same:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users