raiden00pl commented on PR #18837:
URL: https://github.com/apache/nuttx/pull/18837#issuecomment-4885367716
here full report:
> Your PL011 refactor is fine. The failure is a latent KASAN linker-script
bug in the arm64 board that your refactor happens to trigger.
>
> The chain of reasoning
>
> 1. Only one config fails: qemu-armv8a:citest — and it's the only arm64
config with CONFIG_MM_KASAN_GLOBAL=y. citest_smp and every nsh* config (no
KASAN) pass. That's the whole tell.
> 2. The failure is NTFC device boot timeout (~9 s window) — the guest
never emits nsh>.
> 3. I reproduced the exact CI build+run locally (CMake + your CI QEMU
command line, aarch64-gcc 14.2): it boots to nsh> in 0.09 s, 8/8, KASAN table
converges, sections sane. So — like you and the maintainers — I can't make it
fail. That proves it's
> layout/toolchain-sensitive, not a code bug.
> 4. boards/arm64/qemu/qemu-armv8a/scripts/dramboot.ld places the writable
.kasan.unused/.kasan.global and .kasan.shadows sections before .text with no
memory region.
> 5. I found upstream commit 85337c0efc (merged 2026-07-03) that fixes
exactly this — but only for armv7a. Its message spells out the mechanism:
writable KASAN sections before .text get silently relocated by the linker to
0x40000000, making an extra LOAD segment that
> collides with QEMU virt's RAM/DTB → boot failure; and .kasan.shadows
before .text breaks multi-pass link convergence.
> 6. The arm64 script was never fixed, and your PR (dated 2026-05-24)
predates the commit, so it also lacks the matching CMake strip step.
>
> Why it's intermittent / CI-only / Make-works
>
> The linker's silent relocation to 0x40000000 depends on toolchain and on
the size/content of the writable KASAN sections. Your refactor moved the PL011
global buffers/structs, changing .kasan.global enough to flip GitHub's
toolchain into the "bad" placement. Modern local
> toolchains keep the sections contiguous (my build), and the Makefile
path already strips them — so nothing reproduces locally.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]