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-5988] Memory leak in libdispatch on Linux #676
Comments
Comment by Oliver Chick (JIRA) @swift-ci create |
just FYI, valgrind sees them as lost but still reachable. The continuations don't seem to be reused properly.
full report:
|
It's possible the top-level references to |
Comment by Kim Topley (JIRA) This is an infinite loop running a function that dispatches work to a concurrent queue. At any given time, there will be blocks in flight and therefore allocated memory that hasn't yet been freed. The valgrind report was obtained when the process was sent a SIGINT signal, so I would expect there to be memory that hasn't yet been freed. Most of the entries in the report seem to be in this category as they are labeled as still reachable. The memory that is reported as possibly lost was allocated by libpthread. A more convincing test would stop and release all references to the objects that it allocated. Its not clear to me from this report that there is a leak. |
Additional Detail from JIRA
md5: 80b03af9cefdb8950af898e9b1733df6
Issue Description:
Running the code below on Linux leaks memory, but it works fine on Darwin. I don't think that the code should be leaking memory (due to the wait). Swapping the `x=x+1` for the `print()` also leaks.
My investigations suggest that the following calloc of 64 bytes is never freed:
The text was updated successfully, but these errors were encountered: