* [PATCH] kernelshark: make sure ksmodels index is valid before use [not found] <51e122b0-8154-4e41-99ba-996ff42e5e98.ref@yahoo.com> @ 2025-10-13 20:07 ` Mircea Cirjaliu 2025-10-19 14:48 ` Yordan Karadzhov 0 siblings, 1 reply; 4+ messages in thread From: Mircea Cirjaliu @ 2025-10-13 20:07 UTC (permalink / raw) To: linux-trace-devel; +Cc: y.karadz Pressing Ctrl+C with no data loaded will lead to a crash. Steps to reproduce: Click in the trace viewer window. Press Ctrl+C. Signed-off-by: Mircea Cirjaliu <mircea.cirjaliu@yahoo.com> --- src/KsModels.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KsModels.cpp b/src/KsModels.cpp index c8a6ba3..cf4cfe9 100644 --- a/src/KsModels.cpp +++ b/src/KsModels.cpp @@ -309,7 +309,8 @@ QVariant KsViewModel::data(const QModelIndex &index, int role) const } if (role == Qt::DisplayRole) - return this->getValue(index.column(), index.row()); + if (index.isValid()) + return this->getValue(index.column(), index.row()); return {}; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kernelshark: make sure ksmodels index is valid before use 2025-10-13 20:07 ` [PATCH] kernelshark: make sure ksmodels index is valid before use Mircea Cirjaliu @ 2025-10-19 14:48 ` Yordan Karadzhov 0 siblings, 0 replies; 4+ messages in thread From: Yordan Karadzhov @ 2025-10-19 14:48 UTC (permalink / raw) To: Mircea Cirjaliu, linux-trace-devel The patch is applied. Thanks! Yordan On 10/13/25 23:07, Mircea Cirjaliu wrote: > > Pressing Ctrl+C with no data loaded will lead to a crash. > Steps to reproduce: > Click in the trace viewer window. > Press Ctrl+C. > > Signed-off-by: Mircea Cirjaliu <mircea.cirjaliu@yahoo.com> > --- > src/KsModels.cpp | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/KsModels.cpp b/src/KsModels.cpp > index c8a6ba3..cf4cfe9 100644 > --- a/src/KsModels.cpp > +++ b/src/KsModels.cpp > @@ -309,7 +309,8 @@ QVariant KsViewModel::data(const QModelIndex &index, int role) const > } > > if (role == Qt::DisplayRole) > - return this->getValue(index.column(), index.row()); > + if (index.isValid()) > + return this->getValue(index.column(), index.row()); > > return {}; > } ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <2a04a19a-5c3c-4724-862a-26fae85638dd.ref@yahoo.com>]
* [PATCH] kernelshark: make sure ksmodels index is valid before use [not found] <2a04a19a-5c3c-4724-862a-26fae85638dd.ref@yahoo.com> @ 2025-10-11 11:45 ` Mircea Cirjaliu 2025-10-12 19:42 ` Yordan Karadzhov 0 siblings, 1 reply; 4+ messages in thread From: Mircea Cirjaliu @ 2025-10-11 11:45 UTC (permalink / raw) To: linux-trace-devel; +Cc: y.karadz Pressing Ctrl+C with no data loaded will lead to a crash. Signed-off-by: Mircea Cirjaliu <mircea.cirjaliu@yahoo.com> --- src/KsModels.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/KsModels.cpp b/src/KsModels.cpp index c8a6ba3..cf4cfe9 100644 --- a/src/KsModels.cpp +++ b/src/KsModels.cpp @@ -309,7 +309,8 @@ QVariant KsViewModel::data(const QModelIndex &index, int role) const } if (role == Qt::DisplayRole) - return this->getValue(index.column(), index.row()); + if (index.isValid()) + return this->getValue(index.column(), index.row()); return {}; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kernelshark: make sure ksmodels index is valid before use 2025-10-11 11:45 ` Mircea Cirjaliu @ 2025-10-12 19:42 ` Yordan Karadzhov 0 siblings, 0 replies; 4+ messages in thread From: Yordan Karadzhov @ 2025-10-12 19:42 UTC (permalink / raw) To: Mircea Cirjaliu, linux-trace-devel Hi Mircea, There are two issues with this patch. First, please provide more detailed instruction how to reproduce the problem, because I tried "Pressing Ctrl+C with no data loaded" and I see no crash. Nevertheless, the change you suggest looks like a valid fix to me. The second issue is that the patch itself fails to apply. My guess is that your Yahoo mail server is messing the text encoding of the patch resulting in git rejecting it. Cheers, Yordan On 10/11/25 14:45, Mircea Cirjaliu wrote: > Pressing Ctrl+C with no data loaded will lead to a crash. > > Signed-off-by: Mircea Cirjaliu <mircea.cirjaliu@yahoo.com> > --- > src/KsModels.cpp | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/KsModels.cpp b/src/KsModels.cpp > index c8a6ba3..cf4cfe9 100644 > --- a/src/KsModels.cpp > +++ b/src/KsModels.cpp > @@ -309,7 +309,8 @@ QVariant KsViewModel::data(const QModelIndex &index, > int role) const > } > > if (role == Qt::DisplayRole) > - return this->getValue(index.column(), index.row()); > + if (index.isValid()) > + return this->getValue(index.column(), index.row()); > > return {}; > } ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-19 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <51e122b0-8154-4e41-99ba-996ff42e5e98.ref@yahoo.com>
2025-10-13 20:07 ` [PATCH] kernelshark: make sure ksmodels index is valid before use Mircea Cirjaliu
2025-10-19 14:48 ` Yordan Karadzhov
[not found] <2a04a19a-5c3c-4724-862a-26fae85638dd.ref@yahoo.com>
2025-10-11 11:45 ` Mircea Cirjaliu
2025-10-12 19:42 ` Yordan Karadzhov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).