From: Aurelien Jarno <aurelien@aurel32.net>
To: spacemit@lists.linux.dev
Cc: linux-riscv@lists.infradead.org
Subject: Random corruption on SpacemiT K1 with RVV and THP
Date: Sun, 30 Aug 2026 22:52:39 +0200 [thread overview]
Message-ID: <apSYF5x1Tu7PlyL1@aurel32.net> (raw)
Dear all,
For the last weeks, I have been tracking a random memory corruption and
relatively rare on SpacemiT K1 (Banana Pi F3 and Milk-V Jupiter). It
started upgrading to glibc 2.43, which does memset() through vector
instructions. It is reproducible using the Debian 7.1.7-1~bpo13+1
kernel, but I have also been able to reproduce it with a vanilla 7.2.2
kernel, using a similar configuration to the Debian kernel. The board
uses OpenSBI 1.9 and the vendor U-Boot.
Typically it manifests itself with the following kind of error, when
running g++ from GCC 16 as part of building software (e.g. OpenJDK,
Blender, Dolfin, Qt6):
Assembler messages:
{standard input}:284588: Error: unknown pseudo-op: `.uleb1'
{standard input}:284588: Error: unrecognized opcode `ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvl874'
The broken chars are 0xff and it seems there are always 240 (but with
poor statistics). Sometimes it instead causes a GCC ICE instead.
Using glibc 2.44 instead of glibc 2.43, which does a lot of string
operations through vector instructions, increases the probability to
have corruption, makes it a bit more reproducible, but it always seems
to manifest as a GCC ICE. It typically happens withing one hour when
running on the 8 cores instead of every 1 or 2 days. From there I have
been able to determine the following things:
- Disabling vector instructions (by patching the DTB to remove "v",
"zvhf" and "zvtk") fixes the issue
- Disabling THP (by setting /sys/kernel/mm/transparent_hugepage/enabled
to never instead of always) also seems to fix the issue. Keeping it
enabled with defrag=never or use_zero_page=0 doesn't change anything.
- The issue is reproducible with or without swap enabled.
I have not been able to reproduce the issue on other non RVV boards
(Unmatched, VF2) nor on a SpacemiT K3 board.
I am not really sure how to debug that further. I tried a few ways to
reproduce the issue with a small C code around the glibc memset code
(including triggering unaligned accesses and page faults), but failed to
do so. I therefore welcome any idea about the issue or how to debug it
further.
Thanks
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
next reply other threads:[~2026-08-30 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 20:52 Aurelien Jarno [this message]
2026-09-08 4:42 ` Random corruption on SpacemiT K1 with RVV Aurelien Jarno
2026-09-09 16:45 ` Random corruption on SpacemiT K1 (and K3) " Aurelien Jarno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=apSYF5x1Tu7PlyL1@aurel32.net \
--to=aurelien@aurel32.net \
--cc=linux-riscv@lists.infradead.org \
--cc=spacemit@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox