cyber_monitor bug

Open
#51 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start by tracing cyber_monitor's second-to-third-level repeated-field view and the ownership and lifetime of message_ptr_ and channel_msg_ptr_->raw_msg_class_. Compare the two proposed approaches, then verify that repeated-field viewing remains stable during real-time updates and no intermittent core dump occurs.

Written by the indexing model from the issue text.

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:

  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
Dominant language
C++
Stars
53
Forks
17
Avg merge
2d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wheelos/core

All issues in wheelos/core

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.