brpc icon indicating copy to clipboard operation
brpc copied to clipboard

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

Open zhaodongzhi opened this issue 3 years ago • 2 comments

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 avatar Jun 06 '22 03:06 zhaodongzhi

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.

wwbmmm avatar Jun 06 '22 06:06 wwbmmm

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 avatar Jun 07 '22 09:06 zhaodongzhi

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?

wwbmmm avatar Nov 23 '22 06:11 wwbmmm