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

An improper locking error due to the unreleased lock #161

Closed
ycaibb opened this issue Sep 5, 2021 · 1 comment
Closed

An improper locking error due to the unreleased lock #161

ycaibb opened this issue Sep 5, 2021 · 1 comment
Assignees

Comments

@ycaibb
Copy link

ycaibb commented Sep 5, 2021

Hi, developers, thank you for your checking. It seems the lock pool_mut could be not released correctly in the function cloudfs_connect?

pthread_mutex_lock(&pool_mut);

int cloudfs_connect()
{
 pthread_mutex_lock(&pool_mut); 
...;

  if (!safe_json_string(json_obj, access_token, "access_token"))
    return 0;  // lack unlock 
  if (!safe_json_string(json_obj, token_type, "token_type"))
    return 0; // lack unlock 

  ...;

  if (!safe_json_string(json_obj, token, "token"))
    return 0; // lack unlock 
  if (!safe_json_string(json_obj, endpoint, "endpoint"))
    return 0; // lack unlock 
  if (!safe_json_string(json_obj, expires, "expires"))
    return 0; // lack unlock 

 ...;
  pthread_mutex_unlock(&pool_mut);
  return (response >= 200 && response < 300 && storage_token[0]
          && storage_url[0]);
}

Best,

@TurboGit TurboGit self-assigned this Sep 7, 2021
@TurboGit
Copy link
Owner

TurboGit commented Sep 7, 2021

Indeed, thanks for reporting. Should be fixed now.

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

No branches or pull requests

2 participants