Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Nov 19, 2025

This commit resolves two critical issues identified in CI:

  1. LLVM Toolchain Detection
  • Problem: TOOLCHAIN_TYPE environment variable from CI wasn't being used
  • The build system only relied on auto-detection via CC_IS_CLANG
  • Result: All LLVM builds failed with "build_failed" status
  • Fix: Check TOOLCHAIN_TYPE=llvm before auto-detection
  1. Mutex Functional Test Timeout
  • Problem: Test exceeded 5-second timeout before printing PASS criteria
  • Monitor task ran 50 cycles with excessive yields (5 per cycle)
  • Each task iteration had 3 cooperation yields + 3 work yields

Summary by cubic

Fixes CI by correctly detecting LLVM via TOOLCHAIN_TYPE and making LLVM jobs build-only. GNU still runs the full test suite; LLVM tests are reported as skipped. Adds clean QEMU shutdown to prevent timeouts.

  • Bug Fixes
    • LLVM/Clang detection: Prioritize TOOLCHAIN_TYPE=llvm over CC_IS_CLANG; set CC_IS_CLANG=1 when provided; export TOOLCHAIN_TYPE to sub-makes.
    • CI workflow: Run app and functional tests only for GNU; for LLVM skip tests and mark exit codes as "skipped"; overall status depends on GNU passing and LLVM build success.
    • Functional tests: Increase timeout to 30s and print a 500-char output preview to help diagnose timeouts.
    • Mutex app: Minimize printf in tasks; print only final results; add QEMU shutdown via 0x100000 write to exit cleanly; keep preemptive scheduling enabled.
    • Semaphore app: Run tests cooperatively (no preemption) to avoid printf hangs; remove extra multitasking; add QEMU shutdown after completion.

Written for commit 20eed60. Summary will update automatically on new commits.

cubic-dev-ai[bot]

This comment was marked as outdated.

@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
This addresses critical CI issues:
1. LLVM Toolchain Detection
   - Fix TOOLCHAIN_TYPE environment variable not inherited by sub-makes
   - Prioritize TOOLCHAIN_TYPE=llvm check before CC_IS_CLANG
   - Export TOOLCHAIN_TYPE in Makefile for proper propagation
2. Functional Test Execution
   - Increase timeout from 10s to 30s
   - Configure LLVM for build-only validation (skip functional tests)
   - Mark LLVM tests as 'skipped' rather than 'passed' for clarity
3. Mutex Test Timeout Fix
   - Add QEMU shutdown mechanism after test completion
   - Prevents 30s timeout waiting for exit after successful results
   - Use virt machine test device (write 0x5555 to 0x100000)
4. Semaphore Test Thread Safety Fix
   - Refactor to run tests in cooperative mode (before preemptive
     scheduling)
   - Eliminates printf thread-safety issues causing hangs
   - Remove unnecessary multitasking infrastructure
   - Add QEMU shutdown after completion

Root cause: Printf is not thread-safe in preemptive multitasking environment.
Tests now either run before preemption is enabled or properly shut down QEMU.
@github-actions
Copy link

Linmo CI Test Results

Overall Status: ✅ passed
Timestamp: 2025-11-19T14:13:33+00:00

Toolchain Results

Toolchain Build Crash Test Functional
GNU ✅ passed ✅ passed ✅ passed
LLVM ✅ passed ⏭️ skipped ⏭️ skipped

Application Tests

App GNU LLVM
cond ✅ passed ⏭️ skipped
coop ✅ passed ⏭️ skipped
cpubench ✅ passed ⏭️ skipped
echo ✅ passed ⏭️ skipped
hello ✅ passed ⏭️ skipped
mqueues ✅ passed ⏭️ skipped
mutex ✅ passed ⏭️ skipped
pipes ✅ passed ⏭️ skipped
pipes_small ✅ passed ⏭️ skipped
pipes_struct ✅ passed ⏭️ skipped
prodcons ✅ passed ⏭️ skipped
progress ✅ passed ⏭️ skipped
rtsched ✅ passed ⏭️ skipped
semaphore ✅ passed ⏭️ skipped
suspend ✅ passed ⏭️ skipped
test64 ✅ passed ⏭️ skipped
timer ✅ passed ⏭️ skipped
timer_kill ✅ passed ⏭️ skipped

Functional Test Details

Test GNU LLVM
mutex:data_consistency ✅ passed ⏭️ skipped
mutex:fairness ✅ passed ⏭️ skipped
mutex:mutual_exclusion ✅ passed ⏭️ skipped
mutex:overall ✅ passed ⏭️ skipped
semaphore:all_tests_passed! ✅ passed ⏭️ skipped

Report generated from test-summary.toml

@sysprog21 sysprog21 deleted a comment from github-actions bot Nov 19, 2025
@jserv jserv merged commit 25c6e3c into main Nov 19, 2025
3 checks passed
@jserv jserv deleted the fix-ci branch November 19, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants