fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM runner#1315
Merged
Conversation
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Contributor
There was a problem hiding this comment.
PR #1315 审查结果
变更内容
将 test-suit/axvisor/normal/qemu/smoke/qemu-x86_64-vmx.toml 中的 QEMU 超时时间从 180 秒提升至 600 秒。该配置用于 axvisor smoke-vmx 测试,使用 KVM 加速启动 Linux guest 并验证 success_regex 输出。
实现逻辑
PR 正确识别了问题根源:自托管 KVM runner 在 KVM 环境不稳定时,180 秒超时不足。将超时从 180s 提升到 600s(约 3.3 倍)为自托管硬件提供了足够的余量,同时不会过度延迟 CI 反馈。fail_regex、success_regex、QEMU 参数和 shell 命令均未改变,测试语义完全保留。
CI 状态
CI workflow run (27752393192) 整体状态为 conclusion: success,所有 job 均为 skipped。这是预期行为:PR 仅修改 .toml 配置文件,CI path filter 未触发实际测试 job。由于本 PR 变更的正是 CI 超时参数本身,CI 不运行测试是合理的——真正的验证将在下次 smoke-vmx 在自托管 runner 上执行时生效。
重复/重叠分析
检查了所有 open PR(#1316, #1317, #1318 等),无其他 PR 修改此文件或涉及 smoke-vmx 超时配置。无重复或冲突风险。
测试覆盖
本 PR 为纯 CI 配置变更,不涉及代码行为变更,无需新增测试。超时值的合理性通过 PR body 中描述的实际 CI 超时失败场景得到验证。
无阻塞问题
- 变更最小化,仅修改 1 个配置值
- 不改变测试语义或通过/失败判定逻辑
- 合并状态
clean,无冲突 - 不涉及
[patch.crates-io]、依赖变更或代码修改
结论:批准合入。
Powered by mimo-v2.5-pro
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 18, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 18, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 18, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
SongShiQ
pushed a commit
to SongShiQ/tgoskits
that referenced
this pull request
Jun 19, 2026
…ner (rcore-os#1315) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
54dK3n
pushed a commit
to 54dK3n/tgoskits
that referenced
this pull request
Jun 21, 2026
…ner (rcore-os#1315) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
ZR233
added a commit
that referenced
this pull request
Jun 21, 2026
* feat(starry-kernel): x86_64 ptrace register r/w and PTRACE_SINGLESTEP support
补齐 x86_64 ptrace 主干功能:
- 新增 `X8664UserRegs` 结构体 (repr(C)),对应 Linux
`user_regs_struct`,含 r15..rsp/ss/fs_base/gs_base 全部 27 个字段
- 实现 `From<UserContext> for X8664UserRegs` 和 `write_to()`
- 补齐 x86_64 上之前缺失的 ptrace opcode:
GETREGS / SETREGS / GETREGSET(NT_PRSTATUS) / SETREGSET(NT_PRSTATUS) /
GETSIGINFO / SETSIGINFO
- 将 `ptrace_getregset_prstatus` 中 `regs` 局部变量从内部 block 提升到
函数级作用域,修复 reg_bytes slice 的 use-after-free bug(regs 出 block
后被栈复用覆盖,导致用户态读到随机值,表现为 RSP=0x1)
- 新增 `ptrace_setup_singlestep` for x86_64:设置 RFLAGS 的 TF (bit 8)
触发 CPU 单步执行
- 为 x86_64 添加 singlestep setup 调用(之前仅 riscv64)
- 新增 `ExceptionKind::Debug` 处理分支:命中 traced task 的 #DB
异常时,清除 TF 并调用 ptrace_stop_current(SIGTRAP)
- Intel SDM 规定 CPU 在交付 TF 诱导的 #DB 时会清除 pushed RFLAGS
中的 TF,但 QEMU 不完全遵守,故显式清除防止 resume 后再次单步
| 测试 | 验证内容 |
|------|----------|
| test-ptrace-x86-regs | TRACEME -> GETREGS/GETREGSET/SETREGS/SETREGSET 闭环 |
| test-ptrace-exec-stop | TRACEME + execve -> SIGTRAP + DETACH |
| test-ptrace-x86-breakpoint | 双测试:software int3 最小闭环 + SINGLESTEP 基础验证 |
| test-ptrace-x86-singlestep | PTRACE_SINGLESTEP 执行一条指令后以 SIGTRAP stop |
| test-ptrace-x86-breakpoint-reinsert | gdb 风格断点恢复:rewind RIP -> 恢复原字节 -> SINGLESTEP -> 重新插入断点 -> 再次命中 |
| test-gdb-native-batch | gdb -q -batch 端到端:break native_marker / run / bt / info registers / continue |
所有 6 个 x86_64 ptrace case 全部通过。
* feat(starry): add gdb smoke test app and update mount-umount2 compat docs
- apps/starry/gdb: gdb --version smoke test for x86_64 QEMU
(qemu-x86_64.toml, build-x86_64-unknown-none.toml, prebuild.sh)
- docs: update mount-umount2 Linux compat documentation with
shared/private/slave/unbindable propagation, bind subdirectory,
MS_MOVE ELOOP, MS_REMOUNT|MS_BIND|MS_RDONLY semantics
* fix(starry-kernel): gate #DB handler behind #[cfg(target_arch = "x86_64")]
ExceptionKind::Debug and uctx.rflags only exist on x86_64, but the
Debug exception handler in user.rs had no cfg guard, leaking x86_64
single-step logic into all architecture builds. Wrap the entire
block in #[cfg(target_arch = "x86_64")].
Fixes CI failures on loongarch64/aarch64/riscv64.
* test(starryos): extend gdb batch timeout
* test(starryos): isolate gdb apk install stage
* fix(starry-kernel): harden x86_64 ptrace reg writes
* fix(starryos): bundle gdb runtime for batch test
* fix(apps): replace docker-run gdb install with qemu-user + native apk
The prebuild script used 'docker run alpine:edge apk add gdb' which requires
the Docker daemon that is not available inside the CI container. Switch to
qemu-x86_64-static + native apk, consistent with gdb-smoke/prebuild.sh.
* fix(apps): use musl ld directly instead of qemu-user for same-arch x86_64 gdb install
qemu-x86_64-static hangs when emulating x86_64 binaries on an x86_64
host during network-heavy operations like 'apk' package downloads. Use
the musl dynamic linker (ld-musl-x86_64.so.1) from the staging rootfs
to run Alpine apk natively without any emulation layer.
* fix(apps): fix gdb app prebuild with musl ld and complete runtime assets
Replace docker-run-based gdb install with native musl ld execution
of Alpine apk, fixing DNS resolution for the staging root.
Add missing gdb/Python runtime assets to overlay:
- /usr/share/gdb/ (gdb Python modules, syscalls, system-gdbinit)
- /usr/lib/python3.12/ (Python stdlib)
- /usr/lib/python312.zip
- libpython3.12.so*
- /usr/bin/python3
* fix(apps): enable virtio-blk and virtio-net drivers for gdb app
The build config only had the 'qemu' feature which does not
automatically enable virtio drivers. Without ax-driver/virtio-blk,
the kernel cannot detect the root block device, causing:
'failed to determine root device from available block devices'
Align with gdb-smoke's build config by adding the required
ax-driver/virtio-blk and ax-driver/virtio-net features.
* fix(apps): add missing virtio-gpu, virtio-input, virtio-socket features
Align gdb app build config with gdb-smoke and test-suit configs.
* fix(axbuild): handle symlinks in overlay injection via debugfs
CMake install(PROGRAMS ...) preserves symlinks from the staging
rootfs, which causes inject_overlay to fail with:
'unsupported overlay entry ... only regular files and directories
are supported'
When a symlink is encountered during overlay traversal, use debugfs
symlink command to create the symbolic link in the target ext4 image
instead of bailing out.
* chore(ci): trigger re-run
* chore(ci): trigger re-run 2
* fix(starry-kernel): add x86_64 ptrace FP register support (GETFPREGS/SETFPREGS/NT_FPREGSET)
* fix(axbuild): swap debugfs symlink args to link-path-first order
The debugfs symlink command expects "symlink <link_path> <target>"
matching mke2fs convention. Also harden the x86_64 ptrace test with
canary-fork cleanup detection and kernel fault regexes.
* fix(starry-kernel): detach live tracees when tracer exits
* fix(starry-kernel): align x86 ptrace fp snapshots
* fix(starry-kernel): stabilize x86 native gdb ptrace flow
* fix(starry-kernel): clean up ptrace gdb follow-up fixes
* fix(starry-mm): fix file_read_offset computation for unaligned COW split
When vaddr < file_vaddr_base (page-aligned-down start in
unaligned mappings), the saturating_sub returned 0 instead of
correctly subtracting the gap from file_start. This caused
wrong file data to be read after mprotect-induced VMA splits.
Fixes bug-unaligned-cow-split test failure on loongarch64.
* fix(starry-kernel): fix clippy manual_is_multiple_of warning
* fix(starry-mm): extend file_end to cover PT_TLS init image and add execve diagnostics
- map_elf(): scan PT_TLS segments and extend last PT_LOAD file_end
so the COW backend can serve TLS init-image page faults for
the dynamic linker. Without this, ldso sees zeroed TLS data
on riscv64, leading to pc=0 crashes after execve.
- execve: add diagnostic logging for entry/sp/tp/ldso presence
to help debug future user-mode startup failures.
* fix(starry-mm): add AT_NULL auxv terminator to prevent ldso out-of-bounds scan
The auxv constructed in ElfLoader::load() was missing the AT_NULL
(type=0) terminator that the musl dynamic linker uses to stop scanning.
Without it, ld-musl reads past the auxv array into environment string
data on the stack, interpreting arbitrary bytes as auxv entries.
The second exec in init.sh ("exec /bin/sh -l -i") inherits env vars
from the first shell, reshaping the stack so that the out-of-bounds
scan hits garbage aliasing AT_PHDR or AT_ENTRY, producing pc=0 SIGSEGV
with exit code 139. The first exec succeeds only by coincidence — its
empty envp produces a less harmful stack layout.
Fix: push AuxEntry::new(AuxType::NULL, 0) after AT_HWCAP to properly
terminate the auxv.
* chore(ci): re-trigger CI
* test(starry): add SIGSEGV detection to board test fail_regex patterns
OrangePi-5-Plus and SG2002 board tests were timing out after 300-600s
because SIGSEGV crashes (busybox mesg, busybox shell) were not caught
by fail_regex, so the runner waited for the full timeout instead of
failing fast.
Add three patterns to all board test TOMLs:
- '(?i)segmentation fault'
- '(?i)SIGSEGV'
- 'exit with code: 139'
This ensures that any userspace SIGSEGV during boot/login is detected
immediately instead of being hidden behind a timeout.
* chore(ci): re-trigger CI after rustc segfault flake
* fix(starry-mm): add AT_NULL auxv terminator and execve/loader diagnostics
- ElfLoader::load(): add AuxType::NULL terminator to the auxv Vec
- Add info! diagnostic for entry/auxv_count/ldso/last_auxv_type
- execve: upgrade to info! with image name for crash correlation
- map_elf(): downgrade PT_TLS log to debug!
* fix(starry-mm): flush I-cache after populating executable pages on riscv64
On real hardware with non-coherent L1 I/D caches (T-Head C906 on
SG2002), a recycled physical frame from a prior exec may still
hold stale instruction-cache lines. New code bytes written via
D-cache stores by the COW backend are invisible to the I-cache
unless fence.i is executed, causing the CPU to fetch garbage
instructions and jump to pc=0.
Add fence.i (flush_icache_all) in handle_page_fault after
populating any page with EXECUTE permission. QEMU has no real
caches so this is a nop in simulation.
Also replace the stale 'TDOO: flush the I-cache' comment in
loader.rs with a note that coherence is now maintained at
fault time.
* fix(starry-mm): write back D-cache after populating executable pages on XuanTie C9xx
The SG2002 (T-Head C906) board test kept SIGSEGV-ing with pc=0 inside
ld-musl's _dlstart, even after the auxv terminator fix and an added
fence.i. Root cause: the C9xx L1 D-cache is write-back and `fence.i`
does not clean it to the point of unification. The COW backend writes
freshly-faulted code bytes into a frame through the cacheable kernel
linear mapping (phys_to_virt), leaving them in dirty D-cache lines.
The subsequent fence.i on user entry only invalidates the I-cache, so
the instruction fetch refills from stale memory and executes garbage,
jumping to 0. QEMU has no real caches, which is why it only fails on
the board.
- axcpu/riscv: add clean_dcache_range_to_pou(), a th.dcache.cva loop
(per 64-byte line) followed by th.sync.s, gated on xuantie-c9xx.
Opcodes 0x0295000b / 0x0190000b match Linux thead errata.c.
- cow backend: after populating/copying an executable page, clean the
written kernel mapping to the PoU on riscv64 so the I-fetch (after the
existing fence.i in UserContext::run) sees the new code.
- Drop the earlier ineffective fence.i in handle_page_fault; run()
already issues fence.i before every user entry, and the missing piece
was the D-cache writeback, not another I-cache invalidate.
* chore(starry-mm): dump full auxv and entry bytes for SG2002 crash triage
Temporary diagnostic: the SG2002 board still SIGSEGVs at pc=0 in
ld-musl _dlstart despite the cache-coherence fixes, and the entry
instructions execute (gp is set) before the jump to 0. To distinguish a
bad auxv (e.g. AT_ENTRY/AT_PHDR/AT_BASE) from corrupted loaded code
bytes, log every auxv entry and force-populate + hexdump the first 16
bytes at both the ldso entry and AT_ENTRY. To be reverted once root
cause is known.
* fix(starry-mm): read unaligned COW segment first page from correct file offset
The real cause of the SG2002 (and any dynamic-binary) pc=0 SIGSEGV in
ld-musl: commit 82b289c changed alloc_new_at()/file_info() so that when
vaddr < file_vaddr_base (the page-aligned-down first page of a segment
whose p_vaddr/p_offset is not page-aligned) the file offset was computed
as file_start - (file_vaddr_base - vaddr) instead of file_start.
For ld-musl the RW PT_LOAD is at vaddr=0x94b20 (holding .dynamic/GOT).
Its first page (0x94000) took the buggy branch and read the segment
bytes 0xb20 too early in the file, corrupting .dynamic/GOT. The dynamic
linker's RELATIVE self-relocation then produced garbage pointers and
jumped to 0 — deterministically, on the very first dynamic exec. The
ldso/app code pages themselves loaded fine (verified by dumping the
entry bytes), so this was never a cache-coherence problem.
The mapping invariant is simply: virtual address V maps to file offset
file_start + (V - file_vaddr_base). Restore the unified
`file_start + saturating_sub(vaddr, file_vaddr_base)` form (== the
pre-82b289cb1 code), which yields file_start for the unaligned first
page and the correct delta elsewhere. CowBackend::split keeps
file_vaddr_base/file_start intact, so the bug-unaligned-cow-split test
(which only reads page-aligned blob pages, all >= file_vaddr_base, via
the unchanged >= path) is unaffected.
Also revert the speculative XuanTie D-cache writeback and the auxv/byte
diagnostics added while chasing the wrong (cache) hypothesis.
* chore(ci): trigger CI after sync with main
* chore(starry): add proc maps area diagnostics for bug-proc-maps-lseek-refresh
* fix(starry): fix bug-proc-maps-lseek-refresh test failure
Two fixes:
1. pseudofs/proc: render_thread_maps() used '?' on backend.file_info()
which aborted the entire area iteration when an area had no name
or file backing (e.g. PROT_NONE guard pages). Use
unwrap_or_else() with a default-empty BackendFileInfo instead
so all VMAs always appear in /proc/self/maps.
2. test/proc-maps: the test's has_vma_prefix() used %08lx which
produces 8-hex-digit addresses, but the kernel uses {:016x}
(16 hex digits on 64-bit). Use %0*lx with addr_width =
sizeof(void*)*2 to match the kernel's output format.
* fix: resolve merge conflicts with upstream/dev PR #1167
- Remove duplicate ProcMemFile (old WeakAxTaskRef version)
- Remove duplicate 'mem' node in ThreadDir
- Accept upstream per-TID ptrace refactor for task/mod.rs, signal.rs, user.rs
- Keep our render_thread_maps file_info() unwind fix
* fix: complete per-TID ptrace API migration and execve stop semantics
- ptrace.rs: migrate x86_64 FP regset paths from old process-wide
ptrace_stop_fp_data()/set_ptrace_stop_fp_data() to per-TID
ptrace_stop_fp_data_for(tid)/set_ptrace_stop_fp_data_for(tid, ...)
using raw [u64;32] bytes to bridge FxsaveArea ↔ arch-independent
PtraceStopRecord storage.
- execve.rs: fix PTRACE_TRACEME exec-stop semantics. Linux requires
TRACEME'd tasks to always generate a SIGTRAP stop on execve;
PTRACE_O_TRACEEXEC only controls whether the stop carries
PTRACE_EVENT_EXEC. Move the TRACEME check outside the TRACEEXEC
option gate.
- reports: fix trailing whitespace and EOF blank lines for
diff --check compliance.
* fix(starry-kernel): correct x86_64 ptrace single-step, exec-stop and register reporting
- user.rs: arm x86_64 hardware single-step (RFLAGS.TF) for traced tracees, and
route the resulting #DB to a SIGTRAP ptrace-stop that disarms the per-TID
single-step flag and clears the saved TF (the CPU pushes EFLAGS with TF still
set), so a subsequent PTRACE_CONT runs free instead of single-stepping.
- axcpu/x86_64/trap.rs: drop the panic on an unhandled #DB; let it fall through
to the user-space exception loop (kprobe/uprobe debug handlers still win).
- ptrace.rs: report Linux-convention user selectors cs=0x33/ss=0x2b via
GETREGS/GETREGSET and accept them in SETREGS so debuggers detect a 64-bit
inferior instead of i386; correct the single-step TF comment.
- execve.rs: every ptrace tracee stops with SIGTRAP on execve (PTRACE_O_TRACEEXEC
only controls the event payload, not whether the stop occurs).
- proc.rs: drop a duplicate /proc/<pid>/mem entry in the thread dir listing.
* test(starry): convert test-gdb-native-batch to a raw-ptrace tracer
Replace the real /usr/bin/gdb driver with a self-contained raw-ptrace tracer
(matching riscv's test-ptrace-gdb), validating the kernel's ptrace on a
dynamically-linked process across execve and ld-musl startup without depending
on GDB's startup probes or target-description negotiation:
fork + PTRACE_TRACEME + execve(dynamic target) -> exec-stop -> read AT_ENTRY
from /proc/<pid>/auxv -> plant INT3 at AT_ENTRY -> PTRACE_CONT (ld-musl runs
fully under ptrace) -> trap at the application entry -> restore + single-step
-> PTRACE_CONT to exit 0.
- add c/src/tracer.c; CMakeLists builds both the dynamic target and the tracer
- qemu-x86_64.toml runs the tracer; success "DONE: N pass, 0 fail"
- remove gdb-native-batch.gdb, run-gdb-native-batch.sh, prebuild.sh (no gdb)
* test(starry): migrate x86 ptrace/gdb cases into grouped system and fix exec-stop path
Move 5 x86 ptrace/gdb test cases from undiscovered normal/qemu-smp1/ to
qemu-smp1/system/ with arch-filtered CMakeLists that install into
starry-test-suit, making them participate in the grouped CI runner.
- test-ptrace-x86-regs: remove canary fork, return exit code directly
- test-ptrace-x86-breakpoint: fix printf format string
- test-gdb-native-batch: split into tracer (starry-test-suit) and
target (usr/bin), rename to test-gdb-native-batch-tracer
Promote test-ptrace-exec-stop from starry-known-fail / riscv-only to
starry-test-suit on riscv64|x86_64. Fix hardcoded path by using
/proc/self/exe so the re-exec child finds itself under the grouped
install location.
Delete stray test-ptrace-exec-stop/qemu-x86_64.toml (double discovery).
Verified: x86_64 and riscv64 grouped system both PASS, all ptrace
binaries show STARRY_SYSTEM_TEST_PASSED.
* chore(ci): re-trigger CI after roc-rk3568 board u-boot flake
* ci: trigger test run
* ci: trigger test run
* chore: remove accidentally committed internal ptrace/gdb reports
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(axbuild): tolerate slow guests in host HTTP test server
The apk-curl-equivalence system case downloads a 20MB payload from the
host HTTP server. The server used a 1s per-write timeout and silently
discarded write errors, so whenever a slow guest (notably x86_64, the
slowest QEMU guest) applied TCP backpressure for over a second, the body
write timed out, the error was dropped, and the connection was closed
mid-stream. curl then failed with "(18) end of response with N bytes
missing", flaking the x86_64 starry qemu test.
Raise the body write timeout to 30s (still finite so a wedged guest
cannot block the server thread and its Drop/join forever) and surface
write errors instead of swallowing them.
* test(starry): wire x86 ptrace/gdb cases into grouped system runner
The new x86_64 ptrace/gdb system cases were laid out as
system/<case>/c/CMakeLists.txt + c/src/, but the qemu-smp*/system
grouped runner builds one root CMake project that only add_subdirectory()
each subcase whose CMakeLists.txt sits directly under system/<case>.
As a result these cases were never built/installed in aggregate runs and
`-c qemu-smp1/system/<case>` failed at configure time with
"unknown grouped C subcase".
Move each case to the flat system subcase layout required by
test-suit/starryos/GUIDE.md (CMakeLists.txt + src/ at the case root) and
fix the relative include of common/starry_arch_filter.cmake accordingly.
Install destinations are unchanged.
Cases: test-ptrace-x86-regs, test-ptrace-x86-breakpoint,
test-ptrace-x86-breakpoint-reinsert, test-ptrace-x86-singlestep,
test-gdb-native-batch.
* fix(starry-kernel): rebase x86_64 ptrace onto upstream/dev per-tid baseline
Replace ptrace.rs with upstream/dev version as baseline and port x86_64 code:
- Add X8664UserRegs struct + From<UserContext>/write_to/sanitize_eflags
- Add X86_64_USER_* constants + peeksuser/pokeuser/user_area_x86_64
- Add x86_64 getregs/setregs/getfpregs/setfpregs/getregset/setregset impls
- Add ptrace_setup_singlestep for x86_64 (RFLAGS.TF)
- Wire x86_64 into multi-arch dispatch gates (NT_FPREGSET/NT_PRSTATUS)
- Define x86_64 PtraceStopFpData as tuple struct + real fxsave/fxrstor
- Add x86_64 to signal.rs ptrace FP save and mod.rs save/restore
Fixes three build-blocking issues:
- ptrace_restore_singlestep_insn present for all archs (from upstream baseline)
- ptrace_setup_singlestep present for aarch64/loongarch64 (from upstream baseline)
- x86_64 FP type matches between ptrace.rs and mod.rs (tuple struct)
* fix(starry-kernel): store full FxsaveArea in x86_64 PtraceStopFpData
Replace PtraceStopFpData([u64; 32], usize) with PtraceStopFpData(FxsaveArea)
to match the 512-byte FXSAVE area. Fixes out-of-bounds memory access at
4 call sites where from_raw_parts(ptr, 512) was created from a 256-byte
[u64; 32] array — UB when the slice exceeded the allocation.
save/restore/GETFPREGS/SETFPREGS/NT_FPREGSET now directly copy the full
FxsaveArea, preserving all XMM/MXCSR state.
* fix(starry): downgrade loader/execve logs to debug, restore kernel #DB panic, add TLS contiguity comment
* test(starry): add x86_64 ptrace FP register coverage
Exercises PTRACE_GETFPREGS/SETFPREGS and NT_PRFPREG round-trip on x86_64,
checking xmm0, xmm10 (offset 320) and xmm15 (offset 400) so a regression that
preserves only part of the 512-byte FXSAVE area is caught. The child loads
known XMM values and stops via a direct kill() syscall to avoid libc clobbering
the registers; the tracer verifies the read-back, writes sentinels, and the
child confirms them after resume. Auto-discovered under qemu-smp1/system.
* fix(starry-kernel): remove duplicate ptrace_setregset_prstatus, fix axnet typo and register call
* chore: fmt execve.rs register call
* fix(starry-kernel): remove unused VirtAddr and DirectRwFsFileOps imports in proc.rs
* chore: fmt proc.rs import line
* fix(starry-kernel): gate format_statm/format_status_vm_lines with cfg(test)
* fix(starry-kernel): gate alloc::format import with cfg(test)
* chore: reorder stats.rs imports for fmt
* fix(starry-kernel): scope ptrace get/setfpregs cfg to all non-x86 arches
ptrace_getfpregs/ptrace_setfpregs use the generic ArchFpRegs path for the
non-x86 architectures, but the supported arm was gated on
any(riscv64, loongarch64) (missing aarch64) while the Unsupported fallback
was gated on not(any(riscv64, x86_64)). On loongarch64 both arms matched,
causing E0428 (duplicate definition); on aarch64 the function fell through
to the Unsupported stub instead of the real ArchFpRegs path. Widen the
supported arm to any(riscv64, aarch64, loongarch64) and the fallback to
not(any(riscv64, aarch64, loongarch64, x86_64)), matching get/setregs.
* fix(starry-kernel): restore /proc features dropped by a bad merge revert
During an earlier conflict resolution, pseudofs/proc.rs was reverted to a
pre-refactor version, silently dropping upstream features: /proc/<pid>/mem
(ProcMemFile + read_at/write_at/check_access), /proc/<pid>/status memory
stats (sample_mem_stats, TaskStatusBase/TaskStatusFields) and the namespace
directory (NsDir), plus their tests. Restore the current upstream/dev proc.rs
and re-apply the only two genuine branch-local tweaks on top: the extended
loongarch /proc/cpuinfo Feat flags, and /proc/<pid>/maps full-width addresses
with anonymous-mapping file_info tolerance.
* fix(axbuild): restore upstream overlay symlink injection
An earlier divergence replaced the two-pass overlay debugfs injection with a
single-pass variant, dropping two upstream behaviours: deferring symlink
creation until after their targets are written (debugfs validates the target),
and converting relative symlink targets to absolute guest paths. Restore the
upstream/dev implementation (which already uses link-path-first symlink args).
* fix(starry-kernel): un-gate ProcessMemStats format methods for /proc
format_statm and format_status_vm_lines had been marked #[cfg(test)] back when
the reverted proc.rs no longer called them (to avoid dead_code under -D warnings).
The restored proc.rs uses both in the real build (/proc/<pid>/statm and
/proc/<pid>/status), so the test-only gating broke non-x86 builds with E0599.
Restore upstream/dev stats.rs so the methods are available in all builds.
* chore: remove accidentally committed GitHub page snapshot
A 172KB GitHub page snapshot (Feat_x86 64 ptrace clean ... rcore-os_tgoskits@f4d00dd.html)
was swept into the branch by a stray 'git add .'. It is not source/test asset and
makes 'git diff --check' fail on trailing whitespace/EOF blank lines. Remove it and
gitignore these page snapshots so they cannot be re-committed.
* fix(starry): use STARRY_ROOTFS in gdb app prebuild
starry app qemu injects the rootfs image path as STARRY_ROOTFS, not
STARRY_BASE_ROOTFS, so the gdb prebuild failed require_env and the
GDB_SMOKE_PASSED qemu path never ran. Match the ffmpeg/pip/mosquitto apps:
read ${STARRY_ROOTFS:-${STARRY_BASE_ROOTFS:-}} and require STARRY_ROOTFS.
* refactor(starry-kernel): converge x86_64 GP registers into ArchUserRegs explicit-TID backend
- Add ArchUserRegs alias for x86_64
- Make write_to return AxResult<()> for all archs
- Expand generic read/write backends to cover x86_64
- Remove parallel x86_64 helper functions
- Unify getregs/setregs into single generic bodies
- Remove inline arch dispatch from getregset/setregset_prstatus
- Update PEEKUSER/POKEUSER user-area to generic backend
- Remove redundant selected-stop wrappers from detach_live_tracees_of
* fix(starry): use dynamic platform for gdb x86_64 app build config
The gdb app x86_64 build config pinned the legacy static x86 platform
(ax-hal/x86-pc, ax-driver/plat-static, the qemu feature, plat_dyn=false).
x86_64 Starry runs on the dynamic platform path, which registers no static
platform package, so 'cargo xtask starry app qemu -t gdb --arch x86_64'
failed at build-config with 'no default platform package is registered for
arch x86_64' and the GDB_SMOKE_PASSED path was unreachable. Drop the static
deps and match the other Starry x86_64 app configs (git/top): keep only the
virtio driver features on the dynamic platform. Verified end-to-end in the
container: boots to a shell, gdb 16.3 runs, GDB_SMOKE_PASSED.
* chore(repo): remove unused workspace crates (#1306)
* feat(axbuild): internalize Starry kallsyms flow (#1309)
* fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM runner (#1315)
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
* fix(starry): correct x86_64 u_debugreg offset in struct user
x86_64 PTRACE_PEEKUSER/POKEUSER on the debug-register area used
X86_64_USER_DEBUGREG_OFFSET = 912, but u_debugreg[] sits at offset 848 in
the x86_64 `struct user` (regs 216 + u_fpvalid/pad 8 + i387 512 + tsize/
dsize/ssize 24 + start_code/start_stack 16 + signal 8 + reserved/pad 8 +
u_ar0 8 + u_fpstate 8 + magic 8 + comm 32 = 848).
gdbserver probes the hardware debug registers (DR0–DR7) via PEEKUSER at
this offset during startup; with the wrong offset it read a bogus location
and stalled before printing "Listening on port 1234", so the x86_64
gdbserver smoke hung. The native single-process GDB smoke does not touch
debug registers, which is why only the gdbserver path was affected.
Fix the offset to 848. Verified end-to-end in the container: the x86_64
gdbserver smoke now reaches GDBSERVER_SMOKE_DONE.
* feat(gdb-smoke): port GDB and gdbserver smoke to x86_64
参照现有 riscv64/aarch64/loongarch64 实现,为 gdb-smoke 增加 x86_64 的
原生 GDB 冒烟与单进程 gdbserver 冒烟移植:
- 新增 build-x86_64-unknown-none.toml 与默认 qemu-x86_64.toml(native
批量冒烟,成功标志 GDB_NATIVE_SMOKE_DONE);
- 补齐 gdbserver 全套:qemu-x86_64-gdbserver.toml(默认 gdbserver 冒烟,
GDBSERVER_SMOKE_DONE)、gdbserver-host.toml、gdbserver-manual.toml,以及
host-remote-x86_64.gdb / host-manual-x86_64.gdb(set architecture
i386:x86-64);
- prebuild.sh 的 find_qemu_runner 增加 x86_64 分支(qemu-x86_64 +
x86_64-linux-musl);
- README 补充 x86_64 native 与 gdbserver 用法。
gdbserver 路径依赖同分支的 x86_64 u_debugreg 偏移修复才能跑通。已在容器内
验证:native 冒烟 GDB_NATIVE_SMOKE_DONE、gdbserver 冒烟 GDBSERVER_SMOKE_DONE
均通过(断点/backtrace/continue/远程连接/正常退出全部正确)。
---------
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Co-authored-by: 54dK3n <ken@kendeAir.lan>
Co-authored-by: 54dK3n <ken@kendeMacBook-Air.local>
Co-authored-by: 54dK3n <ken@ac-c9-06-23-1e-48.walkup.net.uq.edu.au>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: 周睿 <34859362+ZR233@users.noreply.github.com>
Co-authored-by: 禾可 <chengkelfan@qq.com>
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 21, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 21, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
ZR233
pushed a commit
that referenced
this pull request
Jun 22, 2026
* test(starry): add Go 1.26 language carpet (apps/starry/go-lang) 新增 apps/starry/go-lang —— Go 1.26(go1.26.3)语言级地毯式测试 app,2018 条确定化断言:语言全语法 + 并发 + ~40 标准库包 + Go 1.26 新特性 + 框架运行时(gin / google.golang.org/grpc / go-zero / gorm + 纯 Go modernc SQLite 驱动)。 prebuild.sh 用官方 go1.26.3 工具链(SHA256 校验)`CGO_ENABLED=0` 交叉编译为全静态二进制 golang-lang(无 libc/解释器),注入 overlay;on-target 跑完后由 go/run-go.sh 门控与 host golden 逐字节比对,仅匹配时打印 TEST PASSED。go.sum 固定版本、`-mod=readonly` 可复现构建。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 GO_LANG_OK + GOLANG count=2018 + golden 精确匹配;x86_64 经 CI。结构对照已合入的 apps/starry/python-lang (#1257)。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fixed(toml): resolved to dyn. * test(go-lang): add stdlib-more module (archive, compress, crypto-aes-gcm, ed25519, sha1, hash-crc64, encoding-base32-pem-ascii85-gob, net-url, flag, log, io-fs, text-scanner-tabwriter, regexp-syntax) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after #1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(go-lang): add host CLI carpets (go 158 assertions + goctl 121 assertions) from delivery Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (mergeable, all reviews approved) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(starry): go-lang loongarch64 build uses plat_dyn=false The build-loongarch64 config set plat_dyn = true alongside the built-in static-platform features (ax-hal/loongarch64-qemu-virt + ax-driver/plat-static), which ax-hal's build script rejects (plat-dyn must not combine with a built-in platform feature) and fails the loongarch64 app build. Match the merged python-lang (#1257) loongarch64 config — identical feature set with plat_dyn = false — so cargo xtask starry app qemu -t go-lang --arch loongarch64 builds against the static platform. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(go-lang): correct std_more.go errors + regenerate golden std_more.go 此前从未实际编译过(CI 对 apps/starry/** 路径过滤跳过 app-qemu), 含编译错误与运行期断言错误,致整套 golang-lang carpet 无法构建运行: - 7 处布尔断言误用 3 参的 chk(label,got,want),改为 chkTrue(label,bool): crc64/adler32/gob×2/scanner×2/regexp-syntax。 - flag 段局部变量 fs 遮蔽 io/fs 导入,致 fs.ReadFile 解析为 *FlagSet 方法且 io/fs 未使用;重命名为 flagSet。 - sha1/sum 期望值硬编码错误,修正为 'sha1-test' 的真实 SHA1 (cebb8a6019488e80ca1e1c92322cfdfbff5c04a4)。 - scanner/scan-ident 多了一次 s.Scan();text/scanner 自动跳过空白, 误吞了标识符,移除多余调用。 修复后二进制不再在 sha1 断言处 os.Exit(1),五个框架段(gin httptest / grpc bufconn / go-zero rest+zrpc / database-sql+modernc sqlite / gorm) 均正常执行,断言数 773→2055,打印 GO_LANG_OK。重新生成两份 byte-identical golden(2112 行,3 次运行确定性一致),run-go.sh 门控通过。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Lfan-ke
added a commit
to Lfan-ke/tgoskits
that referenced
this pull request
Jun 25, 2026
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
ZR233
pushed a commit
that referenced
this pull request
Jun 26, 2026
…#1283) * test(starry): add Node.js v22 language carpet (apps/starry/node-lang) 新增 apps/starry/node-lang —— Node.js v22.22.2(V8 引擎)语言级地毯式测试 app,结构对照已合入的 apps/starry/python-lang (#1257)。 node/node-carpet.js 共 359 个确定化断言,在 StarryOS 上以 V8 全 JIT 运行(四架构均无需 --jitless,零内核改动):运行时/语言、CJS/ESM 双向互操作与动态 import()、现代 JS(ES2023+)、worker_threads(独立 V8 isolate)、定时器与核心标准库。每用例与 host node v22.22.2 黄金逐字节匹配或精确断言才计过。run_node_carpet.sh 聚合,全过打印 NODE_CARPET_OK 与 TEST PASSED。 prebuild.sh 经 qemu-user-static 把 musl-native 的 Alpine v3.22 `apk add nodejs icu-data-full` 闭包注入 overlay(网络优先,离线回退预取缓存)。node CLI 选项地毯 node-cli-carpet.sh(184 检查,宿主全绿)随 /usr/bin 一并 staged 供查阅,但不入 on-target 门控:少数 CLI 选项(如 --watch)驱动 fork/exec + fs watch 的内核进程模型特性(StarryOS 已知 gap),非语言层。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 NODE_CARPET_OK + TEST PASSED;x86_64 经 CI。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): align README with actual gate coverage — CLI carpet is host-only auxiliary, not on-target; x86_64 CI claim corrected to honest skip-by-path-filter Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(node-lang): replace 3 vacuous tests with real falsifiable assertions (async-iter, hashbang-grammar, http/METHODS) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add v22-specific CLI flags to carpet (+27 flags: transform-types, test-coverage, trace-env, use-system-ca, webstorage, shadow-realm, wasi, sqlite etc.) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add WeakMap/WeakSet/WeakRef/FinalizationRegistry + Iterator Helpers tests Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after #1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (clippy cancelled, all starry/arceos tests PASSED) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): correct node-carpet.js check count to 367 on v22.22.2 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): unify run_node_carpet.sh comment to 367 checks Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): switch loongarch64 to dynamic platform Mirror the riscv64 dynamic build config (axplat-dyn, no ax-hal/loongarch64-qemu-virt / plat-static / plat_dyn=false; adds ax-driver/serial so the dynamic platform has a console). loongarch64 support must use the dynamic platform; the static loongarch64-qemu-virt path is being retired. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…ner (rcore-os#1315) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
* feat(starry-kernel): x86_64 ptrace register r/w and PTRACE_SINGLESTEP support
补齐 x86_64 ptrace 主干功能:
- 新增 `X8664UserRegs` 结构体 (repr(C)),对应 Linux
`user_regs_struct`,含 r15..rsp/ss/fs_base/gs_base 全部 27 个字段
- 实现 `From<UserContext> for X8664UserRegs` 和 `write_to()`
- 补齐 x86_64 上之前缺失的 ptrace opcode:
GETREGS / SETREGS / GETREGSET(NT_PRSTATUS) / SETREGSET(NT_PRSTATUS) /
GETSIGINFO / SETSIGINFO
- 将 `ptrace_getregset_prstatus` 中 `regs` 局部变量从内部 block 提升到
函数级作用域,修复 reg_bytes slice 的 use-after-free bug(regs 出 block
后被栈复用覆盖,导致用户态读到随机值,表现为 RSP=0x1)
- 新增 `ptrace_setup_singlestep` for x86_64:设置 RFLAGS 的 TF (bit 8)
触发 CPU 单步执行
- 为 x86_64 添加 singlestep setup 调用(之前仅 riscv64)
- 新增 `ExceptionKind::Debug` 处理分支:命中 traced task 的 #DB
异常时,清除 TF 并调用 ptrace_stop_current(SIGTRAP)
- Intel SDM 规定 CPU 在交付 TF 诱导的 #DB 时会清除 pushed RFLAGS
中的 TF,但 QEMU 不完全遵守,故显式清除防止 resume 后再次单步
| 测试 | 验证内容 |
|------|----------|
| test-ptrace-x86-regs | TRACEME -> GETREGS/GETREGSET/SETREGS/SETREGSET 闭环 |
| test-ptrace-exec-stop | TRACEME + execve -> SIGTRAP + DETACH |
| test-ptrace-x86-breakpoint | 双测试:software int3 最小闭环 + SINGLESTEP 基础验证 |
| test-ptrace-x86-singlestep | PTRACE_SINGLESTEP 执行一条指令后以 SIGTRAP stop |
| test-ptrace-x86-breakpoint-reinsert | gdb 风格断点恢复:rewind RIP -> 恢复原字节 -> SINGLESTEP -> 重新插入断点 -> 再次命中 |
| test-gdb-native-batch | gdb -q -batch 端到端:break native_marker / run / bt / info registers / continue |
所有 6 个 x86_64 ptrace case 全部通过。
* feat(starry): add gdb smoke test app and update mount-umount2 compat docs
- apps/starry/gdb: gdb --version smoke test for x86_64 QEMU
(qemu-x86_64.toml, build-x86_64-unknown-none.toml, prebuild.sh)
- docs: update mount-umount2 Linux compat documentation with
shared/private/slave/unbindable propagation, bind subdirectory,
MS_MOVE ELOOP, MS_REMOUNT|MS_BIND|MS_RDONLY semantics
* fix(starry-kernel): gate #DB handler behind #[cfg(target_arch = "x86_64")]
ExceptionKind::Debug and uctx.rflags only exist on x86_64, but the
Debug exception handler in user.rs had no cfg guard, leaking x86_64
single-step logic into all architecture builds. Wrap the entire
block in #[cfg(target_arch = "x86_64")].
Fixes CI failures on loongarch64/aarch64/riscv64.
* test(starryos): extend gdb batch timeout
* test(starryos): isolate gdb apk install stage
* fix(starry-kernel): harden x86_64 ptrace reg writes
* fix(starryos): bundle gdb runtime for batch test
* fix(apps): replace docker-run gdb install with qemu-user + native apk
The prebuild script used 'docker run alpine:edge apk add gdb' which requires
the Docker daemon that is not available inside the CI container. Switch to
qemu-x86_64-static + native apk, consistent with gdb-smoke/prebuild.sh.
* fix(apps): use musl ld directly instead of qemu-user for same-arch x86_64 gdb install
qemu-x86_64-static hangs when emulating x86_64 binaries on an x86_64
host during network-heavy operations like 'apk' package downloads. Use
the musl dynamic linker (ld-musl-x86_64.so.1) from the staging rootfs
to run Alpine apk natively without any emulation layer.
* fix(apps): fix gdb app prebuild with musl ld and complete runtime assets
Replace docker-run-based gdb install with native musl ld execution
of Alpine apk, fixing DNS resolution for the staging root.
Add missing gdb/Python runtime assets to overlay:
- /usr/share/gdb/ (gdb Python modules, syscalls, system-gdbinit)
- /usr/lib/python3.12/ (Python stdlib)
- /usr/lib/python312.zip
- libpython3.12.so*
- /usr/bin/python3
* fix(apps): enable virtio-blk and virtio-net drivers for gdb app
The build config only had the 'qemu' feature which does not
automatically enable virtio drivers. Without ax-driver/virtio-blk,
the kernel cannot detect the root block device, causing:
'failed to determine root device from available block devices'
Align with gdb-smoke's build config by adding the required
ax-driver/virtio-blk and ax-driver/virtio-net features.
* fix(apps): add missing virtio-gpu, virtio-input, virtio-socket features
Align gdb app build config with gdb-smoke and test-suit configs.
* fix(axbuild): handle symlinks in overlay injection via debugfs
CMake install(PROGRAMS ...) preserves symlinks from the staging
rootfs, which causes inject_overlay to fail with:
'unsupported overlay entry ... only regular files and directories
are supported'
When a symlink is encountered during overlay traversal, use debugfs
symlink command to create the symbolic link in the target ext4 image
instead of bailing out.
* chore(ci): trigger re-run
* chore(ci): trigger re-run 2
* fix(starry-kernel): add x86_64 ptrace FP register support (GETFPREGS/SETFPREGS/NT_FPREGSET)
* fix(axbuild): swap debugfs symlink args to link-path-first order
The debugfs symlink command expects "symlink <link_path> <target>"
matching mke2fs convention. Also harden the x86_64 ptrace test with
canary-fork cleanup detection and kernel fault regexes.
* fix(starry-kernel): detach live tracees when tracer exits
* fix(starry-kernel): align x86 ptrace fp snapshots
* fix(starry-kernel): stabilize x86 native gdb ptrace flow
* fix(starry-kernel): clean up ptrace gdb follow-up fixes
* fix(starry-mm): fix file_read_offset computation for unaligned COW split
When vaddr < file_vaddr_base (page-aligned-down start in
unaligned mappings), the saturating_sub returned 0 instead of
correctly subtracting the gap from file_start. This caused
wrong file data to be read after mprotect-induced VMA splits.
Fixes bug-unaligned-cow-split test failure on loongarch64.
* fix(starry-kernel): fix clippy manual_is_multiple_of warning
* fix(starry-mm): extend file_end to cover PT_TLS init image and add execve diagnostics
- map_elf(): scan PT_TLS segments and extend last PT_LOAD file_end
so the COW backend can serve TLS init-image page faults for
the dynamic linker. Without this, ldso sees zeroed TLS data
on riscv64, leading to pc=0 crashes after execve.
- execve: add diagnostic logging for entry/sp/tp/ldso presence
to help debug future user-mode startup failures.
* fix(starry-mm): add AT_NULL auxv terminator to prevent ldso out-of-bounds scan
The auxv constructed in ElfLoader::load() was missing the AT_NULL
(type=0) terminator that the musl dynamic linker uses to stop scanning.
Without it, ld-musl reads past the auxv array into environment string
data on the stack, interpreting arbitrary bytes as auxv entries.
The second exec in init.sh ("exec /bin/sh -l -i") inherits env vars
from the first shell, reshaping the stack so that the out-of-bounds
scan hits garbage aliasing AT_PHDR or AT_ENTRY, producing pc=0 SIGSEGV
with exit code 139. The first exec succeeds only by coincidence — its
empty envp produces a less harmful stack layout.
Fix: push AuxEntry::new(AuxType::NULL, 0) after AT_HWCAP to properly
terminate the auxv.
* chore(ci): re-trigger CI
* test(starry): add SIGSEGV detection to board test fail_regex patterns
OrangePi-5-Plus and SG2002 board tests were timing out after 300-600s
because SIGSEGV crashes (busybox mesg, busybox shell) were not caught
by fail_regex, so the runner waited for the full timeout instead of
failing fast.
Add three patterns to all board test TOMLs:
- '(?i)segmentation fault'
- '(?i)SIGSEGV'
- 'exit with code: 139'
This ensures that any userspace SIGSEGV during boot/login is detected
immediately instead of being hidden behind a timeout.
* chore(ci): re-trigger CI after rustc segfault flake
* fix(starry-mm): add AT_NULL auxv terminator and execve/loader diagnostics
- ElfLoader::load(): add AuxType::NULL terminator to the auxv Vec
- Add info! diagnostic for entry/auxv_count/ldso/last_auxv_type
- execve: upgrade to info! with image name for crash correlation
- map_elf(): downgrade PT_TLS log to debug!
* fix(starry-mm): flush I-cache after populating executable pages on riscv64
On real hardware with non-coherent L1 I/D caches (T-Head C906 on
SG2002), a recycled physical frame from a prior exec may still
hold stale instruction-cache lines. New code bytes written via
D-cache stores by the COW backend are invisible to the I-cache
unless fence.i is executed, causing the CPU to fetch garbage
instructions and jump to pc=0.
Add fence.i (flush_icache_all) in handle_page_fault after
populating any page with EXECUTE permission. QEMU has no real
caches so this is a nop in simulation.
Also replace the stale 'TDOO: flush the I-cache' comment in
loader.rs with a note that coherence is now maintained at
fault time.
* fix(starry-mm): write back D-cache after populating executable pages on XuanTie C9xx
The SG2002 (T-Head C906) board test kept SIGSEGV-ing with pc=0 inside
ld-musl's _dlstart, even after the auxv terminator fix and an added
fence.i. Root cause: the C9xx L1 D-cache is write-back and `fence.i`
does not clean it to the point of unification. The COW backend writes
freshly-faulted code bytes into a frame through the cacheable kernel
linear mapping (phys_to_virt), leaving them in dirty D-cache lines.
The subsequent fence.i on user entry only invalidates the I-cache, so
the instruction fetch refills from stale memory and executes garbage,
jumping to 0. QEMU has no real caches, which is why it only fails on
the board.
- axcpu/riscv: add clean_dcache_range_to_pou(), a th.dcache.cva loop
(per 64-byte line) followed by th.sync.s, gated on xuantie-c9xx.
Opcodes 0x0295000b / 0x0190000b match Linux thead errata.c.
- cow backend: after populating/copying an executable page, clean the
written kernel mapping to the PoU on riscv64 so the I-fetch (after the
existing fence.i in UserContext::run) sees the new code.
- Drop the earlier ineffective fence.i in handle_page_fault; run()
already issues fence.i before every user entry, and the missing piece
was the D-cache writeback, not another I-cache invalidate.
* chore(starry-mm): dump full auxv and entry bytes for SG2002 crash triage
Temporary diagnostic: the SG2002 board still SIGSEGVs at pc=0 in
ld-musl _dlstart despite the cache-coherence fixes, and the entry
instructions execute (gp is set) before the jump to 0. To distinguish a
bad auxv (e.g. AT_ENTRY/AT_PHDR/AT_BASE) from corrupted loaded code
bytes, log every auxv entry and force-populate + hexdump the first 16
bytes at both the ldso entry and AT_ENTRY. To be reverted once root
cause is known.
* fix(starry-mm): read unaligned COW segment first page from correct file offset
The real cause of the SG2002 (and any dynamic-binary) pc=0 SIGSEGV in
ld-musl: commit 82b289c changed alloc_new_at()/file_info() so that when
vaddr < file_vaddr_base (the page-aligned-down first page of a segment
whose p_vaddr/p_offset is not page-aligned) the file offset was computed
as file_start - (file_vaddr_base - vaddr) instead of file_start.
For ld-musl the RW PT_LOAD is at vaddr=0x94b20 (holding .dynamic/GOT).
Its first page (0x94000) took the buggy branch and read the segment
bytes 0xb20 too early in the file, corrupting .dynamic/GOT. The dynamic
linker's RELATIVE self-relocation then produced garbage pointers and
jumped to 0 — deterministically, on the very first dynamic exec. The
ldso/app code pages themselves loaded fine (verified by dumping the
entry bytes), so this was never a cache-coherence problem.
The mapping invariant is simply: virtual address V maps to file offset
file_start + (V - file_vaddr_base). Restore the unified
`file_start + saturating_sub(vaddr, file_vaddr_base)` form (== the
pre-82b289cb1 code), which yields file_start for the unaligned first
page and the correct delta elsewhere. CowBackend::split keeps
file_vaddr_base/file_start intact, so the bug-unaligned-cow-split test
(which only reads page-aligned blob pages, all >= file_vaddr_base, via
the unchanged >= path) is unaffected.
Also revert the speculative XuanTie D-cache writeback and the auxv/byte
diagnostics added while chasing the wrong (cache) hypothesis.
* chore(ci): trigger CI after sync with main
* chore(starry): add proc maps area diagnostics for bug-proc-maps-lseek-refresh
* fix(starry): fix bug-proc-maps-lseek-refresh test failure
Two fixes:
1. pseudofs/proc: render_thread_maps() used '?' on backend.file_info()
which aborted the entire area iteration when an area had no name
or file backing (e.g. PROT_NONE guard pages). Use
unwrap_or_else() with a default-empty BackendFileInfo instead
so all VMAs always appear in /proc/self/maps.
2. test/proc-maps: the test's has_vma_prefix() used %08lx which
produces 8-hex-digit addresses, but the kernel uses {:016x}
(16 hex digits on 64-bit). Use %0*lx with addr_width =
sizeof(void*)*2 to match the kernel's output format.
* fix: resolve merge conflicts with upstream/dev PR rcore-os#1167
- Remove duplicate ProcMemFile (old WeakAxTaskRef version)
- Remove duplicate 'mem' node in ThreadDir
- Accept upstream per-TID ptrace refactor for task/mod.rs, signal.rs, user.rs
- Keep our render_thread_maps file_info() unwind fix
* fix: complete per-TID ptrace API migration and execve stop semantics
- ptrace.rs: migrate x86_64 FP regset paths from old process-wide
ptrace_stop_fp_data()/set_ptrace_stop_fp_data() to per-TID
ptrace_stop_fp_data_for(tid)/set_ptrace_stop_fp_data_for(tid, ...)
using raw [u64;32] bytes to bridge FxsaveArea ↔ arch-independent
PtraceStopRecord storage.
- execve.rs: fix PTRACE_TRACEME exec-stop semantics. Linux requires
TRACEME'd tasks to always generate a SIGTRAP stop on execve;
PTRACE_O_TRACEEXEC only controls whether the stop carries
PTRACE_EVENT_EXEC. Move the TRACEME check outside the TRACEEXEC
option gate.
- reports: fix trailing whitespace and EOF blank lines for
diff --check compliance.
* fix(starry-kernel): correct x86_64 ptrace single-step, exec-stop and register reporting
- user.rs: arm x86_64 hardware single-step (RFLAGS.TF) for traced tracees, and
route the resulting #DB to a SIGTRAP ptrace-stop that disarms the per-TID
single-step flag and clears the saved TF (the CPU pushes EFLAGS with TF still
set), so a subsequent PTRACE_CONT runs free instead of single-stepping.
- axcpu/x86_64/trap.rs: drop the panic on an unhandled #DB; let it fall through
to the user-space exception loop (kprobe/uprobe debug handlers still win).
- ptrace.rs: report Linux-convention user selectors cs=0x33/ss=0x2b via
GETREGS/GETREGSET and accept them in SETREGS so debuggers detect a 64-bit
inferior instead of i386; correct the single-step TF comment.
- execve.rs: every ptrace tracee stops with SIGTRAP on execve (PTRACE_O_TRACEEXEC
only controls the event payload, not whether the stop occurs).
- proc.rs: drop a duplicate /proc/<pid>/mem entry in the thread dir listing.
* test(starry): convert test-gdb-native-batch to a raw-ptrace tracer
Replace the real /usr/bin/gdb driver with a self-contained raw-ptrace tracer
(matching riscv's test-ptrace-gdb), validating the kernel's ptrace on a
dynamically-linked process across execve and ld-musl startup without depending
on GDB's startup probes or target-description negotiation:
fork + PTRACE_TRACEME + execve(dynamic target) -> exec-stop -> read AT_ENTRY
from /proc/<pid>/auxv -> plant INT3 at AT_ENTRY -> PTRACE_CONT (ld-musl runs
fully under ptrace) -> trap at the application entry -> restore + single-step
-> PTRACE_CONT to exit 0.
- add c/src/tracer.c; CMakeLists builds both the dynamic target and the tracer
- qemu-x86_64.toml runs the tracer; success "DONE: N pass, 0 fail"
- remove gdb-native-batch.gdb, run-gdb-native-batch.sh, prebuild.sh (no gdb)
* test(starry): migrate x86 ptrace/gdb cases into grouped system and fix exec-stop path
Move 5 x86 ptrace/gdb test cases from undiscovered normal/qemu-smp1/ to
qemu-smp1/system/ with arch-filtered CMakeLists that install into
starry-test-suit, making them participate in the grouped CI runner.
- test-ptrace-x86-regs: remove canary fork, return exit code directly
- test-ptrace-x86-breakpoint: fix printf format string
- test-gdb-native-batch: split into tracer (starry-test-suit) and
target (usr/bin), rename to test-gdb-native-batch-tracer
Promote test-ptrace-exec-stop from starry-known-fail / riscv-only to
starry-test-suit on riscv64|x86_64. Fix hardcoded path by using
/proc/self/exe so the re-exec child finds itself under the grouped
install location.
Delete stray test-ptrace-exec-stop/qemu-x86_64.toml (double discovery).
Verified: x86_64 and riscv64 grouped system both PASS, all ptrace
binaries show STARRY_SYSTEM_TEST_PASSED.
* chore(ci): re-trigger CI after roc-rk3568 board u-boot flake
* ci: trigger test run
* ci: trigger test run
* chore: remove accidentally committed internal ptrace/gdb reports
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(axbuild): tolerate slow guests in host HTTP test server
The apk-curl-equivalence system case downloads a 20MB payload from the
host HTTP server. The server used a 1s per-write timeout and silently
discarded write errors, so whenever a slow guest (notably x86_64, the
slowest QEMU guest) applied TCP backpressure for over a second, the body
write timed out, the error was dropped, and the connection was closed
mid-stream. curl then failed with "(18) end of response with N bytes
missing", flaking the x86_64 starry qemu test.
Raise the body write timeout to 30s (still finite so a wedged guest
cannot block the server thread and its Drop/join forever) and surface
write errors instead of swallowing them.
* test(starry): wire x86 ptrace/gdb cases into grouped system runner
The new x86_64 ptrace/gdb system cases were laid out as
system/<case>/c/CMakeLists.txt + c/src/, but the qemu-smp*/system
grouped runner builds one root CMake project that only add_subdirectory()
each subcase whose CMakeLists.txt sits directly under system/<case>.
As a result these cases were never built/installed in aggregate runs and
`-c qemu-smp1/system/<case>` failed at configure time with
"unknown grouped C subcase".
Move each case to the flat system subcase layout required by
test-suit/starryos/GUIDE.md (CMakeLists.txt + src/ at the case root) and
fix the relative include of common/starry_arch_filter.cmake accordingly.
Install destinations are unchanged.
Cases: test-ptrace-x86-regs, test-ptrace-x86-breakpoint,
test-ptrace-x86-breakpoint-reinsert, test-ptrace-x86-singlestep,
test-gdb-native-batch.
* fix(starry-kernel): rebase x86_64 ptrace onto upstream/dev per-tid baseline
Replace ptrace.rs with upstream/dev version as baseline and port x86_64 code:
- Add X8664UserRegs struct + From<UserContext>/write_to/sanitize_eflags
- Add X86_64_USER_* constants + peeksuser/pokeuser/user_area_x86_64
- Add x86_64 getregs/setregs/getfpregs/setfpregs/getregset/setregset impls
- Add ptrace_setup_singlestep for x86_64 (RFLAGS.TF)
- Wire x86_64 into multi-arch dispatch gates (NT_FPREGSET/NT_PRSTATUS)
- Define x86_64 PtraceStopFpData as tuple struct + real fxsave/fxrstor
- Add x86_64 to signal.rs ptrace FP save and mod.rs save/restore
Fixes three build-blocking issues:
- ptrace_restore_singlestep_insn present for all archs (from upstream baseline)
- ptrace_setup_singlestep present for aarch64/loongarch64 (from upstream baseline)
- x86_64 FP type matches between ptrace.rs and mod.rs (tuple struct)
* fix(starry-kernel): store full FxsaveArea in x86_64 PtraceStopFpData
Replace PtraceStopFpData([u64; 32], usize) with PtraceStopFpData(FxsaveArea)
to match the 512-byte FXSAVE area. Fixes out-of-bounds memory access at
4 call sites where from_raw_parts(ptr, 512) was created from a 256-byte
[u64; 32] array — UB when the slice exceeded the allocation.
save/restore/GETFPREGS/SETFPREGS/NT_FPREGSET now directly copy the full
FxsaveArea, preserving all XMM/MXCSR state.
* fix(starry): downgrade loader/execve logs to debug, restore kernel #DB panic, add TLS contiguity comment
* test(starry): add x86_64 ptrace FP register coverage
Exercises PTRACE_GETFPREGS/SETFPREGS and NT_PRFPREG round-trip on x86_64,
checking xmm0, xmm10 (offset 320) and xmm15 (offset 400) so a regression that
preserves only part of the 512-byte FXSAVE area is caught. The child loads
known XMM values and stops via a direct kill() syscall to avoid libc clobbering
the registers; the tracer verifies the read-back, writes sentinels, and the
child confirms them after resume. Auto-discovered under qemu-smp1/system.
* fix(starry-kernel): remove duplicate ptrace_setregset_prstatus, fix axnet typo and register call
* chore: fmt execve.rs register call
* fix(starry-kernel): remove unused VirtAddr and DirectRwFsFileOps imports in proc.rs
* chore: fmt proc.rs import line
* fix(starry-kernel): gate format_statm/format_status_vm_lines with cfg(test)
* fix(starry-kernel): gate alloc::format import with cfg(test)
* chore: reorder stats.rs imports for fmt
* fix(starry-kernel): scope ptrace get/setfpregs cfg to all non-x86 arches
ptrace_getfpregs/ptrace_setfpregs use the generic ArchFpRegs path for the
non-x86 architectures, but the supported arm was gated on
any(riscv64, loongarch64) (missing aarch64) while the Unsupported fallback
was gated on not(any(riscv64, x86_64)). On loongarch64 both arms matched,
causing E0428 (duplicate definition); on aarch64 the function fell through
to the Unsupported stub instead of the real ArchFpRegs path. Widen the
supported arm to any(riscv64, aarch64, loongarch64) and the fallback to
not(any(riscv64, aarch64, loongarch64, x86_64)), matching get/setregs.
* fix(starry-kernel): restore /proc features dropped by a bad merge revert
During an earlier conflict resolution, pseudofs/proc.rs was reverted to a
pre-refactor version, silently dropping upstream features: /proc/<pid>/mem
(ProcMemFile + read_at/write_at/check_access), /proc/<pid>/status memory
stats (sample_mem_stats, TaskStatusBase/TaskStatusFields) and the namespace
directory (NsDir), plus their tests. Restore the current upstream/dev proc.rs
and re-apply the only two genuine branch-local tweaks on top: the extended
loongarch /proc/cpuinfo Feat flags, and /proc/<pid>/maps full-width addresses
with anonymous-mapping file_info tolerance.
* fix(axbuild): restore upstream overlay symlink injection
An earlier divergence replaced the two-pass overlay debugfs injection with a
single-pass variant, dropping two upstream behaviours: deferring symlink
creation until after their targets are written (debugfs validates the target),
and converting relative symlink targets to absolute guest paths. Restore the
upstream/dev implementation (which already uses link-path-first symlink args).
* fix(starry-kernel): un-gate ProcessMemStats format methods for /proc
format_statm and format_status_vm_lines had been marked #[cfg(test)] back when
the reverted proc.rs no longer called them (to avoid dead_code under -D warnings).
The restored proc.rs uses both in the real build (/proc/<pid>/statm and
/proc/<pid>/status), so the test-only gating broke non-x86 builds with E0599.
Restore upstream/dev stats.rs so the methods are available in all builds.
* chore: remove accidentally committed GitHub page snapshot
A 172KB GitHub page snapshot (Feat_x86 64 ptrace clean ... rcore-os_tgoskits@f4d00dd.html)
was swept into the branch by a stray 'git add .'. It is not source/test asset and
makes 'git diff --check' fail on trailing whitespace/EOF blank lines. Remove it and
gitignore these page snapshots so they cannot be re-committed.
* fix(starry): use STARRY_ROOTFS in gdb app prebuild
starry app qemu injects the rootfs image path as STARRY_ROOTFS, not
STARRY_BASE_ROOTFS, so the gdb prebuild failed require_env and the
GDB_SMOKE_PASSED qemu path never ran. Match the ffmpeg/pip/mosquitto apps:
read ${STARRY_ROOTFS:-${STARRY_BASE_ROOTFS:-}} and require STARRY_ROOTFS.
* refactor(starry-kernel): converge x86_64 GP registers into ArchUserRegs explicit-TID backend
- Add ArchUserRegs alias for x86_64
- Make write_to return AxResult<()> for all archs
- Expand generic read/write backends to cover x86_64
- Remove parallel x86_64 helper functions
- Unify getregs/setregs into single generic bodies
- Remove inline arch dispatch from getregset/setregset_prstatus
- Update PEEKUSER/POKEUSER user-area to generic backend
- Remove redundant selected-stop wrappers from detach_live_tracees_of
* fix(starry): use dynamic platform for gdb x86_64 app build config
The gdb app x86_64 build config pinned the legacy static x86 platform
(ax-hal/x86-pc, ax-driver/plat-static, the qemu feature, plat_dyn=false).
x86_64 Starry runs on the dynamic platform path, which registers no static
platform package, so 'cargo xtask starry app qemu -t gdb --arch x86_64'
failed at build-config with 'no default platform package is registered for
arch x86_64' and the GDB_SMOKE_PASSED path was unreachable. Drop the static
deps and match the other Starry x86_64 app configs (git/top): keep only the
virtio driver features on the dynamic platform. Verified end-to-end in the
container: boots to a shell, gdb 16.3 runs, GDB_SMOKE_PASSED.
* chore(repo): remove unused workspace crates (rcore-os#1306)
* feat(axbuild): internalize Starry kallsyms flow (rcore-os#1309)
* fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM runner (rcore-os#1315)
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
* fix(starry): correct x86_64 u_debugreg offset in struct user
x86_64 PTRACE_PEEKUSER/POKEUSER on the debug-register area used
X86_64_USER_DEBUGREG_OFFSET = 912, but u_debugreg[] sits at offset 848 in
the x86_64 `struct user` (regs 216 + u_fpvalid/pad 8 + i387 512 + tsize/
dsize/ssize 24 + start_code/start_stack 16 + signal 8 + reserved/pad 8 +
u_ar0 8 + u_fpstate 8 + magic 8 + comm 32 = 848).
gdbserver probes the hardware debug registers (DR0–DR7) via PEEKUSER at
this offset during startup; with the wrong offset it read a bogus location
and stalled before printing "Listening on port 1234", so the x86_64
gdbserver smoke hung. The native single-process GDB smoke does not touch
debug registers, which is why only the gdbserver path was affected.
Fix the offset to 848. Verified end-to-end in the container: the x86_64
gdbserver smoke now reaches GDBSERVER_SMOKE_DONE.
* feat(gdb-smoke): port GDB and gdbserver smoke to x86_64
参照现有 riscv64/aarch64/loongarch64 实现,为 gdb-smoke 增加 x86_64 的
原生 GDB 冒烟与单进程 gdbserver 冒烟移植:
- 新增 build-x86_64-unknown-none.toml 与默认 qemu-x86_64.toml(native
批量冒烟,成功标志 GDB_NATIVE_SMOKE_DONE);
- 补齐 gdbserver 全套:qemu-x86_64-gdbserver.toml(默认 gdbserver 冒烟,
GDBSERVER_SMOKE_DONE)、gdbserver-host.toml、gdbserver-manual.toml,以及
host-remote-x86_64.gdb / host-manual-x86_64.gdb(set architecture
i386:x86-64);
- prebuild.sh 的 find_qemu_runner 增加 x86_64 分支(qemu-x86_64 +
x86_64-linux-musl);
- README 补充 x86_64 native 与 gdbserver 用法。
gdbserver 路径依赖同分支的 x86_64 u_debugreg 偏移修复才能跑通。已在容器内
验证:native 冒烟 GDB_NATIVE_SMOKE_DONE、gdbserver 冒烟 GDBSERVER_SMOKE_DONE
均通过(断点/backtrace/continue/远程连接/正常退出全部正确)。
---------
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Co-authored-by: 54dK3n <ken@kendeAir.lan>
Co-authored-by: 54dK3n <ken@kendeMacBook-Air.local>
Co-authored-by: 54dK3n <ken@ac-c9-06-23-1e-48.walkup.net.uq.edu.au>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: 周睿 <34859362+ZR233@users.noreply.github.com>
Co-authored-by: 禾可 <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…e-os#1282) * test(starry): add Go 1.26 language carpet (apps/starry/go-lang) 新增 apps/starry/go-lang —— Go 1.26(go1.26.3)语言级地毯式测试 app,2018 条确定化断言:语言全语法 + 并发 + ~40 标准库包 + Go 1.26 新特性 + 框架运行时(gin / google.golang.org/grpc / go-zero / gorm + 纯 Go modernc SQLite 驱动)。 prebuild.sh 用官方 go1.26.3 工具链(SHA256 校验)`CGO_ENABLED=0` 交叉编译为全静态二进制 golang-lang(无 libc/解释器),注入 overlay;on-target 跑完后由 go/run-go.sh 门控与 host golden 逐字节比对,仅匹配时打印 TEST PASSED。go.sum 固定版本、`-mod=readonly` 可复现构建。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 GO_LANG_OK + GOLANG count=2018 + golden 精确匹配;x86_64 经 CI。结构对照已合入的 apps/starry/python-lang (rcore-os#1257)。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fixed(toml): resolved to dyn. * test(go-lang): add stdlib-more module (archive, compress, crypto-aes-gcm, ed25519, sha1, hash-crc64, encoding-base32-pem-ascii85-gob, net-url, flag, log, io-fs, text-scanner-tabwriter, regexp-syntax) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after rcore-os#1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(go-lang): add host CLI carpets (go 158 assertions + goctl 121 assertions) from delivery Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (mergeable, all reviews approved) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(starry): go-lang loongarch64 build uses plat_dyn=false The build-loongarch64 config set plat_dyn = true alongside the built-in static-platform features (ax-hal/loongarch64-qemu-virt + ax-driver/plat-static), which ax-hal's build script rejects (plat-dyn must not combine with a built-in platform feature) and fails the loongarch64 app build. Match the merged python-lang (rcore-os#1257) loongarch64 config — identical feature set with plat_dyn = false — so cargo xtask starry app qemu -t go-lang --arch loongarch64 builds against the static platform. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(go-lang): correct std_more.go errors + regenerate golden std_more.go 此前从未实际编译过(CI 对 apps/starry/** 路径过滤跳过 app-qemu), 含编译错误与运行期断言错误,致整套 golang-lang carpet 无法构建运行: - 7 处布尔断言误用 3 参的 chk(label,got,want),改为 chkTrue(label,bool): crc64/adler32/gob×2/scanner×2/regexp-syntax。 - flag 段局部变量 fs 遮蔽 io/fs 导入,致 fs.ReadFile 解析为 *FlagSet 方法且 io/fs 未使用;重命名为 flagSet。 - sha1/sum 期望值硬编码错误,修正为 'sha1-test' 的真实 SHA1 (cebb8a6019488e80ca1e1c92322cfdfbff5c04a4)。 - scanner/scan-ident 多了一次 s.Scan();text/scanner 自动跳过空白, 误吞了标识符,移除多余调用。 修复后二进制不再在 sha1 断言处 os.Exit(1),五个框架段(gin httptest / grpc bufconn / go-zero rest+zrpc / database-sql+modernc sqlite / gorm) 均正常执行,断言数 773→2055,打印 GO_LANG_OK。重新生成两份 byte-identical golden(2112 行,3 次运行确定性一致),run-go.sh 门控通过。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…rcore-os#1283) * test(starry): add Node.js v22 language carpet (apps/starry/node-lang) 新增 apps/starry/node-lang —— Node.js v22.22.2(V8 引擎)语言级地毯式测试 app,结构对照已合入的 apps/starry/python-lang (rcore-os#1257)。 node/node-carpet.js 共 359 个确定化断言,在 StarryOS 上以 V8 全 JIT 运行(四架构均无需 --jitless,零内核改动):运行时/语言、CJS/ESM 双向互操作与动态 import()、现代 JS(ES2023+)、worker_threads(独立 V8 isolate)、定时器与核心标准库。每用例与 host node v22.22.2 黄金逐字节匹配或精确断言才计过。run_node_carpet.sh 聚合,全过打印 NODE_CARPET_OK 与 TEST PASSED。 prebuild.sh 经 qemu-user-static 把 musl-native 的 Alpine v3.22 `apk add nodejs icu-data-full` 闭包注入 overlay(网络优先,离线回退预取缓存)。node CLI 选项地毯 node-cli-carpet.sh(184 检查,宿主全绿)随 /usr/bin 一并 staged 供查阅,但不入 on-target 门控:少数 CLI 选项(如 --watch)驱动 fork/exec + fs watch 的内核进程模型特性(StarryOS 已知 gap),非语言层。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 NODE_CARPET_OK + TEST PASSED;x86_64 经 CI。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): align README with actual gate coverage — CLI carpet is host-only auxiliary, not on-target; x86_64 CI claim corrected to honest skip-by-path-filter Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(node-lang): replace 3 vacuous tests with real falsifiable assertions (async-iter, hashbang-grammar, http/METHODS) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add v22-specific CLI flags to carpet (+27 flags: transform-types, test-coverage, trace-env, use-system-ca, webstorage, shadow-realm, wasi, sqlite etc.) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add WeakMap/WeakSet/WeakRef/FinalizationRegistry + Iterator Helpers tests Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after rcore-os#1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (clippy cancelled, all starry/arceos tests PASSED) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): correct node-carpet.js check count to 367 on v22.22.2 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): unify run_node_carpet.sh comment to 367 checks Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): switch loongarch64 to dynamic platform Mirror the riscv64 dynamic build config (axplat-dyn, no ax-hal/loongarch64-qemu-virt / plat-static / plat_dyn=false; adds ax-driver/serial so the dynamic platform has a console). loongarch64 support must use the dynamic platform; the static loongarch64-qemu-virt path is being retired. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…ner (rcore-os#1315) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
* feat(starry-kernel): x86_64 ptrace register r/w and PTRACE_SINGLESTEP support
补齐 x86_64 ptrace 主干功能:
- 新增 `X8664UserRegs` 结构体 (repr(C)),对应 Linux
`user_regs_struct`,含 r15..rsp/ss/fs_base/gs_base 全部 27 个字段
- 实现 `From<UserContext> for X8664UserRegs` 和 `write_to()`
- 补齐 x86_64 上之前缺失的 ptrace opcode:
GETREGS / SETREGS / GETREGSET(NT_PRSTATUS) / SETREGSET(NT_PRSTATUS) /
GETSIGINFO / SETSIGINFO
- 将 `ptrace_getregset_prstatus` 中 `regs` 局部变量从内部 block 提升到
函数级作用域,修复 reg_bytes slice 的 use-after-free bug(regs 出 block
后被栈复用覆盖,导致用户态读到随机值,表现为 RSP=0x1)
- 新增 `ptrace_setup_singlestep` for x86_64:设置 RFLAGS 的 TF (bit 8)
触发 CPU 单步执行
- 为 x86_64 添加 singlestep setup 调用(之前仅 riscv64)
- 新增 `ExceptionKind::Debug` 处理分支:命中 traced task 的 #DB
异常时,清除 TF 并调用 ptrace_stop_current(SIGTRAP)
- Intel SDM 规定 CPU 在交付 TF 诱导的 #DB 时会清除 pushed RFLAGS
中的 TF,但 QEMU 不完全遵守,故显式清除防止 resume 后再次单步
| 测试 | 验证内容 |
|------|----------|
| test-ptrace-x86-regs | TRACEME -> GETREGS/GETREGSET/SETREGS/SETREGSET 闭环 |
| test-ptrace-exec-stop | TRACEME + execve -> SIGTRAP + DETACH |
| test-ptrace-x86-breakpoint | 双测试:software int3 最小闭环 + SINGLESTEP 基础验证 |
| test-ptrace-x86-singlestep | PTRACE_SINGLESTEP 执行一条指令后以 SIGTRAP stop |
| test-ptrace-x86-breakpoint-reinsert | gdb 风格断点恢复:rewind RIP -> 恢复原字节 -> SINGLESTEP -> 重新插入断点 -> 再次命中 |
| test-gdb-native-batch | gdb -q -batch 端到端:break native_marker / run / bt / info registers / continue |
所有 6 个 x86_64 ptrace case 全部通过。
* feat(starry): add gdb smoke test app and update mount-umount2 compat docs
- apps/starry/gdb: gdb --version smoke test for x86_64 QEMU
(qemu-x86_64.toml, build-x86_64-unknown-none.toml, prebuild.sh)
- docs: update mount-umount2 Linux compat documentation with
shared/private/slave/unbindable propagation, bind subdirectory,
MS_MOVE ELOOP, MS_REMOUNT|MS_BIND|MS_RDONLY semantics
* fix(starry-kernel): gate #DB handler behind #[cfg(target_arch = "x86_64")]
ExceptionKind::Debug and uctx.rflags only exist on x86_64, but the
Debug exception handler in user.rs had no cfg guard, leaking x86_64
single-step logic into all architecture builds. Wrap the entire
block in #[cfg(target_arch = "x86_64")].
Fixes CI failures on loongarch64/aarch64/riscv64.
* test(starryos): extend gdb batch timeout
* test(starryos): isolate gdb apk install stage
* fix(starry-kernel): harden x86_64 ptrace reg writes
* fix(starryos): bundle gdb runtime for batch test
* fix(apps): replace docker-run gdb install with qemu-user + native apk
The prebuild script used 'docker run alpine:edge apk add gdb' which requires
the Docker daemon that is not available inside the CI container. Switch to
qemu-x86_64-static + native apk, consistent with gdb-smoke/prebuild.sh.
* fix(apps): use musl ld directly instead of qemu-user for same-arch x86_64 gdb install
qemu-x86_64-static hangs when emulating x86_64 binaries on an x86_64
host during network-heavy operations like 'apk' package downloads. Use
the musl dynamic linker (ld-musl-x86_64.so.1) from the staging rootfs
to run Alpine apk natively without any emulation layer.
* fix(apps): fix gdb app prebuild with musl ld and complete runtime assets
Replace docker-run-based gdb install with native musl ld execution
of Alpine apk, fixing DNS resolution for the staging root.
Add missing gdb/Python runtime assets to overlay:
- /usr/share/gdb/ (gdb Python modules, syscalls, system-gdbinit)
- /usr/lib/python3.12/ (Python stdlib)
- /usr/lib/python312.zip
- libpython3.12.so*
- /usr/bin/python3
* fix(apps): enable virtio-blk and virtio-net drivers for gdb app
The build config only had the 'qemu' feature which does not
automatically enable virtio drivers. Without ax-driver/virtio-blk,
the kernel cannot detect the root block device, causing:
'failed to determine root device from available block devices'
Align with gdb-smoke's build config by adding the required
ax-driver/virtio-blk and ax-driver/virtio-net features.
* fix(apps): add missing virtio-gpu, virtio-input, virtio-socket features
Align gdb app build config with gdb-smoke and test-suit configs.
* fix(axbuild): handle symlinks in overlay injection via debugfs
CMake install(PROGRAMS ...) preserves symlinks from the staging
rootfs, which causes inject_overlay to fail with:
'unsupported overlay entry ... only regular files and directories
are supported'
When a symlink is encountered during overlay traversal, use debugfs
symlink command to create the symbolic link in the target ext4 image
instead of bailing out.
* chore(ci): trigger re-run
* chore(ci): trigger re-run 2
* fix(starry-kernel): add x86_64 ptrace FP register support (GETFPREGS/SETFPREGS/NT_FPREGSET)
* fix(axbuild): swap debugfs symlink args to link-path-first order
The debugfs symlink command expects "symlink <link_path> <target>"
matching mke2fs convention. Also harden the x86_64 ptrace test with
canary-fork cleanup detection and kernel fault regexes.
* fix(starry-kernel): detach live tracees when tracer exits
* fix(starry-kernel): align x86 ptrace fp snapshots
* fix(starry-kernel): stabilize x86 native gdb ptrace flow
* fix(starry-kernel): clean up ptrace gdb follow-up fixes
* fix(starry-mm): fix file_read_offset computation for unaligned COW split
When vaddr < file_vaddr_base (page-aligned-down start in
unaligned mappings), the saturating_sub returned 0 instead of
correctly subtracting the gap from file_start. This caused
wrong file data to be read after mprotect-induced VMA splits.
Fixes bug-unaligned-cow-split test failure on loongarch64.
* fix(starry-kernel): fix clippy manual_is_multiple_of warning
* fix(starry-mm): extend file_end to cover PT_TLS init image and add execve diagnostics
- map_elf(): scan PT_TLS segments and extend last PT_LOAD file_end
so the COW backend can serve TLS init-image page faults for
the dynamic linker. Without this, ldso sees zeroed TLS data
on riscv64, leading to pc=0 crashes after execve.
- execve: add diagnostic logging for entry/sp/tp/ldso presence
to help debug future user-mode startup failures.
* fix(starry-mm): add AT_NULL auxv terminator to prevent ldso out-of-bounds scan
The auxv constructed in ElfLoader::load() was missing the AT_NULL
(type=0) terminator that the musl dynamic linker uses to stop scanning.
Without it, ld-musl reads past the auxv array into environment string
data on the stack, interpreting arbitrary bytes as auxv entries.
The second exec in init.sh ("exec /bin/sh -l -i") inherits env vars
from the first shell, reshaping the stack so that the out-of-bounds
scan hits garbage aliasing AT_PHDR or AT_ENTRY, producing pc=0 SIGSEGV
with exit code 139. The first exec succeeds only by coincidence — its
empty envp produces a less harmful stack layout.
Fix: push AuxEntry::new(AuxType::NULL, 0) after AT_HWCAP to properly
terminate the auxv.
* chore(ci): re-trigger CI
* test(starry): add SIGSEGV detection to board test fail_regex patterns
OrangePi-5-Plus and SG2002 board tests were timing out after 300-600s
because SIGSEGV crashes (busybox mesg, busybox shell) were not caught
by fail_regex, so the runner waited for the full timeout instead of
failing fast.
Add three patterns to all board test TOMLs:
- '(?i)segmentation fault'
- '(?i)SIGSEGV'
- 'exit with code: 139'
This ensures that any userspace SIGSEGV during boot/login is detected
immediately instead of being hidden behind a timeout.
* chore(ci): re-trigger CI after rustc segfault flake
* fix(starry-mm): add AT_NULL auxv terminator and execve/loader diagnostics
- ElfLoader::load(): add AuxType::NULL terminator to the auxv Vec
- Add info! diagnostic for entry/auxv_count/ldso/last_auxv_type
- execve: upgrade to info! with image name for crash correlation
- map_elf(): downgrade PT_TLS log to debug!
* fix(starry-mm): flush I-cache after populating executable pages on riscv64
On real hardware with non-coherent L1 I/D caches (T-Head C906 on
SG2002), a recycled physical frame from a prior exec may still
hold stale instruction-cache lines. New code bytes written via
D-cache stores by the COW backend are invisible to the I-cache
unless fence.i is executed, causing the CPU to fetch garbage
instructions and jump to pc=0.
Add fence.i (flush_icache_all) in handle_page_fault after
populating any page with EXECUTE permission. QEMU has no real
caches so this is a nop in simulation.
Also replace the stale 'TDOO: flush the I-cache' comment in
loader.rs with a note that coherence is now maintained at
fault time.
* fix(starry-mm): write back D-cache after populating executable pages on XuanTie C9xx
The SG2002 (T-Head C906) board test kept SIGSEGV-ing with pc=0 inside
ld-musl's _dlstart, even after the auxv terminator fix and an added
fence.i. Root cause: the C9xx L1 D-cache is write-back and `fence.i`
does not clean it to the point of unification. The COW backend writes
freshly-faulted code bytes into a frame through the cacheable kernel
linear mapping (phys_to_virt), leaving them in dirty D-cache lines.
The subsequent fence.i on user entry only invalidates the I-cache, so
the instruction fetch refills from stale memory and executes garbage,
jumping to 0. QEMU has no real caches, which is why it only fails on
the board.
- axcpu/riscv: add clean_dcache_range_to_pou(), a th.dcache.cva loop
(per 64-byte line) followed by th.sync.s, gated on xuantie-c9xx.
Opcodes 0x0295000b / 0x0190000b match Linux thead errata.c.
- cow backend: after populating/copying an executable page, clean the
written kernel mapping to the PoU on riscv64 so the I-fetch (after the
existing fence.i in UserContext::run) sees the new code.
- Drop the earlier ineffective fence.i in handle_page_fault; run()
already issues fence.i before every user entry, and the missing piece
was the D-cache writeback, not another I-cache invalidate.
* chore(starry-mm): dump full auxv and entry bytes for SG2002 crash triage
Temporary diagnostic: the SG2002 board still SIGSEGVs at pc=0 in
ld-musl _dlstart despite the cache-coherence fixes, and the entry
instructions execute (gp is set) before the jump to 0. To distinguish a
bad auxv (e.g. AT_ENTRY/AT_PHDR/AT_BASE) from corrupted loaded code
bytes, log every auxv entry and force-populate + hexdump the first 16
bytes at both the ldso entry and AT_ENTRY. To be reverted once root
cause is known.
* fix(starry-mm): read unaligned COW segment first page from correct file offset
The real cause of the SG2002 (and any dynamic-binary) pc=0 SIGSEGV in
ld-musl: commit 82b289c changed alloc_new_at()/file_info() so that when
vaddr < file_vaddr_base (the page-aligned-down first page of a segment
whose p_vaddr/p_offset is not page-aligned) the file offset was computed
as file_start - (file_vaddr_base - vaddr) instead of file_start.
For ld-musl the RW PT_LOAD is at vaddr=0x94b20 (holding .dynamic/GOT).
Its first page (0x94000) took the buggy branch and read the segment
bytes 0xb20 too early in the file, corrupting .dynamic/GOT. The dynamic
linker's RELATIVE self-relocation then produced garbage pointers and
jumped to 0 — deterministically, on the very first dynamic exec. The
ldso/app code pages themselves loaded fine (verified by dumping the
entry bytes), so this was never a cache-coherence problem.
The mapping invariant is simply: virtual address V maps to file offset
file_start + (V - file_vaddr_base). Restore the unified
`file_start + saturating_sub(vaddr, file_vaddr_base)` form (== the
pre-82b289cb1 code), which yields file_start for the unaligned first
page and the correct delta elsewhere. CowBackend::split keeps
file_vaddr_base/file_start intact, so the bug-unaligned-cow-split test
(which only reads page-aligned blob pages, all >= file_vaddr_base, via
the unchanged >= path) is unaffected.
Also revert the speculative XuanTie D-cache writeback and the auxv/byte
diagnostics added while chasing the wrong (cache) hypothesis.
* chore(ci): trigger CI after sync with main
* chore(starry): add proc maps area diagnostics for bug-proc-maps-lseek-refresh
* fix(starry): fix bug-proc-maps-lseek-refresh test failure
Two fixes:
1. pseudofs/proc: render_thread_maps() used '?' on backend.file_info()
which aborted the entire area iteration when an area had no name
or file backing (e.g. PROT_NONE guard pages). Use
unwrap_or_else() with a default-empty BackendFileInfo instead
so all VMAs always appear in /proc/self/maps.
2. test/proc-maps: the test's has_vma_prefix() used %08lx which
produces 8-hex-digit addresses, but the kernel uses {:016x}
(16 hex digits on 64-bit). Use %0*lx with addr_width =
sizeof(void*)*2 to match the kernel's output format.
* fix: resolve merge conflicts with upstream/dev PR rcore-os#1167
- Remove duplicate ProcMemFile (old WeakAxTaskRef version)
- Remove duplicate 'mem' node in ThreadDir
- Accept upstream per-TID ptrace refactor for task/mod.rs, signal.rs, user.rs
- Keep our render_thread_maps file_info() unwind fix
* fix: complete per-TID ptrace API migration and execve stop semantics
- ptrace.rs: migrate x86_64 FP regset paths from old process-wide
ptrace_stop_fp_data()/set_ptrace_stop_fp_data() to per-TID
ptrace_stop_fp_data_for(tid)/set_ptrace_stop_fp_data_for(tid, ...)
using raw [u64;32] bytes to bridge FxsaveArea ↔ arch-independent
PtraceStopRecord storage.
- execve.rs: fix PTRACE_TRACEME exec-stop semantics. Linux requires
TRACEME'd tasks to always generate a SIGTRAP stop on execve;
PTRACE_O_TRACEEXEC only controls whether the stop carries
PTRACE_EVENT_EXEC. Move the TRACEME check outside the TRACEEXEC
option gate.
- reports: fix trailing whitespace and EOF blank lines for
diff --check compliance.
* fix(starry-kernel): correct x86_64 ptrace single-step, exec-stop and register reporting
- user.rs: arm x86_64 hardware single-step (RFLAGS.TF) for traced tracees, and
route the resulting #DB to a SIGTRAP ptrace-stop that disarms the per-TID
single-step flag and clears the saved TF (the CPU pushes EFLAGS with TF still
set), so a subsequent PTRACE_CONT runs free instead of single-stepping.
- axcpu/x86_64/trap.rs: drop the panic on an unhandled #DB; let it fall through
to the user-space exception loop (kprobe/uprobe debug handlers still win).
- ptrace.rs: report Linux-convention user selectors cs=0x33/ss=0x2b via
GETREGS/GETREGSET and accept them in SETREGS so debuggers detect a 64-bit
inferior instead of i386; correct the single-step TF comment.
- execve.rs: every ptrace tracee stops with SIGTRAP on execve (PTRACE_O_TRACEEXEC
only controls the event payload, not whether the stop occurs).
- proc.rs: drop a duplicate /proc/<pid>/mem entry in the thread dir listing.
* test(starry): convert test-gdb-native-batch to a raw-ptrace tracer
Replace the real /usr/bin/gdb driver with a self-contained raw-ptrace tracer
(matching riscv's test-ptrace-gdb), validating the kernel's ptrace on a
dynamically-linked process across execve and ld-musl startup without depending
on GDB's startup probes or target-description negotiation:
fork + PTRACE_TRACEME + execve(dynamic target) -> exec-stop -> read AT_ENTRY
from /proc/<pid>/auxv -> plant INT3 at AT_ENTRY -> PTRACE_CONT (ld-musl runs
fully under ptrace) -> trap at the application entry -> restore + single-step
-> PTRACE_CONT to exit 0.
- add c/src/tracer.c; CMakeLists builds both the dynamic target and the tracer
- qemu-x86_64.toml runs the tracer; success "DONE: N pass, 0 fail"
- remove gdb-native-batch.gdb, run-gdb-native-batch.sh, prebuild.sh (no gdb)
* test(starry): migrate x86 ptrace/gdb cases into grouped system and fix exec-stop path
Move 5 x86 ptrace/gdb test cases from undiscovered normal/qemu-smp1/ to
qemu-smp1/system/ with arch-filtered CMakeLists that install into
starry-test-suit, making them participate in the grouped CI runner.
- test-ptrace-x86-regs: remove canary fork, return exit code directly
- test-ptrace-x86-breakpoint: fix printf format string
- test-gdb-native-batch: split into tracer (starry-test-suit) and
target (usr/bin), rename to test-gdb-native-batch-tracer
Promote test-ptrace-exec-stop from starry-known-fail / riscv-only to
starry-test-suit on riscv64|x86_64. Fix hardcoded path by using
/proc/self/exe so the re-exec child finds itself under the grouped
install location.
Delete stray test-ptrace-exec-stop/qemu-x86_64.toml (double discovery).
Verified: x86_64 and riscv64 grouped system both PASS, all ptrace
binaries show STARRY_SYSTEM_TEST_PASSED.
* chore(ci): re-trigger CI after roc-rk3568 board u-boot flake
* ci: trigger test run
* ci: trigger test run
* chore: remove accidentally committed internal ptrace/gdb reports
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(axbuild): tolerate slow guests in host HTTP test server
The apk-curl-equivalence system case downloads a 20MB payload from the
host HTTP server. The server used a 1s per-write timeout and silently
discarded write errors, so whenever a slow guest (notably x86_64, the
slowest QEMU guest) applied TCP backpressure for over a second, the body
write timed out, the error was dropped, and the connection was closed
mid-stream. curl then failed with "(18) end of response with N bytes
missing", flaking the x86_64 starry qemu test.
Raise the body write timeout to 30s (still finite so a wedged guest
cannot block the server thread and its Drop/join forever) and surface
write errors instead of swallowing them.
* test(starry): wire x86 ptrace/gdb cases into grouped system runner
The new x86_64 ptrace/gdb system cases were laid out as
system/<case>/c/CMakeLists.txt + c/src/, but the qemu-smp*/system
grouped runner builds one root CMake project that only add_subdirectory()
each subcase whose CMakeLists.txt sits directly under system/<case>.
As a result these cases were never built/installed in aggregate runs and
`-c qemu-smp1/system/<case>` failed at configure time with
"unknown grouped C subcase".
Move each case to the flat system subcase layout required by
test-suit/starryos/GUIDE.md (CMakeLists.txt + src/ at the case root) and
fix the relative include of common/starry_arch_filter.cmake accordingly.
Install destinations are unchanged.
Cases: test-ptrace-x86-regs, test-ptrace-x86-breakpoint,
test-ptrace-x86-breakpoint-reinsert, test-ptrace-x86-singlestep,
test-gdb-native-batch.
* fix(starry-kernel): rebase x86_64 ptrace onto upstream/dev per-tid baseline
Replace ptrace.rs with upstream/dev version as baseline and port x86_64 code:
- Add X8664UserRegs struct + From<UserContext>/write_to/sanitize_eflags
- Add X86_64_USER_* constants + peeksuser/pokeuser/user_area_x86_64
- Add x86_64 getregs/setregs/getfpregs/setfpregs/getregset/setregset impls
- Add ptrace_setup_singlestep for x86_64 (RFLAGS.TF)
- Wire x86_64 into multi-arch dispatch gates (NT_FPREGSET/NT_PRSTATUS)
- Define x86_64 PtraceStopFpData as tuple struct + real fxsave/fxrstor
- Add x86_64 to signal.rs ptrace FP save and mod.rs save/restore
Fixes three build-blocking issues:
- ptrace_restore_singlestep_insn present for all archs (from upstream baseline)
- ptrace_setup_singlestep present for aarch64/loongarch64 (from upstream baseline)
- x86_64 FP type matches between ptrace.rs and mod.rs (tuple struct)
* fix(starry-kernel): store full FxsaveArea in x86_64 PtraceStopFpData
Replace PtraceStopFpData([u64; 32], usize) with PtraceStopFpData(FxsaveArea)
to match the 512-byte FXSAVE area. Fixes out-of-bounds memory access at
4 call sites where from_raw_parts(ptr, 512) was created from a 256-byte
[u64; 32] array — UB when the slice exceeded the allocation.
save/restore/GETFPREGS/SETFPREGS/NT_FPREGSET now directly copy the full
FxsaveArea, preserving all XMM/MXCSR state.
* fix(starry): downgrade loader/execve logs to debug, restore kernel #DB panic, add TLS contiguity comment
* test(starry): add x86_64 ptrace FP register coverage
Exercises PTRACE_GETFPREGS/SETFPREGS and NT_PRFPREG round-trip on x86_64,
checking xmm0, xmm10 (offset 320) and xmm15 (offset 400) so a regression that
preserves only part of the 512-byte FXSAVE area is caught. The child loads
known XMM values and stops via a direct kill() syscall to avoid libc clobbering
the registers; the tracer verifies the read-back, writes sentinels, and the
child confirms them after resume. Auto-discovered under qemu-smp1/system.
* fix(starry-kernel): remove duplicate ptrace_setregset_prstatus, fix axnet typo and register call
* chore: fmt execve.rs register call
* fix(starry-kernel): remove unused VirtAddr and DirectRwFsFileOps imports in proc.rs
* chore: fmt proc.rs import line
* fix(starry-kernel): gate format_statm/format_status_vm_lines with cfg(test)
* fix(starry-kernel): gate alloc::format import with cfg(test)
* chore: reorder stats.rs imports for fmt
* fix(starry-kernel): scope ptrace get/setfpregs cfg to all non-x86 arches
ptrace_getfpregs/ptrace_setfpregs use the generic ArchFpRegs path for the
non-x86 architectures, but the supported arm was gated on
any(riscv64, loongarch64) (missing aarch64) while the Unsupported fallback
was gated on not(any(riscv64, x86_64)). On loongarch64 both arms matched,
causing E0428 (duplicate definition); on aarch64 the function fell through
to the Unsupported stub instead of the real ArchFpRegs path. Widen the
supported arm to any(riscv64, aarch64, loongarch64) and the fallback to
not(any(riscv64, aarch64, loongarch64, x86_64)), matching get/setregs.
* fix(starry-kernel): restore /proc features dropped by a bad merge revert
During an earlier conflict resolution, pseudofs/proc.rs was reverted to a
pre-refactor version, silently dropping upstream features: /proc/<pid>/mem
(ProcMemFile + read_at/write_at/check_access), /proc/<pid>/status memory
stats (sample_mem_stats, TaskStatusBase/TaskStatusFields) and the namespace
directory (NsDir), plus their tests. Restore the current upstream/dev proc.rs
and re-apply the only two genuine branch-local tweaks on top: the extended
loongarch /proc/cpuinfo Feat flags, and /proc/<pid>/maps full-width addresses
with anonymous-mapping file_info tolerance.
* fix(axbuild): restore upstream overlay symlink injection
An earlier divergence replaced the two-pass overlay debugfs injection with a
single-pass variant, dropping two upstream behaviours: deferring symlink
creation until after their targets are written (debugfs validates the target),
and converting relative symlink targets to absolute guest paths. Restore the
upstream/dev implementation (which already uses link-path-first symlink args).
* fix(starry-kernel): un-gate ProcessMemStats format methods for /proc
format_statm and format_status_vm_lines had been marked #[cfg(test)] back when
the reverted proc.rs no longer called them (to avoid dead_code under -D warnings).
The restored proc.rs uses both in the real build (/proc/<pid>/statm and
/proc/<pid>/status), so the test-only gating broke non-x86 builds with E0599.
Restore upstream/dev stats.rs so the methods are available in all builds.
* chore: remove accidentally committed GitHub page snapshot
A 172KB GitHub page snapshot (Feat_x86 64 ptrace clean ... rcore-os_tgoskits@f4d00dd.html)
was swept into the branch by a stray 'git add .'. It is not source/test asset and
makes 'git diff --check' fail on trailing whitespace/EOF blank lines. Remove it and
gitignore these page snapshots so they cannot be re-committed.
* fix(starry): use STARRY_ROOTFS in gdb app prebuild
starry app qemu injects the rootfs image path as STARRY_ROOTFS, not
STARRY_BASE_ROOTFS, so the gdb prebuild failed require_env and the
GDB_SMOKE_PASSED qemu path never ran. Match the ffmpeg/pip/mosquitto apps:
read ${STARRY_ROOTFS:-${STARRY_BASE_ROOTFS:-}} and require STARRY_ROOTFS.
* refactor(starry-kernel): converge x86_64 GP registers into ArchUserRegs explicit-TID backend
- Add ArchUserRegs alias for x86_64
- Make write_to return AxResult<()> for all archs
- Expand generic read/write backends to cover x86_64
- Remove parallel x86_64 helper functions
- Unify getregs/setregs into single generic bodies
- Remove inline arch dispatch from getregset/setregset_prstatus
- Update PEEKUSER/POKEUSER user-area to generic backend
- Remove redundant selected-stop wrappers from detach_live_tracees_of
* fix(starry): use dynamic platform for gdb x86_64 app build config
The gdb app x86_64 build config pinned the legacy static x86 platform
(ax-hal/x86-pc, ax-driver/plat-static, the qemu feature, plat_dyn=false).
x86_64 Starry runs on the dynamic platform path, which registers no static
platform package, so 'cargo xtask starry app qemu -t gdb --arch x86_64'
failed at build-config with 'no default platform package is registered for
arch x86_64' and the GDB_SMOKE_PASSED path was unreachable. Drop the static
deps and match the other Starry x86_64 app configs (git/top): keep only the
virtio driver features on the dynamic platform. Verified end-to-end in the
container: boots to a shell, gdb 16.3 runs, GDB_SMOKE_PASSED.
* chore(repo): remove unused workspace crates (rcore-os#1306)
* feat(axbuild): internalize Starry kallsyms flow (rcore-os#1309)
* fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM runner (rcore-os#1315)
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
* fix(starry): correct x86_64 u_debugreg offset in struct user
x86_64 PTRACE_PEEKUSER/POKEUSER on the debug-register area used
X86_64_USER_DEBUGREG_OFFSET = 912, but u_debugreg[] sits at offset 848 in
the x86_64 `struct user` (regs 216 + u_fpvalid/pad 8 + i387 512 + tsize/
dsize/ssize 24 + start_code/start_stack 16 + signal 8 + reserved/pad 8 +
u_ar0 8 + u_fpstate 8 + magic 8 + comm 32 = 848).
gdbserver probes the hardware debug registers (DR0–DR7) via PEEKUSER at
this offset during startup; with the wrong offset it read a bogus location
and stalled before printing "Listening on port 1234", so the x86_64
gdbserver smoke hung. The native single-process GDB smoke does not touch
debug registers, which is why only the gdbserver path was affected.
Fix the offset to 848. Verified end-to-end in the container: the x86_64
gdbserver smoke now reaches GDBSERVER_SMOKE_DONE.
* feat(gdb-smoke): port GDB and gdbserver smoke to x86_64
参照现有 riscv64/aarch64/loongarch64 实现,为 gdb-smoke 增加 x86_64 的
原生 GDB 冒烟与单进程 gdbserver 冒烟移植:
- 新增 build-x86_64-unknown-none.toml 与默认 qemu-x86_64.toml(native
批量冒烟,成功标志 GDB_NATIVE_SMOKE_DONE);
- 补齐 gdbserver 全套:qemu-x86_64-gdbserver.toml(默认 gdbserver 冒烟,
GDBSERVER_SMOKE_DONE)、gdbserver-host.toml、gdbserver-manual.toml,以及
host-remote-x86_64.gdb / host-manual-x86_64.gdb(set architecture
i386:x86-64);
- prebuild.sh 的 find_qemu_runner 增加 x86_64 分支(qemu-x86_64 +
x86_64-linux-musl);
- README 补充 x86_64 native 与 gdbserver 用法。
gdbserver 路径依赖同分支的 x86_64 u_debugreg 偏移修复才能跑通。已在容器内
验证:native 冒烟 GDB_NATIVE_SMOKE_DONE、gdbserver 冒烟 GDBSERVER_SMOKE_DONE
均通过(断点/backtrace/continue/远程连接/正常退出全部正确)。
---------
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Co-authored-by: 54dK3n <ken@kendeAir.lan>
Co-authored-by: 54dK3n <ken@kendeMacBook-Air.local>
Co-authored-by: 54dK3n <ken@ac-c9-06-23-1e-48.walkup.net.uq.edu.au>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: 周睿 <34859362+ZR233@users.noreply.github.com>
Co-authored-by: 禾可 <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…e-os#1282) * test(starry): add Go 1.26 language carpet (apps/starry/go-lang) 新增 apps/starry/go-lang —— Go 1.26(go1.26.3)语言级地毯式测试 app,2018 条确定化断言:语言全语法 + 并发 + ~40 标准库包 + Go 1.26 新特性 + 框架运行时(gin / google.golang.org/grpc / go-zero / gorm + 纯 Go modernc SQLite 驱动)。 prebuild.sh 用官方 go1.26.3 工具链(SHA256 校验)`CGO_ENABLED=0` 交叉编译为全静态二进制 golang-lang(无 libc/解释器),注入 overlay;on-target 跑完后由 go/run-go.sh 门控与 host golden 逐字节比对,仅匹配时打印 TEST PASSED。go.sum 固定版本、`-mod=readonly` 可复现构建。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 GO_LANG_OK + GOLANG count=2018 + golden 精确匹配;x86_64 经 CI。结构对照已合入的 apps/starry/python-lang (rcore-os#1257)。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fixed(toml): resolved to dyn. * test(go-lang): add stdlib-more module (archive, compress, crypto-aes-gcm, ed25519, sha1, hash-crc64, encoding-base32-pem-ascii85-gob, net-url, flag, log, io-fs, text-scanner-tabwriter, regexp-syntax) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after rcore-os#1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(go-lang): add host CLI carpets (go 158 assertions + goctl 121 assertions) from delivery Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (mergeable, all reviews approved) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(starry): go-lang loongarch64 build uses plat_dyn=false The build-loongarch64 config set plat_dyn = true alongside the built-in static-platform features (ax-hal/loongarch64-qemu-virt + ax-driver/plat-static), which ax-hal's build script rejects (plat-dyn must not combine with a built-in platform feature) and fails the loongarch64 app build. Match the merged python-lang (rcore-os#1257) loongarch64 config — identical feature set with plat_dyn = false — so cargo xtask starry app qemu -t go-lang --arch loongarch64 builds against the static platform. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(go-lang): correct std_more.go errors + regenerate golden std_more.go 此前从未实际编译过(CI 对 apps/starry/** 路径过滤跳过 app-qemu), 含编译错误与运行期断言错误,致整套 golang-lang carpet 无法构建运行: - 7 处布尔断言误用 3 参的 chk(label,got,want),改为 chkTrue(label,bool): crc64/adler32/gob×2/scanner×2/regexp-syntax。 - flag 段局部变量 fs 遮蔽 io/fs 导入,致 fs.ReadFile 解析为 *FlagSet 方法且 io/fs 未使用;重命名为 flagSet。 - sha1/sum 期望值硬编码错误,修正为 'sha1-test' 的真实 SHA1 (cebb8a6019488e80ca1e1c92322cfdfbff5c04a4)。 - scanner/scan-ident 多了一次 s.Scan();text/scanner 自动跳过空白, 误吞了标识符,移除多余调用。 修复后二进制不再在 sha1 断言处 os.Exit(1),五个框架段(gin httptest / grpc bufconn / go-zero rest+zrpc / database-sql+modernc sqlite / gorm) 均正常执行,断言数 773→2055,打印 GO_LANG_OK。重新生成两份 byte-identical golden(2112 行,3 次运行确定性一致),run-go.sh 门控通过。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Antareske
pushed a commit
to Antareske/tgoskits
that referenced
this pull request
Jun 27, 2026
…rcore-os#1283) * test(starry): add Node.js v22 language carpet (apps/starry/node-lang) 新增 apps/starry/node-lang —— Node.js v22.22.2(V8 引擎)语言级地毯式测试 app,结构对照已合入的 apps/starry/python-lang (rcore-os#1257)。 node/node-carpet.js 共 359 个确定化断言,在 StarryOS 上以 V8 全 JIT 运行(四架构均无需 --jitless,零内核改动):运行时/语言、CJS/ESM 双向互操作与动态 import()、现代 JS(ES2023+)、worker_threads(独立 V8 isolate)、定时器与核心标准库。每用例与 host node v22.22.2 黄金逐字节匹配或精确断言才计过。run_node_carpet.sh 聚合,全过打印 NODE_CARPET_OK 与 TEST PASSED。 prebuild.sh 经 qemu-user-static 把 musl-native 的 Alpine v3.22 `apk add nodejs icu-data-full` 闭包注入 overlay(网络优先,离线回退预取缓存)。node CLI 选项地毯 node-cli-carpet.sh(184 检查,宿主全绿)随 /usr/bin 一并 staged 供查阅,但不入 on-target 门控:少数 CLI 选项(如 --watch)驱动 fork/exec + fs watch 的内核进程模型特性(StarryOS 已知 gap),非语言层。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 NODE_CARPET_OK + TEST PASSED;x86_64 经 CI。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): align README with actual gate coverage — CLI carpet is host-only auxiliary, not on-target; x86_64 CI claim corrected to honest skip-by-path-filter Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(node-lang): replace 3 vacuous tests with real falsifiable assertions (async-iter, hashbang-grammar, http/METHODS) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add v22-specific CLI flags to carpet (+27 flags: transform-types, test-coverage, trace-env, use-system-ca, webstorage, shadow-realm, wasi, sqlite etc.) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add WeakMap/WeakSet/WeakRef/FinalizationRegistry + Iterator Helpers tests Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after rcore-os#1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (clippy cancelled, all starry/arceos tests PASSED) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): correct node-carpet.js check count to 367 on v22.22.2 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): unify run_node_carpet.sh comment to 367 checks Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): switch loongarch64 to dynamic platform Mirror the riscv64 dynamic build config (axplat-dyn, no ax-hal/loongarch64-qemu-virt / plat-static / plat_dyn=false; adds ax-driver/serial so the dynamic platform has a console). loongarch64 support must use the dynamic platform; the static loongarch64-qemu-virt path is being retired. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
luodeb
pushed a commit
that referenced
this pull request
Jun 30, 2026
…ner (#1315) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
luodeb
pushed a commit
that referenced
this pull request
Jun 30, 2026
* feat(starry-kernel): x86_64 ptrace register r/w and PTRACE_SINGLESTEP support
补齐 x86_64 ptrace 主干功能:
- 新增 `X8664UserRegs` 结构体 (repr(C)),对应 Linux
`user_regs_struct`,含 r15..rsp/ss/fs_base/gs_base 全部 27 个字段
- 实现 `From<UserContext> for X8664UserRegs` 和 `write_to()`
- 补齐 x86_64 上之前缺失的 ptrace opcode:
GETREGS / SETREGS / GETREGSET(NT_PRSTATUS) / SETREGSET(NT_PRSTATUS) /
GETSIGINFO / SETSIGINFO
- 将 `ptrace_getregset_prstatus` 中 `regs` 局部变量从内部 block 提升到
函数级作用域,修复 reg_bytes slice 的 use-after-free bug(regs 出 block
后被栈复用覆盖,导致用户态读到随机值,表现为 RSP=0x1)
- 新增 `ptrace_setup_singlestep` for x86_64:设置 RFLAGS 的 TF (bit 8)
触发 CPU 单步执行
- 为 x86_64 添加 singlestep setup 调用(之前仅 riscv64)
- 新增 `ExceptionKind::Debug` 处理分支:命中 traced task 的 #DB
异常时,清除 TF 并调用 ptrace_stop_current(SIGTRAP)
- Intel SDM 规定 CPU 在交付 TF 诱导的 #DB 时会清除 pushed RFLAGS
中的 TF,但 QEMU 不完全遵守,故显式清除防止 resume 后再次单步
| 测试 | 验证内容 |
|------|----------|
| test-ptrace-x86-regs | TRACEME -> GETREGS/GETREGSET/SETREGS/SETREGSET 闭环 |
| test-ptrace-exec-stop | TRACEME + execve -> SIGTRAP + DETACH |
| test-ptrace-x86-breakpoint | 双测试:software int3 最小闭环 + SINGLESTEP 基础验证 |
| test-ptrace-x86-singlestep | PTRACE_SINGLESTEP 执行一条指令后以 SIGTRAP stop |
| test-ptrace-x86-breakpoint-reinsert | gdb 风格断点恢复:rewind RIP -> 恢复原字节 -> SINGLESTEP -> 重新插入断点 -> 再次命中 |
| test-gdb-native-batch | gdb -q -batch 端到端:break native_marker / run / bt / info registers / continue |
所有 6 个 x86_64 ptrace case 全部通过。
* feat(starry): add gdb smoke test app and update mount-umount2 compat docs
- apps/starry/gdb: gdb --version smoke test for x86_64 QEMU
(qemu-x86_64.toml, build-x86_64-unknown-none.toml, prebuild.sh)
- docs: update mount-umount2 Linux compat documentation with
shared/private/slave/unbindable propagation, bind subdirectory,
MS_MOVE ELOOP, MS_REMOUNT|MS_BIND|MS_RDONLY semantics
* fix(starry-kernel): gate #DB handler behind #[cfg(target_arch = "x86_64")]
ExceptionKind::Debug and uctx.rflags only exist on x86_64, but the
Debug exception handler in user.rs had no cfg guard, leaking x86_64
single-step logic into all architecture builds. Wrap the entire
block in #[cfg(target_arch = "x86_64")].
Fixes CI failures on loongarch64/aarch64/riscv64.
* test(starryos): extend gdb batch timeout
* test(starryos): isolate gdb apk install stage
* fix(starry-kernel): harden x86_64 ptrace reg writes
* fix(starryos): bundle gdb runtime for batch test
* fix(apps): replace docker-run gdb install with qemu-user + native apk
The prebuild script used 'docker run alpine:edge apk add gdb' which requires
the Docker daemon that is not available inside the CI container. Switch to
qemu-x86_64-static + native apk, consistent with gdb-smoke/prebuild.sh.
* fix(apps): use musl ld directly instead of qemu-user for same-arch x86_64 gdb install
qemu-x86_64-static hangs when emulating x86_64 binaries on an x86_64
host during network-heavy operations like 'apk' package downloads. Use
the musl dynamic linker (ld-musl-x86_64.so.1) from the staging rootfs
to run Alpine apk natively without any emulation layer.
* fix(apps): fix gdb app prebuild with musl ld and complete runtime assets
Replace docker-run-based gdb install with native musl ld execution
of Alpine apk, fixing DNS resolution for the staging root.
Add missing gdb/Python runtime assets to overlay:
- /usr/share/gdb/ (gdb Python modules, syscalls, system-gdbinit)
- /usr/lib/python3.12/ (Python stdlib)
- /usr/lib/python312.zip
- libpython3.12.so*
- /usr/bin/python3
* fix(apps): enable virtio-blk and virtio-net drivers for gdb app
The build config only had the 'qemu' feature which does not
automatically enable virtio drivers. Without ax-driver/virtio-blk,
the kernel cannot detect the root block device, causing:
'failed to determine root device from available block devices'
Align with gdb-smoke's build config by adding the required
ax-driver/virtio-blk and ax-driver/virtio-net features.
* fix(apps): add missing virtio-gpu, virtio-input, virtio-socket features
Align gdb app build config with gdb-smoke and test-suit configs.
* fix(axbuild): handle symlinks in overlay injection via debugfs
CMake install(PROGRAMS ...) preserves symlinks from the staging
rootfs, which causes inject_overlay to fail with:
'unsupported overlay entry ... only regular files and directories
are supported'
When a symlink is encountered during overlay traversal, use debugfs
symlink command to create the symbolic link in the target ext4 image
instead of bailing out.
* chore(ci): trigger re-run
* chore(ci): trigger re-run 2
* fix(starry-kernel): add x86_64 ptrace FP register support (GETFPREGS/SETFPREGS/NT_FPREGSET)
* fix(axbuild): swap debugfs symlink args to link-path-first order
The debugfs symlink command expects "symlink <link_path> <target>"
matching mke2fs convention. Also harden the x86_64 ptrace test with
canary-fork cleanup detection and kernel fault regexes.
* fix(starry-kernel): detach live tracees when tracer exits
* fix(starry-kernel): align x86 ptrace fp snapshots
* fix(starry-kernel): stabilize x86 native gdb ptrace flow
* fix(starry-kernel): clean up ptrace gdb follow-up fixes
* fix(starry-mm): fix file_read_offset computation for unaligned COW split
When vaddr < file_vaddr_base (page-aligned-down start in
unaligned mappings), the saturating_sub returned 0 instead of
correctly subtracting the gap from file_start. This caused
wrong file data to be read after mprotect-induced VMA splits.
Fixes bug-unaligned-cow-split test failure on loongarch64.
* fix(starry-kernel): fix clippy manual_is_multiple_of warning
* fix(starry-mm): extend file_end to cover PT_TLS init image and add execve diagnostics
- map_elf(): scan PT_TLS segments and extend last PT_LOAD file_end
so the COW backend can serve TLS init-image page faults for
the dynamic linker. Without this, ldso sees zeroed TLS data
on riscv64, leading to pc=0 crashes after execve.
- execve: add diagnostic logging for entry/sp/tp/ldso presence
to help debug future user-mode startup failures.
* fix(starry-mm): add AT_NULL auxv terminator to prevent ldso out-of-bounds scan
The auxv constructed in ElfLoader::load() was missing the AT_NULL
(type=0) terminator that the musl dynamic linker uses to stop scanning.
Without it, ld-musl reads past the auxv array into environment string
data on the stack, interpreting arbitrary bytes as auxv entries.
The second exec in init.sh ("exec /bin/sh -l -i") inherits env vars
from the first shell, reshaping the stack so that the out-of-bounds
scan hits garbage aliasing AT_PHDR or AT_ENTRY, producing pc=0 SIGSEGV
with exit code 139. The first exec succeeds only by coincidence — its
empty envp produces a less harmful stack layout.
Fix: push AuxEntry::new(AuxType::NULL, 0) after AT_HWCAP to properly
terminate the auxv.
* chore(ci): re-trigger CI
* test(starry): add SIGSEGV detection to board test fail_regex patterns
OrangePi-5-Plus and SG2002 board tests were timing out after 300-600s
because SIGSEGV crashes (busybox mesg, busybox shell) were not caught
by fail_regex, so the runner waited for the full timeout instead of
failing fast.
Add three patterns to all board test TOMLs:
- '(?i)segmentation fault'
- '(?i)SIGSEGV'
- 'exit with code: 139'
This ensures that any userspace SIGSEGV during boot/login is detected
immediately instead of being hidden behind a timeout.
* chore(ci): re-trigger CI after rustc segfault flake
* fix(starry-mm): add AT_NULL auxv terminator and execve/loader diagnostics
- ElfLoader::load(): add AuxType::NULL terminator to the auxv Vec
- Add info! diagnostic for entry/auxv_count/ldso/last_auxv_type
- execve: upgrade to info! with image name for crash correlation
- map_elf(): downgrade PT_TLS log to debug!
* fix(starry-mm): flush I-cache after populating executable pages on riscv64
On real hardware with non-coherent L1 I/D caches (T-Head C906 on
SG2002), a recycled physical frame from a prior exec may still
hold stale instruction-cache lines. New code bytes written via
D-cache stores by the COW backend are invisible to the I-cache
unless fence.i is executed, causing the CPU to fetch garbage
instructions and jump to pc=0.
Add fence.i (flush_icache_all) in handle_page_fault after
populating any page with EXECUTE permission. QEMU has no real
caches so this is a nop in simulation.
Also replace the stale 'TDOO: flush the I-cache' comment in
loader.rs with a note that coherence is now maintained at
fault time.
* fix(starry-mm): write back D-cache after populating executable pages on XuanTie C9xx
The SG2002 (T-Head C906) board test kept SIGSEGV-ing with pc=0 inside
ld-musl's _dlstart, even after the auxv terminator fix and an added
fence.i. Root cause: the C9xx L1 D-cache is write-back and `fence.i`
does not clean it to the point of unification. The COW backend writes
freshly-faulted code bytes into a frame through the cacheable kernel
linear mapping (phys_to_virt), leaving them in dirty D-cache lines.
The subsequent fence.i on user entry only invalidates the I-cache, so
the instruction fetch refills from stale memory and executes garbage,
jumping to 0. QEMU has no real caches, which is why it only fails on
the board.
- axcpu/riscv: add clean_dcache_range_to_pou(), a th.dcache.cva loop
(per 64-byte line) followed by th.sync.s, gated on xuantie-c9xx.
Opcodes 0x0295000b / 0x0190000b match Linux thead errata.c.
- cow backend: after populating/copying an executable page, clean the
written kernel mapping to the PoU on riscv64 so the I-fetch (after the
existing fence.i in UserContext::run) sees the new code.
- Drop the earlier ineffective fence.i in handle_page_fault; run()
already issues fence.i before every user entry, and the missing piece
was the D-cache writeback, not another I-cache invalidate.
* chore(starry-mm): dump full auxv and entry bytes for SG2002 crash triage
Temporary diagnostic: the SG2002 board still SIGSEGVs at pc=0 in
ld-musl _dlstart despite the cache-coherence fixes, and the entry
instructions execute (gp is set) before the jump to 0. To distinguish a
bad auxv (e.g. AT_ENTRY/AT_PHDR/AT_BASE) from corrupted loaded code
bytes, log every auxv entry and force-populate + hexdump the first 16
bytes at both the ldso entry and AT_ENTRY. To be reverted once root
cause is known.
* fix(starry-mm): read unaligned COW segment first page from correct file offset
The real cause of the SG2002 (and any dynamic-binary) pc=0 SIGSEGV in
ld-musl: commit 82b289c changed alloc_new_at()/file_info() so that when
vaddr < file_vaddr_base (the page-aligned-down first page of a segment
whose p_vaddr/p_offset is not page-aligned) the file offset was computed
as file_start - (file_vaddr_base - vaddr) instead of file_start.
For ld-musl the RW PT_LOAD is at vaddr=0x94b20 (holding .dynamic/GOT).
Its first page (0x94000) took the buggy branch and read the segment
bytes 0xb20 too early in the file, corrupting .dynamic/GOT. The dynamic
linker's RELATIVE self-relocation then produced garbage pointers and
jumped to 0 — deterministically, on the very first dynamic exec. The
ldso/app code pages themselves loaded fine (verified by dumping the
entry bytes), so this was never a cache-coherence problem.
The mapping invariant is simply: virtual address V maps to file offset
file_start + (V - file_vaddr_base). Restore the unified
`file_start + saturating_sub(vaddr, file_vaddr_base)` form (== the
pre-82b289cb1 code), which yields file_start for the unaligned first
page and the correct delta elsewhere. CowBackend::split keeps
file_vaddr_base/file_start intact, so the bug-unaligned-cow-split test
(which only reads page-aligned blob pages, all >= file_vaddr_base, via
the unchanged >= path) is unaffected.
Also revert the speculative XuanTie D-cache writeback and the auxv/byte
diagnostics added while chasing the wrong (cache) hypothesis.
* chore(ci): trigger CI after sync with main
* chore(starry): add proc maps area diagnostics for bug-proc-maps-lseek-refresh
* fix(starry): fix bug-proc-maps-lseek-refresh test failure
Two fixes:
1. pseudofs/proc: render_thread_maps() used '?' on backend.file_info()
which aborted the entire area iteration when an area had no name
or file backing (e.g. PROT_NONE guard pages). Use
unwrap_or_else() with a default-empty BackendFileInfo instead
so all VMAs always appear in /proc/self/maps.
2. test/proc-maps: the test's has_vma_prefix() used %08lx which
produces 8-hex-digit addresses, but the kernel uses {:016x}
(16 hex digits on 64-bit). Use %0*lx with addr_width =
sizeof(void*)*2 to match the kernel's output format.
* fix: resolve merge conflicts with upstream/dev PR #1167
- Remove duplicate ProcMemFile (old WeakAxTaskRef version)
- Remove duplicate 'mem' node in ThreadDir
- Accept upstream per-TID ptrace refactor for task/mod.rs, signal.rs, user.rs
- Keep our render_thread_maps file_info() unwind fix
* fix: complete per-TID ptrace API migration and execve stop semantics
- ptrace.rs: migrate x86_64 FP regset paths from old process-wide
ptrace_stop_fp_data()/set_ptrace_stop_fp_data() to per-TID
ptrace_stop_fp_data_for(tid)/set_ptrace_stop_fp_data_for(tid, ...)
using raw [u64;32] bytes to bridge FxsaveArea ↔ arch-independent
PtraceStopRecord storage.
- execve.rs: fix PTRACE_TRACEME exec-stop semantics. Linux requires
TRACEME'd tasks to always generate a SIGTRAP stop on execve;
PTRACE_O_TRACEEXEC only controls whether the stop carries
PTRACE_EVENT_EXEC. Move the TRACEME check outside the TRACEEXEC
option gate.
- reports: fix trailing whitespace and EOF blank lines for
diff --check compliance.
* fix(starry-kernel): correct x86_64 ptrace single-step, exec-stop and register reporting
- user.rs: arm x86_64 hardware single-step (RFLAGS.TF) for traced tracees, and
route the resulting #DB to a SIGTRAP ptrace-stop that disarms the per-TID
single-step flag and clears the saved TF (the CPU pushes EFLAGS with TF still
set), so a subsequent PTRACE_CONT runs free instead of single-stepping.
- axcpu/x86_64/trap.rs: drop the panic on an unhandled #DB; let it fall through
to the user-space exception loop (kprobe/uprobe debug handlers still win).
- ptrace.rs: report Linux-convention user selectors cs=0x33/ss=0x2b via
GETREGS/GETREGSET and accept them in SETREGS so debuggers detect a 64-bit
inferior instead of i386; correct the single-step TF comment.
- execve.rs: every ptrace tracee stops with SIGTRAP on execve (PTRACE_O_TRACEEXEC
only controls the event payload, not whether the stop occurs).
- proc.rs: drop a duplicate /proc/<pid>/mem entry in the thread dir listing.
* test(starry): convert test-gdb-native-batch to a raw-ptrace tracer
Replace the real /usr/bin/gdb driver with a self-contained raw-ptrace tracer
(matching riscv's test-ptrace-gdb), validating the kernel's ptrace on a
dynamically-linked process across execve and ld-musl startup without depending
on GDB's startup probes or target-description negotiation:
fork + PTRACE_TRACEME + execve(dynamic target) -> exec-stop -> read AT_ENTRY
from /proc/<pid>/auxv -> plant INT3 at AT_ENTRY -> PTRACE_CONT (ld-musl runs
fully under ptrace) -> trap at the application entry -> restore + single-step
-> PTRACE_CONT to exit 0.
- add c/src/tracer.c; CMakeLists builds both the dynamic target and the tracer
- qemu-x86_64.toml runs the tracer; success "DONE: N pass, 0 fail"
- remove gdb-native-batch.gdb, run-gdb-native-batch.sh, prebuild.sh (no gdb)
* test(starry): migrate x86 ptrace/gdb cases into grouped system and fix exec-stop path
Move 5 x86 ptrace/gdb test cases from undiscovered normal/qemu-smp1/ to
qemu-smp1/system/ with arch-filtered CMakeLists that install into
starry-test-suit, making them participate in the grouped CI runner.
- test-ptrace-x86-regs: remove canary fork, return exit code directly
- test-ptrace-x86-breakpoint: fix printf format string
- test-gdb-native-batch: split into tracer (starry-test-suit) and
target (usr/bin), rename to test-gdb-native-batch-tracer
Promote test-ptrace-exec-stop from starry-known-fail / riscv-only to
starry-test-suit on riscv64|x86_64. Fix hardcoded path by using
/proc/self/exe so the re-exec child finds itself under the grouped
install location.
Delete stray test-ptrace-exec-stop/qemu-x86_64.toml (double discovery).
Verified: x86_64 and riscv64 grouped system both PASS, all ptrace
binaries show STARRY_SYSTEM_TEST_PASSED.
* chore(ci): re-trigger CI after roc-rk3568 board u-boot flake
* ci: trigger test run
* ci: trigger test run
* chore: remove accidentally committed internal ptrace/gdb reports
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix(axbuild): tolerate slow guests in host HTTP test server
The apk-curl-equivalence system case downloads a 20MB payload from the
host HTTP server. The server used a 1s per-write timeout and silently
discarded write errors, so whenever a slow guest (notably x86_64, the
slowest QEMU guest) applied TCP backpressure for over a second, the body
write timed out, the error was dropped, and the connection was closed
mid-stream. curl then failed with "(18) end of response with N bytes
missing", flaking the x86_64 starry qemu test.
Raise the body write timeout to 30s (still finite so a wedged guest
cannot block the server thread and its Drop/join forever) and surface
write errors instead of swallowing them.
* test(starry): wire x86 ptrace/gdb cases into grouped system runner
The new x86_64 ptrace/gdb system cases were laid out as
system/<case>/c/CMakeLists.txt + c/src/, but the qemu-smp*/system
grouped runner builds one root CMake project that only add_subdirectory()
each subcase whose CMakeLists.txt sits directly under system/<case>.
As a result these cases were never built/installed in aggregate runs and
`-c qemu-smp1/system/<case>` failed at configure time with
"unknown grouped C subcase".
Move each case to the flat system subcase layout required by
test-suit/starryos/GUIDE.md (CMakeLists.txt + src/ at the case root) and
fix the relative include of common/starry_arch_filter.cmake accordingly.
Install destinations are unchanged.
Cases: test-ptrace-x86-regs, test-ptrace-x86-breakpoint,
test-ptrace-x86-breakpoint-reinsert, test-ptrace-x86-singlestep,
test-gdb-native-batch.
* fix(starry-kernel): rebase x86_64 ptrace onto upstream/dev per-tid baseline
Replace ptrace.rs with upstream/dev version as baseline and port x86_64 code:
- Add X8664UserRegs struct + From<UserContext>/write_to/sanitize_eflags
- Add X86_64_USER_* constants + peeksuser/pokeuser/user_area_x86_64
- Add x86_64 getregs/setregs/getfpregs/setfpregs/getregset/setregset impls
- Add ptrace_setup_singlestep for x86_64 (RFLAGS.TF)
- Wire x86_64 into multi-arch dispatch gates (NT_FPREGSET/NT_PRSTATUS)
- Define x86_64 PtraceStopFpData as tuple struct + real fxsave/fxrstor
- Add x86_64 to signal.rs ptrace FP save and mod.rs save/restore
Fixes three build-blocking issues:
- ptrace_restore_singlestep_insn present for all archs (from upstream baseline)
- ptrace_setup_singlestep present for aarch64/loongarch64 (from upstream baseline)
- x86_64 FP type matches between ptrace.rs and mod.rs (tuple struct)
* fix(starry-kernel): store full FxsaveArea in x86_64 PtraceStopFpData
Replace PtraceStopFpData([u64; 32], usize) with PtraceStopFpData(FxsaveArea)
to match the 512-byte FXSAVE area. Fixes out-of-bounds memory access at
4 call sites where from_raw_parts(ptr, 512) was created from a 256-byte
[u64; 32] array — UB when the slice exceeded the allocation.
save/restore/GETFPREGS/SETFPREGS/NT_FPREGSET now directly copy the full
FxsaveArea, preserving all XMM/MXCSR state.
* fix(starry): downgrade loader/execve logs to debug, restore kernel #DB panic, add TLS contiguity comment
* test(starry): add x86_64 ptrace FP register coverage
Exercises PTRACE_GETFPREGS/SETFPREGS and NT_PRFPREG round-trip on x86_64,
checking xmm0, xmm10 (offset 320) and xmm15 (offset 400) so a regression that
preserves only part of the 512-byte FXSAVE area is caught. The child loads
known XMM values and stops via a direct kill() syscall to avoid libc clobbering
the registers; the tracer verifies the read-back, writes sentinels, and the
child confirms them after resume. Auto-discovered under qemu-smp1/system.
* fix(starry-kernel): remove duplicate ptrace_setregset_prstatus, fix axnet typo and register call
* chore: fmt execve.rs register call
* fix(starry-kernel): remove unused VirtAddr and DirectRwFsFileOps imports in proc.rs
* chore: fmt proc.rs import line
* fix(starry-kernel): gate format_statm/format_status_vm_lines with cfg(test)
* fix(starry-kernel): gate alloc::format import with cfg(test)
* chore: reorder stats.rs imports for fmt
* fix(starry-kernel): scope ptrace get/setfpregs cfg to all non-x86 arches
ptrace_getfpregs/ptrace_setfpregs use the generic ArchFpRegs path for the
non-x86 architectures, but the supported arm was gated on
any(riscv64, loongarch64) (missing aarch64) while the Unsupported fallback
was gated on not(any(riscv64, x86_64)). On loongarch64 both arms matched,
causing E0428 (duplicate definition); on aarch64 the function fell through
to the Unsupported stub instead of the real ArchFpRegs path. Widen the
supported arm to any(riscv64, aarch64, loongarch64) and the fallback to
not(any(riscv64, aarch64, loongarch64, x86_64)), matching get/setregs.
* fix(starry-kernel): restore /proc features dropped by a bad merge revert
During an earlier conflict resolution, pseudofs/proc.rs was reverted to a
pre-refactor version, silently dropping upstream features: /proc/<pid>/mem
(ProcMemFile + read_at/write_at/check_access), /proc/<pid>/status memory
stats (sample_mem_stats, TaskStatusBase/TaskStatusFields) and the namespace
directory (NsDir), plus their tests. Restore the current upstream/dev proc.rs
and re-apply the only two genuine branch-local tweaks on top: the extended
loongarch /proc/cpuinfo Feat flags, and /proc/<pid>/maps full-width addresses
with anonymous-mapping file_info tolerance.
* fix(axbuild): restore upstream overlay symlink injection
An earlier divergence replaced the two-pass overlay debugfs injection with a
single-pass variant, dropping two upstream behaviours: deferring symlink
creation until after their targets are written (debugfs validates the target),
and converting relative symlink targets to absolute guest paths. Restore the
upstream/dev implementation (which already uses link-path-first symlink args).
* fix(starry-kernel): un-gate ProcessMemStats format methods for /proc
format_statm and format_status_vm_lines had been marked #[cfg(test)] back when
the reverted proc.rs no longer called them (to avoid dead_code under -D warnings).
The restored proc.rs uses both in the real build (/proc/<pid>/statm and
/proc/<pid>/status), so the test-only gating broke non-x86 builds with E0599.
Restore upstream/dev stats.rs so the methods are available in all builds.
* chore: remove accidentally committed GitHub page snapshot
A 172KB GitHub page snapshot (Feat_x86 64 ptrace clean ... rcore-os_tgoskits@f4d00dd.html)
was swept into the branch by a stray 'git add .'. It is not source/test asset and
makes 'git diff --check' fail on trailing whitespace/EOF blank lines. Remove it and
gitignore these page snapshots so they cannot be re-committed.
* fix(starry): use STARRY_ROOTFS in gdb app prebuild
starry app qemu injects the rootfs image path as STARRY_ROOTFS, not
STARRY_BASE_ROOTFS, so the gdb prebuild failed require_env and the
GDB_SMOKE_PASSED qemu path never ran. Match the ffmpeg/pip/mosquitto apps:
read ${STARRY_ROOTFS:-${STARRY_BASE_ROOTFS:-}} and require STARRY_ROOTFS.
* refactor(starry-kernel): converge x86_64 GP registers into ArchUserRegs explicit-TID backend
- Add ArchUserRegs alias for x86_64
- Make write_to return AxResult<()> for all archs
- Expand generic read/write backends to cover x86_64
- Remove parallel x86_64 helper functions
- Unify getregs/setregs into single generic bodies
- Remove inline arch dispatch from getregset/setregset_prstatus
- Update PEEKUSER/POKEUSER user-area to generic backend
- Remove redundant selected-stop wrappers from detach_live_tracees_of
* fix(starry): use dynamic platform for gdb x86_64 app build config
The gdb app x86_64 build config pinned the legacy static x86 platform
(ax-hal/x86-pc, ax-driver/plat-static, the qemu feature, plat_dyn=false).
x86_64 Starry runs on the dynamic platform path, which registers no static
platform package, so 'cargo xtask starry app qemu -t gdb --arch x86_64'
failed at build-config with 'no default platform package is registered for
arch x86_64' and the GDB_SMOKE_PASSED path was unreachable. Drop the static
deps and match the other Starry x86_64 app configs (git/top): keep only the
virtio driver features on the dynamic platform. Verified end-to-end in the
container: boots to a shell, gdb 16.3 runs, GDB_SMOKE_PASSED.
* chore(repo): remove unused workspace crates (#1306)
* feat(axbuild): internalize Starry kallsyms flow (#1309)
* fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM runner (#1315)
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
* fix(starry): correct x86_64 u_debugreg offset in struct user
x86_64 PTRACE_PEEKUSER/POKEUSER on the debug-register area used
X86_64_USER_DEBUGREG_OFFSET = 912, but u_debugreg[] sits at offset 848 in
the x86_64 `struct user` (regs 216 + u_fpvalid/pad 8 + i387 512 + tsize/
dsize/ssize 24 + start_code/start_stack 16 + signal 8 + reserved/pad 8 +
u_ar0 8 + u_fpstate 8 + magic 8 + comm 32 = 848).
gdbserver probes the hardware debug registers (DR0–DR7) via PEEKUSER at
this offset during startup; with the wrong offset it read a bogus location
and stalled before printing "Listening on port 1234", so the x86_64
gdbserver smoke hung. The native single-process GDB smoke does not touch
debug registers, which is why only the gdbserver path was affected.
Fix the offset to 848. Verified end-to-end in the container: the x86_64
gdbserver smoke now reaches GDBSERVER_SMOKE_DONE.
* feat(gdb-smoke): port GDB and gdbserver smoke to x86_64
参照现有 riscv64/aarch64/loongarch64 实现,为 gdb-smoke 增加 x86_64 的
原生 GDB 冒烟与单进程 gdbserver 冒烟移植:
- 新增 build-x86_64-unknown-none.toml 与默认 qemu-x86_64.toml(native
批量冒烟,成功标志 GDB_NATIVE_SMOKE_DONE);
- 补齐 gdbserver 全套:qemu-x86_64-gdbserver.toml(默认 gdbserver 冒烟,
GDBSERVER_SMOKE_DONE)、gdbserver-host.toml、gdbserver-manual.toml,以及
host-remote-x86_64.gdb / host-manual-x86_64.gdb(set architecture
i386:x86-64);
- prebuild.sh 的 find_qemu_runner 增加 x86_64 分支(qemu-x86_64 +
x86_64-linux-musl);
- README 补充 x86_64 native 与 gdbserver 用法。
gdbserver 路径依赖同分支的 x86_64 u_debugreg 偏移修复才能跑通。已在容器内
验证:native 冒烟 GDB_NATIVE_SMOKE_DONE、gdbserver 冒烟 GDBSERVER_SMOKE_DONE
均通过(断点/backtrace/continue/远程连接/正常退出全部正确)。
---------
Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
Co-authored-by: 54dK3n <ken@kendeAir.lan>
Co-authored-by: 54dK3n <ken@kendeMacBook-Air.local>
Co-authored-by: 54dK3n <ken@ac-c9-06-23-1e-48.walkup.net.uq.edu.au>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: 周睿 <34859362+ZR233@users.noreply.github.com>
Co-authored-by: 禾可 <chengkelfan@qq.com>
luodeb
pushed a commit
that referenced
this pull request
Jun 30, 2026
* test(starry): add Go 1.26 language carpet (apps/starry/go-lang) 新增 apps/starry/go-lang —— Go 1.26(go1.26.3)语言级地毯式测试 app,2018 条确定化断言:语言全语法 + 并发 + ~40 标准库包 + Go 1.26 新特性 + 框架运行时(gin / google.golang.org/grpc / go-zero / gorm + 纯 Go modernc SQLite 驱动)。 prebuild.sh 用官方 go1.26.3 工具链(SHA256 校验)`CGO_ENABLED=0` 交叉编译为全静态二进制 golang-lang(无 libc/解释器),注入 overlay;on-target 跑完后由 go/run-go.sh 门控与 host golden 逐字节比对,仅匹配时打印 TEST PASSED。go.sum 固定版本、`-mod=readonly` 可复现构建。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 GO_LANG_OK + GOLANG count=2018 + golden 精确匹配;x86_64 经 CI。结构对照已合入的 apps/starry/python-lang (#1257)。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fixed(toml): resolved to dyn. * test(go-lang): add stdlib-more module (archive, compress, crypto-aes-gcm, ed25519, sha1, hash-crc64, encoding-base32-pem-ascii85-gob, net-url, flag, log, io-fs, text-scanner-tabwriter, regexp-syntax) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after #1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(go-lang): add host CLI carpets (go 158 assertions + goctl 121 assertions) from delivery Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (mergeable, all reviews approved) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(starry): go-lang loongarch64 build uses plat_dyn=false The build-loongarch64 config set plat_dyn = true alongside the built-in static-platform features (ax-hal/loongarch64-qemu-virt + ax-driver/plat-static), which ax-hal's build script rejects (plat-dyn must not combine with a built-in platform feature) and fails the loongarch64 app build. Match the merged python-lang (#1257) loongarch64 config — identical feature set with plat_dyn = false — so cargo xtask starry app qemu -t go-lang --arch loongarch64 builds against the static platform. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(go-lang): correct std_more.go errors + regenerate golden std_more.go 此前从未实际编译过(CI 对 apps/starry/** 路径过滤跳过 app-qemu), 含编译错误与运行期断言错误,致整套 golang-lang carpet 无法构建运行: - 7 处布尔断言误用 3 参的 chk(label,got,want),改为 chkTrue(label,bool): crc64/adler32/gob×2/scanner×2/regexp-syntax。 - flag 段局部变量 fs 遮蔽 io/fs 导入,致 fs.ReadFile 解析为 *FlagSet 方法且 io/fs 未使用;重命名为 flagSet。 - sha1/sum 期望值硬编码错误,修正为 'sha1-test' 的真实 SHA1 (cebb8a6019488e80ca1e1c92322cfdfbff5c04a4)。 - scanner/scan-ident 多了一次 s.Scan();text/scanner 自动跳过空白, 误吞了标识符,移除多余调用。 修复后二进制不再在 sha1 断言处 os.Exit(1),五个框架段(gin httptest / grpc bufconn / go-zero rest+zrpc / database-sql+modernc sqlite / gorm) 均正常执行,断言数 773→2055,打印 GO_LANG_OK。重新生成两份 byte-identical golden(2112 行,3 次运行确定性一致),run-go.sh 门控通过。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
luodeb
pushed a commit
that referenced
this pull request
Jun 30, 2026
…#1283) * test(starry): add Node.js v22 language carpet (apps/starry/node-lang) 新增 apps/starry/node-lang —— Node.js v22.22.2(V8 引擎)语言级地毯式测试 app,结构对照已合入的 apps/starry/python-lang (#1257)。 node/node-carpet.js 共 359 个确定化断言,在 StarryOS 上以 V8 全 JIT 运行(四架构均无需 --jitless,零内核改动):运行时/语言、CJS/ESM 双向互操作与动态 import()、现代 JS(ES2023+)、worker_threads(独立 V8 isolate)、定时器与核心标准库。每用例与 host node v22.22.2 黄金逐字节匹配或精确断言才计过。run_node_carpet.sh 聚合,全过打印 NODE_CARPET_OK 与 TEST PASSED。 prebuild.sh 经 qemu-user-static 把 musl-native 的 Alpine v3.22 `apk add nodejs icu-data-full` 闭包注入 overlay(网络优先,离线回退预取缓存)。node CLI 选项地毯 node-cli-carpet.sh(184 检查,宿主全绿)随 /usr/bin 一并 staged 供查阅,但不入 on-target 门控:少数 CLI 选项(如 --watch)驱动 fork/exec + fs watch 的内核进程模型特性(StarryOS 已知 gap),非语言层。 qemu-10 单核四架构实测:aarch64 / riscv64 / loongarch64 各 NODE_CARPET_OK + TEST PASSED;x86_64 经 CI。 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): align README with actual gate coverage — CLI carpet is host-only auxiliary, not on-target; x86_64 CI claim corrected to honest skip-by-path-filter Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * fix(node-lang): replace 3 vacuous tests with real falsifiable assertions (async-iter, hashbang-grammar, http/METHODS) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add v22-specific CLI flags to carpet (+27 flags: transform-types, test-coverage, trace-env, use-system-ca, webstorage, shadow-realm, wasi, sqlite etc.) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): add WeakMap/WeakSet/WeakRef/FinalizationRegistry + Iterator Helpers tests Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger CI after #1315 (smoke-vmx timeout fix) merged Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * ci: re-trigger (clippy cancelled, all starry/arceos tests PASSED) Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): correct node-carpet.js check count to 367 on v22.22.2 Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * docs(node-lang): unify run_node_carpet.sh comment to 367 checks Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> * test(node-lang): switch loongarch64 to dynamic platform Mirror the riscv64 dynamic build config (axplat-dyn, no ax-hal/loongarch64-qemu-virt / plat-static / plat_dyn=false; adds ax-driver/serial so the dynamic platform has a console). loongarch64 support must use the dynamic platform; the static loongarch64-qemu-virt path is being retired. Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com> --------- Signed-off-by: 林晨 (Leo Cheng) <chengkelfan@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-hosted runner smoke-vmx test times out at 180s when KVM is slow/misconfigured, causing fail-fast cascade that cancels all starry/arceos QEMU tests.
The test only boots a Linux guest and prints a success line — 180s is too tight for self-hosted hardware with flaky KVM.
Bump to 600s.
@ZR233