swiftlang / swiftlang/swift-corelibs-libdispatch
[SR-10813] DispatchWorkItem leak on armv7
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2.6k
- Forks
- 496
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
| Previous ID | SR-10813 |
| Radar | None |
| Original Reporter | Pogonets (JIRA User) |
| Type | Bug |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | libdispatch |
| Labels | Bug, Leak |
| Assignee | None |
| Priority | Medium |
md5: 5987bd4bd4977311481d967a3a2e3298
Issue Description:
We found memory leak with DispatchWorkItem on android-armv7
After a quick research, this leak doesn't reproduce on linux x86_64 and android arm64
So looks like it affects all 32bit platforms
Here is a sample:
import Dispatch
let group = DispatchGroup()
let queue = DispatchQueue.global()
class A {
deinit {
print("deinit")
}
}
func test() {
let a = A()
queue.async(group: group, execute: DispatchWorkItem {
print(a)
})
}
test()
group.wait()
deinit not called
And without DispatchWorkItem this code also works fine
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided DispatchWorkItem sample on android-armv7 and compare its behavior with linux x86_64 and android arm64, where the leak does not reproduce. Trace the libdispatch component involved in DispatchWorkItem and verify the fix by confirming that A's deinit is called after group.wait().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, swift
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100