Re: [PATCH v1 01/11] perf debug: Avoid stack overflow in recursive error message
From: Ian Rogers
Date: Thu Feb 27 2025 - 00:45:19 EST
On Wed, Feb 26, 2025 at 9:40 PM Howard Chu <howardchu95@xxxxxxxxx> wrote:
>
> Hi Ian,
>
> On Wed, Jan 8, 2025 at 11:51 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
> >
> > In debug_file, pr_warning_once is called on error. As that function
> > calls debug_file the function will yield a stack overflow. Switch the
> > location of the call so the recursion is avoided.
>
> May I ask how it created the recursion? Too ignorant to understand sorry...
If _debug_file is NULL then debug_file calls pr_warning_once which
calls debug_file which calls pr_warning_once again, etc ... :-)
Thanks,
Ian
> Thanks,
> Howard