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

FIX BUG(Issue #1776): Switching pthread causes coredump when bthread local variable is destructed #1777

Conversation

zhaodongzhi
Copy link

@zhaodongzhi zhaodongzhi commented Jun 6, 2022

FIX BUG(Issue #1776): Switching pthread causes coredump when bthread local variable is destructed

If the bthread local destructor specified by bthread_key_create calls bthread_mutex_lock
it may cause TaskGroup::task_runner->return_keytable to switch pthreads after execution
causing coredump

@zhaodongzhi zhaodongzhi changed the title FIX BUG(Issue #462): Switching pthread causes coredump when bthread local variable is destructed FIX BUG(Issue #1776): Switching pthread causes coredump when bthread local variable is destructed Jun 6, 2022
…hread local variable is destructed

If the bthread local destructor specified by bthread_key_create calls bthread_mutex_lock
it may cause TaskGroup::task_runner->return_keytable to switch pthreads after execution
causing coredump
@zhaodongzhi zhaodongzhi force-pushed the fix-bthread-local-destroy-coredump branch from 125ee1c to f6e7627 Compare June 6, 2022 03:25
@wwbmmm
Copy link
Contributor

wwbmmm commented Jun 6, 2022

Thanks for reporting the issue and submitting this PR!
I think it's better to add some comments to explain the code, or add some test cases, to prevent future modification from breaking this case.

@zhaodongzhi
Copy link
Author

Thanks for reporting the issue and submitting this PR! I think it's better to add some comments to explain the code, or add some test cases, to prevent future modification from breaking this case.

OK! I will add some test cases and then update this pr

@wwbmmm
Copy link
Contributor

wwbmmm commented Nov 23, 2022

Thanks for reporting the issue and submitting this PR! I think it's better to add some comments to explain the code, or add some test cases, to prevent future modification from breaking this case.

OK! I will add some test cases and then update this pr

@zhaodongzhi Any update of this PR?

@chenBright
Copy link
Contributor

This bug has been fixed in #2558 .

@chenBright chenBright closed this Mar 11, 2024
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.

3 participants