-
Notifications
You must be signed in to change notification settings - Fork 4k
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
bvar::MultiDimension::delete_stats() may cause core dump #2237
Comments
ketor
added a commit
to ketor/brpc
that referenced
this issue
May 6, 2023
…e#2237 Signed-off-by: Ketor <d.ketor@gmail.com>
ketor
added a commit
to ketor/brpc
that referenced
this issue
May 6, 2023
…he#2237) Signed-off-by: Ketor <d.ketor@gmail.com>
wwbmmm
pushed a commit
that referenced
this issue
May 8, 2023
… (#2238) Signed-off-by: Ketor <d.ketor@gmail.com>
yanglimingcn
pushed a commit
to yanglimingcn/brpc
that referenced
this issue
Jun 25, 2023
…he#2237) (apache#2238) Signed-off-by: Ketor <d.ketor@gmail.com>
yanglimingcn
pushed a commit
to yanglimingcn/brpc
that referenced
this issue
Oct 31, 2023
…he#2237) (apache#2238) Signed-off-by: Ketor <d.ketor@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug (描述bug)
There is a bug in function MultiDimension::delete_stats().
This function use a FlatMap ( MetricMap tmp_map ) and declare a lambda function clear_fn to do clear data in the DoublyBufferedData _metric_map.
But the FlatMap ( MetricMap tmp_map ) is not initialized by init() before use it to do swap().
This will cause segment fault if call get_stats() after delete_stats().
To Reproduce (复现方法)
Implement a new MulitDimension object and call get_stats() in one thread, while another thread do delete_stats() at the same time.
The DoublyBufferedData data structure is thread-safe, but brpc use a wrong method to do delete_stats() which will cause segment fault here.
Expected behavior (期望行为)
No segment fault.
Versions (各种版本)
OS: Ubuntu 22.04/ Rocky 8.x
Compiler:gcc 11
brpc:master
protobuf:3.20.3
Additional context/screenshots (更多上下文/截图)
The text was updated successfully, but these errors were encountered: