-
Notifications
You must be signed in to change notification settings - Fork 45
Pr0904 #187
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
Pr0904 #187
Conversation
…tus_ backtrace: #0 0x00007ff62581cc1b in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 linuxdeepin#1 0x00007ff625807555 in __GI_abort () at abort.c:79 linuxdeepin#2 0x00007ff62580742f in __assert_fail_base (fmt=0x7ff621ac44f7 <error: Cannot access memory at address 0x7ff621ac44f7>, assertion=0x4a9d40 "false && \"Invalid index status\"", file=0x4a9cf0 "/build/deepin-anything-7.0.25/src/daemon/src/core/file_index_manager.cpp", line=627, function=<optimized out>) at assert.c:92 linuxdeepin#3 0x00007ff6258154d2 in __GI___assert_fail (assertion=0x4a9d40 "false && \"Invalid index status\"", file=0x4a9cf0 "/build/deepin-anything-7.0.25/src/daemon/src/core/file_index_manager.cpp", line=627, function=0x4aa480 "void anything::file_index_manager::save_index_status(anything::index_status)") at assert.c:101 linuxdeepin#4 0x000000000047506d in anything::file_index_manager::save_index_status(anything::index_status) () linuxdeepin#5 0x0000000000475106 in anything::file_index_manager::commit(anything::index_status) () linuxdeepin#6 0x000000000045b6f9 in base_event_handler::timer_worker(long) () linuxdeepin#7 0x00007ff625bf3b2f in () at /lib/x86_64-linux-gnu/libstdc++.so.6 linuxdeepin#8 0x00007ff6264fcfa3 in start_thread (arg=<optimized out>) at pthread_create.c:486 linuxdeepin#9 0x00007ff6258de9af in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Moved the initialization of the timer thread to occur after all other member variables are set up in the constructor, ensuring that the timer starts only after the event handler is fully initialized. Log: Fix deepin-anything-daemon core dump for uninitialized index_status_ Bug: https://pms.uniontech.com/bug-view-332619.html
As title. Log: Update version to 7.0.27
|
TAG Bot TAG: 7.0.27 |
deepin pr auto review根据提供的代码差异,我可以看到这是一个修复 deepin-anything-daemon 核心转储(core dump)问题的补丁。主要修改涉及到 语法逻辑
代码质量
代码性能
代码安全
改进建议
总体而言,这是一个合理的修复,解决了对象初始化顺序问题,避免了潜在的core dump。修改符合C++最佳实践,提高了代码的健壮性。 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refactors the initialization of the timer thread in base_event_handler to ensure it’s launched only after the object is fully initialized, improving startup correctness. Sequence diagram for base_event_handler initialization and timer thread launchsequenceDiagram
participant base_event_handler
participant timer_thread
base_event_handler->base_event_handler: Constructor called
base_event_handler->base_event_handler: Initialize member variables
base_event_handler->base_event_handler: index_dirty_ = index_manager_.refresh_indexes(...)
base_event_handler->timer_thread: Launch timer thread after initialization
timer_thread->base_event_handler: Execute timer_worker(1000)
Class diagram for updated base_event_handler initializationclassDiagram
class base_event_handler {
- batch_size_: int
- pool_: int
- stop_timer_: bool
- timer_: std::thread
- delay_mode_: bool
- index_dirty_: bool
- volatile_index_dirty_: bool
- index_status_: anything::index_status
- event_process_thread_count_: int
+ base_event_handler(std::shared_ptr<event_handler_config> config)
+ ~base_event_handler()
+ timer_worker(int interval)
}
base_event_handler --> event_handler_config
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, wangrong1069 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/merge |
Summary by Sourcery
Move timer thread initialization into the constructor body to ensure all members are fully initialized before starting the thread
Bug Fixes:
Chores: