Re: [PATCH] fat: avoid stack overflow warning

From: Arnd Bergmann

Date: Thu May 21 2026 - 12:22:24 EST


On Thu, May 21, 2026, at 14:36, David Laight wrote:
> On Fri, 15 May 2026 22:44:46 +0200
> Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
>> From: Arnd Bergmann <arnd@xxxxxxxx>
>>
>> Building the fat kunit tests on with -fsanitize=alignment
>> reveals some rather excessive stack usage:
>
> What on earth is -fsanitize=alignment doing here?
> (Or even what do it do in general!)

The idea is that the compiler adds sanity checks on accesses
to variables that may be misaligned and print a runtime
warning if this actually happens, see lib/ubsan.c.

As I understand it, the increased stack usage is an
unintended side-effect here, which is the result of
skipping some of the default optimization steps or
being less aggressive about function inlining.

Arnd