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-5972] libdispatch memory violation #677

Closed
swift-ci opened this issue Sep 23, 2017 · 2 comments
Closed

[SR-5972] libdispatch memory violation #677

swift-ci opened this issue Sep 23, 2017 · 2 comments

Comments

@swift-ci
Copy link

Previous ID SR-5972
Radar None
Original Reporter nuclearace (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Ubuntu 16.04, 16.10

Swift version 4.0 (swift-4.0-RELEASE)

Target: x86_64-unknown-linux-gnu

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

md5: 8b0c0306b034e4b23f88cfb8bef764f6

relates to:

  • SR-5936 URLSession crash with concurrent access

Issue Description:

The following code seems to cause a crash related to double freeing:

import CoreFoundation
import Foundation

let session = URLSession(configuration: .default)

for _ in 0..<10 {
    session.dataTask(with: URL(string: "https://google.com/")!) {data, resp, err in
        print(resp!)
    }.resume()
}

CFRunLoopRun()

Crashes with:

*** Error in `./main': double free or corruption (fasttop): 0x00007f9cb4000e30 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x790cb)[0x7f9cd192f0cb]
/lib/x86_64-linux-gnu/libc.so.6(+0x8275a)[0x7f9cd193875a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9cd193c18c]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x4ee4c)[0x7f9cd3d45e4c]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x48ddc)[0x7f9cd3d3fddc]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x49c52)[0x7f9cd3d40c52]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x440f5)[0x7f9cd3d3b0f5]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x44581)[0x7f9cd3d3b581]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x4adbd)[0x7f9cd3d41dbd]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x4acee)[0x7f9cd3d41cee]
/home/erik/.swiftenv/versions/4.0/usr/lib/swift/linux/libdispatch.so(+0x46dc8)[0x7f9cd3d3ddc8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x770a)[0x7f9cd293370a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x5f)[0x7f9cd19be0af]

I apologize for the rather vague report, but I'm not entirely sure the best way to pin this down further.

@swift-ci
Copy link
Author

Comment by Erik Little (JIRA)

Someone's told me that this might have already been fixed in the latest development release.

@swift-ci
Copy link
Author

Comment by Erik Little (JIRA)

Seems fixed in the latest 4.0.1 snapshot.

@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

1 participant