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 h->cache_mutex #14

Open
ycaibb opened this issue Sep 6, 2021 · 2 comments
Open

Comments

@ycaibb
Copy link

ycaibb commented Sep 6, 2021

Hi, developers, thank you for your checking. It seems the lock h->cache_mutex is not released correctly when newBlocks == NULL in the function chm_set_param?

CHMLib/src/chm_lib.c

Lines 1026 to 1035 in 2bef8d0

CHM_ACQUIRE_LOCK(h->cache_mutex);
if (paramVal != h->cache_num_blocks)
{
UChar **newBlocks;
UInt64 *newIndices;
int i;
/* allocate new cached blocks */
newBlocks = (UChar **)malloc(paramVal * sizeof (UChar *));
if (newBlocks == NULL) return;

@ycaibb
Copy link
Author

ycaibb commented Sep 9, 2021

Hi, developers @jedwing

Any comments would be highly appreciated. Thank you.

Best Regards,

@jedwing
Copy link
Owner

jedwing commented Oct 10, 2021 via email

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