On Tue, Dec 17, 2024 at 12:14 PM <devel-requ...@lists.crash-utility.osci.io>
wrote:

> Date: Tue, 17 Dec 2024 17:12:23 +1300
> From: Tao Liu <l...@redhat.com>
> Subject: [Crash-utility] Re: [PATCH] Fix incorrect 'bt -v' output
>         suggesting overflow
> To: Lucas Oakley <soak...@redhat.com>
> Cc: devel@lists.crash-utility.osci.io
> Message-ID:
>         <
> cao7dbbuq6hwh03ie6knd9ww5den0hwasgorxshzvvjxxx1-...@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Hi Lucas,
>
> Thanks for the fix, LGTM, ack.
>
>
Applied(with slight changes):

https://github.com/crash-utility/crash/commit/69aef36ff4bc374b510db6037d3b4383200a6b9f


> Thanks,
> Tao Liu
>
> On Sun, Dec 15, 2024 at 12:03 PM Lucas Oakley <soak...@redhat.com> wrote:
> >
> > Change check_stack_overflow() to check if the thread_info's cpu
> > member is smaller than possible existing CPUs, rather than the
> > kernel table's cpu number (kt->cpus). The kernel table's cpu number
> > is changed on some architectures to reflect the highest numbered
> > online cpu + 1. This can cause a false positive in
> > check_stack_overflow() if the cpu member of a parked task's
> > thread_info structure, assigned to an offlined cpu, is larger than
> > the kt->cpus but lower than the number of existing logical cpus.
> > An example of this is RHEL 7 on s390x or RHEL 8 on ppc64le when
> > the highest numbered CPU is offlined.
> >
> > Signed-off-by: Lucas Oakley <soak...@redhat.com>
> > ---
> >  task.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/task.c b/task.c
> > index 33de7da..93dab0e 100644
> > --- a/task.c
> > +++ b/task.c
> > @@ -11253,12 +11253,12 @@ check_stack_overflow(void)
> >                                 cpu = 0;
> >                                 break;
> >                         }
> > -                       if (cpu >= kt->cpus) {
> > +                       if (cpu >= get_cpus_present()) {
> >                                 if (!overflow)
> >                                         print_task_header(fp, tc, 0);
> >                                 fprintf(fp,
> >                                     "  possible stack overflow:
> thread_info.cpu: %d >= %d\n",
> > -                                       cpu, kt->cpus);
> > +                                       cpu, get_cpus_present());
> >                                 overflow++; total++;
> >                         }
> >                 }
> > --
> > 2.47.1
>
--
Crash-utility mailing list -- devel@lists.crash-utility.osci.io
To unsubscribe send an email to devel-le...@lists.crash-utility.osci.io
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

Reply via email to