-
Notifications
You must be signed in to change notification settings - Fork 851
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
handle leak on windows #831
Comments
add my test code |
On Windows some tools report leak of handlers on pthreads, when it is statically linked. It is related to a termination code, placed in XPU CRT section by Windows version of pthreads. The code in that section is likely to be optiized when pthreads is linked statically. |
Hi Maxlovic, Thanks for your quick response. Maybe my test already linked pthreads dynamically instead of statically, My windows pthread library is from ftp://sourceware.org/pub/pthreads-win32/, i linked pthreads-win32 library from the directory pthreads-win32\2.9.1\lib\x86, under the directory, the .lib files is smaller than the .dll file, so i think these .lib file is for dynamical link. Besides, windows prompts need to load dll file without dll file when running application. lastly, I tried pthreads-win32 version 1.1.0 and version 2.9.1, the issue is reproduced in both version. Could you guide me how to link pthreads dynamically if i make some mistakes. PS, I can also use windows task manager to find this handle issue. |
Could you please describe what kind of handlers are leaking, at what are you looking at, and all the steps you do? Brief look at your code, |
Thanks for your response. Actually, to not use "goto", my code is "do ....while(0)", so it has no loop. I am not sure what kind of handlers are leaking. Maybe it is socket, I will go on researching it. It is easy to reproduce it,
or
the tool " process explore" is downloaded from https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer |
I mean, your test code should be a bit different.
Also if forget to call The code should look like this: Click to expand/collapse
P.S. You helped to find #833. :) |
Original use case, we use ffmpeg to call SRT, libsrt_open in ffmpeg includes srt_startup, libsrt_close in ffmpeg includes srt_cleanup, so my test code repeatedly call srt_starup and srt_close to simulate this case. now I only call srt_startup and srt_cleanup once, i found this issue is disappeared, QA in my company will check it. Thanks. |
@mark-tvu Good. Please close this issue once you check it. Or close now and reopen in case the issue persists. |
@mark-tvy See also PR #496. Might be worth replacing it with the solution, appeared in this discussion. |
Hi guys
The text was updated successfully, but these errors were encountered: