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 bug(e.g., deadlock) on the lock init_mutex #140

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

An improper locking bug(e.g., deadlock) on the lock init_mutex #140

ycaibb opened this issue Sep 5, 2021 · 1 comment

Comments

@ycaibb
Copy link

ycaibb commented Sep 5, 2021

Hi, developers, thank you for your checking. It seems the lock runloop_lock is not released correctly when err = internal_init() and err = init_once() in the function groove_os_init?

libgroove/src/os.c

Lines 562 to 572 in d2b93bb

assert_no_err(pthread_mutex_lock(&init_mutex));
if (atomic_load(&initialized)) {
assert_no_err(pthread_mutex_unlock(&init_mutex));
return 0;
}
atomic_store(&initialized, true);
if ((err = internal_init()))
return err;
if ((err = init_once()))
return err;
assert_no_err(pthread_mutex_unlock(&init_mutex));

@ycaibb
Copy link
Author

ycaibb commented Sep 9, 2021

Hi, developers @andrewrk @diogocp

Any comments would be highly appreciated. Thank you.

Best Regards,

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

1 participant