Skip to content

Commit 37215fa

Browse files
authored
fix: crash when attaching to a running process (#699)
If the user clicks the button while the process list is updating, the future is canceled, and calling result() on it is undefined behavior (and crashes). ASAN just says /usr/include/c++/14/bits/stl_tree.h:359:59: runtime error: member call on null pointer of type 'const struct _Rb_tree_node'
1 parent 92b6ec6 commit 37215fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/recordpage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,8 @@ void RecordPage::updateProcessesFinished()
687687
return;
688688
}
689689

690-
m_processModel->mergeProcesses(m_watcher->result());
690+
if (!m_watcher->isCanceled())
691+
m_processModel->mergeProcesses(m_watcher->result());
691692
QTimer::singleShot(1000, this, &RecordPage::updateProcesses);
692693
}
693694

0 commit comments

Comments
 (0)