Re: selftests: ftrace: WARNING: __list_del_entry_valid_or_report (lib/list_debug.c:62 (discriminator 1))

From: Naresh Kamboju
Date: Fri Nov 24 2023 - 03:54:52 EST


Hi Mark,

On Thu, 23 Nov 2023 at 23:20, Mark Rutland <mark.rutland@xxxxxxx> wrote:
>
> On Wed, Nov 22, 2023 at 10:12:51AM -0500, Steven Rostedt wrote:
> > On Wed, 22 Nov 2023 19:49:43 +0530
> > Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> wrote:
> >
> > > Hi Steven,
> > >
> > >
> > >
> > > On Tue, 21 Nov 2023 at 02:06, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> > > >
> > > > On Thu, 16 Nov 2023 18:00:16 +0530
> > > > Naresh Kamboju <naresh.kamboju@xxxxxxxxxx> wrote:
> > > [ 282.726999] Unexpected kernel BRK exception at EL1
> >
> > What's a "BRK exception"?
>
> That's triggered by a BRK instruction (software breakpoint), we use it like UD2
> on x86.
>
> > > [ 282.731840] Internal error: BRK handler: 00000000f20003e8 [#1] PREEMPT SMP
>
> That lump of hex here means "this was triggered by a BRK #1000" instruction.
>
> That immediate (0x3e8 / 1000) is what GCC/Clang use for __builtin_trap(), which
> is generated for a bunch of reasons, usually a sanitizer like UBSAN, or options
> to trap on runtime issues.

The reported "Internal error: BRK handler:'' has been noticed several times
on arm64 Juno-r2, Raspberry-pi-4 and qemu-arm64 in the past but the occurrence
is very rare (1%) and hard to reproduce.

The old report links [1] [2] [3].

As you suspected, the following configs are enabled on this build.

CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
CONFIG_UBSAN=y
CONFIG_UBSAN_TRAP=y
CONFIG_CC_HAS_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_BOUNDS=y
CONFIG_UBSAN_BOUNDS_STRICT=y
CONFIG_UBSAN_SHIFT=y
# CONFIG_UBSAN_DIV_ZERO is not set
# CONFIG_UBSAN_UNREACHABLE is not set
CONFIG_UBSAN_BOOL=y
CONFIG_UBSAN_ENUM=y
CONFIG_UBSAN_SANITIZE_ALL=y
# CONFIG_TEST_UBSAN is not set

>
> Naresh, where can I find the config used for this run? I can try to reproduce
> this and investigate.

The build artifacts are located in this link [4] and attached.
- https://storage.tuxsuite.com/public/linaro/naresh/builds/2YTWTd3fPQdanNEe0Oz59XoRfa1/

May be useful links for the previous reports on this warning / internal error:

Following boot warnings and crashes noticed on arm64 Rpi4 device running
Linux next-20230621 kernel.
[1] - https://lore.kernel.org/all/CA+G9fYuifLivwhCh33kedtpU=6zUpTQ_uSkESyzdRKYp8WbTFQ@xxxxxxxxxxxxxx/

While running selftest clone3 test cases on qemu-arm64 the following
kernel crash reported on Linux mainline kernel 6.4.0.
[2] - https://lore.kernel.org/all/CA+G9fYsuc8D98BtW9rX0ahS9Rfqyn-5CALYWTy6fr_ypJqEErA@xxxxxxxxxxxxxx/

The kernel crash reported on arm64 juno-r2 device with kselftest-merge config
while booting Linux next-20220513 kernel.
[3] - https://lore.kernel.org/all/CA+G9fYtsp-1pi6d4J71BPYh-msjzbVt_-v3YrUu12dXPeyqTDg@xxxxxxxxxxxxxx/

>
> Thanks,
> Mark.

- Naresh

Attachment: arm64-Juno-r2.config
Description: Binary data