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

cleanup curl handles before curl share #763

Merged
merged 1 commit into from May 23, 2018

Conversation

orozery
Copy link
Contributor

@orozery orozery commented May 21, 2018

Details

I noticed the following warning message repeatedly on my logs:

s3fs.cpp:s3fs_destroy(3438): Could not release curl library

I debugged it, and found that the reason is a failure in CURLSHE_OK != curl_share_cleanup(S3fsCurl::hCurlShare) inside S3fsCurl::DestroyShareCurl.

The libcurl documentation of curl shares says that you need to:

When you're done using the share, make sure that no easy handle is still using it, and call curl_share_cleanup(3) on the handle.

Currently, s3fs clean up curl handles AFTER the share is destroyed.
This PR fixes this problem, by switching the cleanup of curl handles to be BEFORE the cleanup of the curl share.
I verified that after this fix, the error mentioned above disappears.

@ggtakec
Copy link
Member

ggtakec commented May 23, 2018

@orozery Thanks for your help.
Now, as a response to Issue, we are investigating and testing the memory leak.
I have not got a good result yet, but I also check the initialization parts such as CURL and NSS.

@ggtakec ggtakec merged commit 212bbbb into s3fs-fuse:master May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants