| Summary: | Crash when filtering on a time range | ||
|---|---|---|---|
| Product: | [Applications] Heaptrack | Reporter: | David Faure <faure> |
| Component: | general | Assignee: | Milian Wolff <mail> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/sdk/heaptrack/commit/b9e2f195909871608842d18db071296263b84d7a | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
David Faure
2021-08-18 14:36:01 UTC
(gdb) p m_data.labels.d->size $5 = 20 (gdb) p (int) ChartRows::MAX_NUM_COST $7 = 20 178│ void ChartModel::resetData(const ChartData& data)
179│ {
180│ Q_ASSERT(data.resultData);
181├───> Q_ASSERT(m_data.labels.size() < ChartRows::MAX_NUM_COST);
182│ beginResetModel();
183│ m_data = data;
Was this means to be an assert on data rather m_data? It seems odd to test the old data we're about to replace....
Git commit b9e2f195909871608842d18db071296263b84d7a by Milian Wolff. Committed on 19/08/2021 at 06:46. Pushed by mwolff into branch 'master'. Fix latent bug in ChartData creation We created too many labeled values, leading to an overflow of the ChartRows::cost array. Previously, this assert didn't hit until filtering, because the model checked the size of the wrong container. This patch fixes this all: We now ensure we stay within ChartRows::MAX_NUM_COST but also increase it by one to keep the same size as before. Furthermore, we now correctly assert the size of the right container, and additionally check this already during parsing and not only later when the model is set. M +1 -1 src/analyze/gui/chartmodel.cpp M +1 -1 src/analyze/gui/chartmodel.h M +2 -1 src/analyze/gui/parser.cpp https://invent.kde.org/sdk/heaptrack/commit/b9e2f195909871608842d18db071296263b84d7a |