Bug 16460

Summary: AB-INT: test_rust: panic in c_str_alloc_error.rs
Product: [QA/Testing] Functional (self) Testing Reporter: Mathieu Dubois-Briand <mathieu.dubois-briand>
Component: oe-selftestAssignee: Deepesh Varatharajan <deepesh.varatharajan>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: randy.macleod, richard.purdie, sundeep.kokkonda, SunilKumar.Dora, tim.orling
Version: unspecified   
Target Milestone: 6.2   
Hardware: x86   
OS: Multiple   
Whiteboard: AB-INT
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mathieu Dubois-Briand 2026-10-19 07:29:55 UTC
> 2026-10-17 12:22:22,929 - oe-selftest - INFO - rust.RustSelfTestSystemEmulated.test_rust (subunit.RemotedTestCase)
> 2026-10-17 12:22:22,941 - oe-selftest - INFO -  ... FAIL
> ...
> AssertionError: Command 'export TARGET_VENDOR="-poky"; export OPENSSL_DIR=/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/qemuarm64-poky-linux/core-image-minimal/1.0/recipe-sysroot-native/usr; export PATH=/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/recipe-sysroot-native/usr/bin/python3-native:/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/recipe-sysroot-native/usr/bin:/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/recipe-sysroot-native/usr/bin/aarch64-poky-linux:/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/hosttools:$PATH; export RUST_TARGET_PATH=/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/rust-targets; export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd'; export TEST_DEVICE_ADDR="192.168.7.8:12345"; cd /srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work-shared/rust-source-1.99.0-r0/sources/rustc-1.99.0-src; python3 src/bootstrap/bootstrap.py --build-dir /srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/build/rust-build --config /srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/build/config.toml test  --exclude src/bootstrap  --exclude src/doc/rustc  --exclude src/doc/rustdoc  --exclude src/doc/unstable-book  --exclude src/etc/test-float-parse  --exclude src/librustdoc  --exclude src/rustdoc-json-types  --exclude src/tools/coverage-dump  --exclude src/tools/jsondoclint  --exclude src/tools/lint-docs  --exclude src/tools/remote-test-client  --exclude src/tools/replace-version-placeholder  --exclude src/tools/rust-analyzer  --exclude src/tools/rustdoc-themes  --exclude src/tools/rust-installer  --exclude src/tools/test-float-parse  --exclude src/tools/tier-check  --exclude src/tools/suggest-tests  --exclude src/tools/tidy  --exclude tests/assembly-llvm/asm/aarch64-outline-atomics.rs  --exclude tests/assembly-llvm/c-variadic/arm.rs  --exclude tests/assembly-llvm/x86_64-windows-float-abi.rs  --exclude tests/codegen-llvm/thread-local.rs  --exclude tests/mir-opt/  --exclude tests/run-make  --exclude tests/run-make-fulldeps  --exclude tests/rustdoc  --exclude tests/rustdoc-json  --exclude tests/rustdoc-js-std  --exclude tests/ui/abi/stack-probes-lto.rs  --exclude tests/ui/abi/stack-probes.rs  --exclude tests/ui/codegen/huge-stacks.rs  --exclude tests/ui/codegen/mismatched-data-layouts.rs  --exclude tests/codegen-llvm/rust-abi-arch-specific-adjustment.rs  --exclude tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs  --exclude tests/ui/feature-gates/version_check.rs  --exclude tests/ui-fulldeps/  --exclude tests/ui/process/nofile-limit.rs  --exclude tidyselftest --no-doc --no-fail-fast --bless --skip src/librustdoc --skip src/tools/rustdoc --target aarch64-poky-linux-gnu' returned non-zero exit status 1:
> ...
> thread 'main' (3904) panicked at /rustc/b940084d7eb6a299eb4bfeb8e34901bc051e7ac4/library/alloctests/tests/c_str_alloc_error.rs:55:30:
> alloc error
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> error: test failed, to rerun pass `-p alloctests --test c_str_alloc_error`
>      Running tests/vec_deque_alloc_error.rs (/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/build/rust-build/x86_64-unknown-linux-gnu/stage2-std/aarch64-poky-linux-gnu/dist/build/alloctests/d1924329daf9537f/out/vec_deque_alloc_error-d1924329daf9537f)
> uploaded "/srv/pokybuild/yocto-worker/qemuarm64-tc/build/build-st-265543/tmp/work/cortexa57-poky-linux/rust/1.99.0/build/rust-build/x86_64-unknown-linux-gnu/stage2-std/aarch64-poky-linux-gnu/dist/build/alloctests/d1924329daf9537f/out/vec_deque_alloc_error-d1924329daf9537f", waiting for result

Logs are gone already.
Comment 1 Mathieu Dubois-Briand 2026-10-19 07:36:02 UTC
qemuarm64-tc debian12-vk-9 mathieu/master-next completed at 2026-10-17 13:37:53+00:00
https://valkyrie.yocto.io/pub/non-release/20261017-66/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4812/steps/15/logs/stdio
Comment 2 Mathieu Dubois-Briand 2026-10-22 08:20:31 UTC
qemuarm64-tc debian12-vk-4 mathieu/master-next completed at 2026-10-21 10:42:33+00:00
https://valkyrie.yocto.io/pub/non-release/20261021-57/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4831/steps/15/logs/stdio
Comment 3 Mathieu Dubois-Briand 2026-10-23 07:13:47 UTC
qemuarm64-tc debian13-vk-2 mathieu/master-next-tests&mathieu/master-next completed at 2026-10-22 18:57:03+00:00
https://valkyrie.yocto.io/pub/non-release/20261022-102/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4846/steps/15/logs/stdio
Comment 5 Mathieu Dubois-Briand 2026-11-04 08:40:47 UTC
qemuarm64-tc fedora45-vk-1 mathieu/master-next completed at 2026-11-03 23:29:43+00:00
https://valkyrie.yocto.io/pub/non-release/20261103-115/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4913/steps/15/logs/stdio
Comment 7 Randy MacLeod 2026-11-05 15:55:18 UTC
Deepesh,

Have you tried to reproduce this error. Did that work?
Any ideas about how to gather more info should the issue happen again in the YP AB?
Comment 9 Deepesh Varatharajan 2026-11-10 09:38:08 UTC
Hi All,

I have tried reproducing the issue on different machines for both ARM64 and RISCV64, as the failure has so far been observed only on these two architectures. However, I haven't been able to reproduce it so far.

To help investigate if the issue occurs again in the YP AB, I have made a few changes to rust.py to enable RUST_BACKTRACE=full.

This should provide more detailed backtraces when a Rust panic occurs, helping us gather additional information and narrow down the root cause if the failure reappears.

diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
index 645b5d5fbf..5f2c62550e 100644
--- a/meta/lib/oeqa/selftest/cases/rust.py
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -116,7 +116,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
             ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
             ssh.copy_to(builddir + "/rust-build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/")
             # Execute remote-test-server on image through background ssh
-            command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
+            command = 'export RUST_BACKTRACE=full; ~/remote-test-server --bind 0.0.0.0:12345 -v'
             sshrun=subprocess.Popen(("ssh", '-o',  'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
             # Get the values of variables.
             tcpath = get_bb_var("TARGET_SYS", "rust")
@@ -127,6 +127,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):

             # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools.
             cmd = "export TARGET_VENDOR=\"-poky\";"
+            cmd = cmd + " export RUST_BACKTRACE=full;"
             cmd = cmd + " export OPENSSL_DIR=%s/usr;" %(staging_dir_native)
             cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/python3-native:%s/recipe-sysroot-native/usr/bin:%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, rustlibpath, rustlibpath, tcpath, tmpdir)
             cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath

Mathieu, could you please pick this up and include it in your testing branch?
Comment 10 Mathieu Dubois-Briand 2026-11-10 13:18:09 UTC
Sure, I added a commit in my local branch, it will be there for next builds.
Comment 11 Mathieu Dubois-Briand 2026-11-11 15:51:21 UTC
qemuriscv64-tc rocky8-vk-1 master completed at 2026-11-11 05:11:09+00:00
https://valkyrie.yocto.io/pub/non-release/20261111-8/testresults/qemuriscv64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/58/builds/2680/steps/16/logs/stdio
Comment 12 Mathieu Dubois-Briand 2026-11-12 09:09:00 UTC
qemuarm64-tc fedora45-vk-2 mathieu/master-next-tests&mathieu/master-next completed at 2026-11-11 16:02:06+00:00
https://valkyrie.yocto.io/pub/non-release/20261111-82/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4967/steps/15/logs/stdio

qemuarm64-tc fedora44-vk-3 mathieu/master-next-tests2&mathieu/master-next completed at 2026-11-11 19:25:45+00:00
https://valkyrie.yocto.io/pub/non-release/20261111-99/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4969/steps/15/logs/stdio

qemuarm64-tc alma8-vk-1 master completed at 2026-11-12 03:40:46+00:00
https://valkyrie.yocto.io/pub/non-release/20261112-9/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/4971/steps/16/logs/stdio
Comment 13 Mathieu Dubois-Briand 2026-11-13 08:53:40 UTC
qemuriscv64-tc ubuntu2404-vk-1 master completed at 2026-11-13 05:39:37+00:00
https://valkyrie.yocto.io/pub/non-release/20261113-8/testresults/qemuriscv64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/58/builds/2690/steps/15/logs/stdio
Comment 14 Deepesh Varatharajan 2026-11-16 05:26:29 UTC
Hi Mathieu,

I discussed this with upstream, and we decided to disable the test harness for this particular test.

I've pushed the changes here: https://git.openembedded.org/openembedded-core-contrib/commit/?h=deepesh/Fix-16460&id=32ed1f29fb78570536240d2e810f000f44dfee75

Could you please pick up this patch in your testing branch?

I'll send the final patch in a couple of days, provided no new failures are observed.
Comment 16 Randy MacLeod 2026-11-17 15:06:27 UTC
Deepesh, medium importance defects do not need an Mx milestone.
Comment 17 Mathieu Dubois-Briand 2026-11-18 09:00:52 UTC
qemuarm64-tc rocky9-vk-2 mathieu/master-next completed at 2026-11-17 22:44:30+00:00
https://valkyrie.yocto.io/pub/non-release/20261117-117/testresults/qemuarm64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/5/builds/5004/steps/16/logs/stdio
Comment 18 Mathieu Dubois-Briand 2026-11-19 08:08:05 UTC
qemuriscv64-tc ubuntu2510-vk-1 mathieu/master-next completed at 2026-11-18 19:49:12+00:00
https://valkyrie.yocto.io/pub/non-release/20261118-94/testresults/qemuriscv64-tc/
https://autobuilder.yoctoproject.org/valkyrie/#/builders/58/builds/2724/steps/15/logs/stdio