Skip to content

backport: partial bitcoin#33079 to run more asan jobs at the same time - #7633

Merged
PastaPastaPasta merged 2 commits into
dashpay:developfrom
knst:fix-asan-improvements
Aug 23, 2026
Merged

backport: partial bitcoin#33079 to run more asan jobs at the same time#7633
PastaPastaPasta merged 2 commits into
dashpay:developfrom
knst:fix-asan-improvements

Conversation

@knst

@knst knst commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Having 4jobs for asan causes functional tests to be aborted without an explanation on CI in logs.
Most likely it's caused by short memory and amount of jobs has been reduced to only 2 jobs.

What was done?

Backport bitcoin#33079 partially + increased amount of jobs

How Has This Been Tested?

Local tests shown that RAM used significantly reduced if 33079 included:

  8 MiB (default)  14335 MiB
  2048 KiB         12912 MiB
  1024 KiB         10657 MiB

Probably it will let to run more than 2 jobs at once.

Breaking Changes

N/A

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

knst added 2 commits August 22, 2026 01:35
3b23f95 ci: limit max stack size to 512 KiB (dergoegge)
2931a87 ci: limit stack size to 512kb in native macOS jobs (fanquake)

Partial: only the asan target and only the functional test stage.

Upstream sets CI_LIMIT_STACK_SIZE in ci/test/03_test_script.sh, which Dash
does not have; the equivalent point in Dash's flow is
ci/dash/test_integrationtests.sh, after the build and before test_runner.
Upstream also sets the variable for the arm, msan, tsan and
previous_releases targets. Those are green today and unit tests are not
where the job runs out of memory, so leave them alone rather than perturb
a passing configuration.

Upstream's 512 KiB does not work for Dash: dashd dies with SIGSEGV during
test framework startup. 1024 KiB is the smallest value tested that starts
cleanly (512 fails, 1024, 2048 and 4096 all pass).

Taken here for its effect on memory rather than its original purpose. ASan
sizes a thread's fake stack from the stack rlimit, and the threads that
actually run fault theirs in, so lowering the limit cuts resident memory
substantially. Peak resident set of all dashd nodes over
feature_llmq_data_recovery, feature_llmq_rotation, p2p_instantsend and
p2p_quorum_data at -j4:

  8 MiB (default)  14335 MiB
  2048 KiB         12912 MiB
  1024 KiB         10657 MiB

Thread count is not what drives this. The same run with -par=4 -parbls=4,
which takes each node from 15 script and 23 BLS worker threads down to 3
and 3, peaked at 14375 MiB, unchanged. Idle workers never fault their
stacks in.
@PastaPastaPasta

Copy link
Copy Markdown
Member

:( do we really need asan on each pr? Takes so long

@thepastaclaw

thepastaclaw commented Aug 21, 2026

Copy link
Copy Markdown

✅ Final review complete — no blockers (commit e357eb1)

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4db64ac8-1962-4c1b-aedc-67a8ea76b02e

📥 Commits

Reviewing files that changed from the base of the PR and between 7be28f8 and e357eb1.

📒 Files selected for processing (2)
  • ci/dash/test_integrationtests.sh
  • ci/test/00_setup_env_native_asan.sh

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The ASAN test setup now runs four parallel jobs instead of two and exports CI_LIMIT_STACK_SIZE=1. The integration test script checks this variable and sets the process stack limit to 1024 KB before tests run.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to e357e

This PR adjusts CI test parallelism and sanitizer memory settings without any identified merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description explains the ASan memory issue, stack-size change, increased concurrency, and test results.
Title check ✅ Passed The title clearly identifies the partial backport and the increase in concurrent ASan jobs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Codex/Sol only (Phase 2 disabled)

At exact head e357eb1, the ASan-only environment variable propagates through the CI matrix, applies the 1024 KiB stack limit before functional tests, and restores four-way test parallelism as intended. The changed scripts pass shell syntax validation, the configured stack limit applies successfully, and no in-scope defects were identified.
Source: Codex general, commit-history, and backport-reviewer lanes (exact backend model IDs were not supplied in the evidence); final verifier: Claude Agent SDK (exact backend model ID was not supplied). openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and is not reviewer evidence.

Validated zero-blocker Codex/Sol precheck evidence was promoted to final because Phase 2 (Sonnet/Opus) is temporarily disabled. This is Codex/Sol-only final validation, not Codex + Sonnet/Opus coverage.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — dash-core-commit-history (completed), gpt-5.6-sol — backport-reviewer (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet/Opus: not run (Phase 2 disabled — temporary Codex/Sol-only final)
  • Secondary pass: disabled (temporary_phase2_sonnet_disable)

@knst knst added this to the 24 milestone Aug 21, 2026
@knst

knst commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Takes so long

asan:

ALL                                                    | ✓ Passed  | 8394 s (accumulated)
Runtime: 2152 s

Job even finished faster than tsan on 7633.
Typical time for tsan for reference:

ALL                                                    | ✓ Passed  | 8510 s (accumulated)
Runtime: 2249 s

Also note that asan job replaced ubsan job, so, it's not +2100s but +1000s only for CI.
Typical ubsan type for reference:

 ALL                                                    | ✓ Passed  | 4578 s (accumulated) 
Runtime: 1186 s

:( do we really need asan on each pr?

Not really need but it seems useful for me

btw, asan already found a real issue on my PR - see dcca45b . Agents also pointed this issue out, so, I'd say it's useful but not like we won't survive without it.

But looking to your pessimism about asan I am not gonna push msan ; I will create PR with msan related changes but won't enable it on CI.

@PastaPastaPasta
PastaPastaPasta merged commit bc0f40f into dashpay:develop Aug 23, 2026
43 checks passed
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.

3 participants