-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
cyber_monitor在第二层界面想查看repeated字段时(进入第三层界面),偶发性的coredump。 查看源码可知message_ptr_是用的刚进入第三层界面时的值,而channel_msg_ptr->raw_msg_class_是实时更新的,导致message_ptr是一个悬垂指针(message_ptr来源于raw_msg_class)。解决办法:要么舍弃实时更新repeated字段的值,要么就保存当前repeated的Protobuf 反射相关的信息,实时从raw_msg_class里面解析字段出来。
When attempting to view repeated fields in the third-level interface (after entering from the second-level), an intermittent core dump occurs.
Root Cause Analysis:
The message_ptr_ value captured upon entering the third-level interface becomes invalid when channel_msg_ptr->raw_msg_class_ is updated in real-time. This occurs because:
- message_ptr_ is derived from raw_msg_class_
- Real-time updates to raw_msg_class_ cause message_ptr_ to become a dangling pointer
Proposed Solutions:
- Disable Real-time Updates for Repeated Fields. Stop live updates of repeated field values in the third-level interface
- Persist Protobuf Reflection Metadata.Save the current repeated field's reflection information.Dynamically parse fields from raw_msg_class_ using preserved metadata
Metadata
Metadata
Assignees
Labels
No labels