← Back to Pull requests

LATX, fix: Release resources after reading an empty task cmdline #540

Open
ganjue66da opened this pull request with 128 lines diff across 4 files
View on GitHub
ganjue66da ganjue66da commented on Oct 31, 2026 08:00 UTC
Author

Summary / 变更说明

Reading another task's empty /proc/<pid>/cmdline, including a zombie task, returns before closing the input stream and freeing the argument vector. Repeated process scans therefore leak a descriptor on every empty result.

Close the stream and use the existing common argument cleanup. Register x86_64 and i386 regressions that scan an empty task cmdline 256 times and check that the descriptor count stays unchanged.

Validation / 验证

Tested independently at de9640ff3873cb98e85eabbdd3395d8291992d0d, directly on master (8479a8b8dbdc8f8e1bf2f157d34ae3caf6b81ee6), on LoongArch Linux with 16 KiB host pages. Translator version: 1.6.5-536-gde9640ff38.

Using the matching Meson 0.60.1 executable ($MESON) and verified prebuilt guest cmdline fixtures:

ninja -C build-rebase-tests -j12 latx-x86_64 latx-i386

"$MESON" test -C build-rebase-tests --no-rebuild \
  --print-errorlogs \
  test-empty-cmdline-fds-x86_64 test-empty-cmdline-fds-i386

"$MESON" test -C build-rebase-tests --no-rebuild \
  --suite lat-pr-fast --print-errorlogs --num-processes 6

  • Both translator builds passed.

  • Focused integration tests: 2/2 passed, zero skipped. Descriptor counts remain unchanged after 256 scans for both guest ABIs.

  • Complete lat-pr-fast: 52/52 passed, zero skipped. UBSan tests remain enabled; the host compiler wrapper selects Clang for those cases because host GCC lacks libubsan.

  • git diff --check, commit-message and author/DCO checks passed. Checkpatch: 0 errors, 1 warning, the test-file MAINTAINERS reminder.
  • This PR contains one independent fix. It does not require the executable-identity or Netlink fixes. A full GoldenDB stack/stress acceptance run was not repeated for this standalone revision.

    Checklist / 检查项

  • I have read CONTRIBUTING.md.

  • The commit contains a DCO sign-off matching its author.

  • Build, regression results and remaining validation scope are included.
  • Diff: 128 lines (+127 / -1) across 4 files Reviewer: None requested Review duration: 49499m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.55) × (1 − Review Confidence (0.42)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 128 lines diff across 4 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.291
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 item
    "Review active on #540"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    ganjue66da ganjue66da
    Labels
    risk: low confidence: 42.2% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 55.5% (MEDIUM) · Higher = larger blast radius
    55.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 42.2% · Lower = rushed or shallow review
    42.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.1% · Safe to merge
    32.1%