Skip to content

cyber_monitor bug #51

@DieYoungWsn

Description

@DieYoungWsn

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:

  1. message_ptr_ is derived from raw_msg_class_
  2. Real-time updates to raw_msg_class_ cause message_ptr_ to become a dangling pointer

Proposed Solutions:

  1. Disable Real-time Updates for Repeated Fields. Stop live updates of repeated field values in the third-level interface
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions