CI R384: GCC ASan stack-use-after-scope in V3 annotation_stack memo type descriptors
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
Start with vlib/v/types/annotation_stack_test.v and the failing command ./v -cc gcc -cflags -fsanitize=address ... vlib/v/types/annotation_stack_test.v, then generate the generated C with -keepc to find the __addr_2 stack object. Work out how the memo keeps a pointer to a temporary Type(int_) that outlives its initializer, which needs compiler and type-checker knowledge. Done means the exact ASan command passes without suppressing the check, skipping the test, or reducing the depth.
Written by the indexing model from the issue text.
Description
Executed master-CI failure (R384 — distinct from R380's strdup leak and R365's nested-map heap UAF)
- Revision:
f60a27d4b072e47dda80a21db0af579106ce0a11(November 22, 2026); the parent workflow was still queued but this underlying job actually executed and failed. - Job: Linux GCC AddressSanitizer shard 2, job 137163735121, finished 2026-11-22 13:18:15 UTC; 1 failed, 1,385 passed, 163 skipped in shard 3/4 summary.
- Exact repro from hosted log:
./v -cc gcc -cflags -fno-omit-frame-pointer -cflags -fsanitize=address -silent vlib/v/types/annotation_stack_test.v. - Actual trace:
AddressSanitizer: stack-use-after-scope, READ 8 intypes__mixed_integer_expr_type_can_widen→TypeChecker__widen_mixed_integer_expr_type→resolve_type_slow→annotate_node→test_annotation_walk_handles_deep_single_child_ast_iteratively. ASan identifies test-frame stack object__addr_2(16 bytes), originating at generated-C line 150748; this is neither a compiler diagnostic fixture nor an external library false-positive. - Fixture:
vlib/v/types/annotation_stack_test.v, unchanged between failing SHA and master1173cc3c; both tests populatememo.types[i] = Type(int_). The memo stores references to types (storage_query.vdereferences*memo.types[mi]), so the inline sum-type value is implicitly address-taken and a temporary stack descriptor may outlive its initializer. This matches the observed__addr_2expired stack object, but the precise generated C for this revision still needs inspection before definitive attribution. - Current applicability: unchanged test and type-checker implementation on descendant master; no matching validated fix found in targeted issue/PR search. A passed different ASan shard, queue state or unrelated newer master commit cannot close this.
Focused next actions
- Generate and retain GCC-ASan
-keepcfor the original fixture and identify__addr_2assignment and use; verify memo holds a pointer to temporaryType(int_). - Keep an
int_type := Type(int_)descriptor in function scope in each fixture and store&int_typeinto memo entries, preserving the 20k-depth test, sibling test and all assertions; prove before/after under native GCC ASan withdetect_stack_use_after_returnas available and Clang ASan/MSan control. - Run
./v self,./v fmt -w vlib/v/types/annotation_stack_test.v, the exact command, V compiler/type checker tests, and uninstrumented control. Do not suppress ASan, skip the test, or reduce depth. - Only mark verified-resolved when an actually executed matching corrected test/shard succeeds on patched revision/descendant.
Validation provenance
This record is based on the full hosted original log, source comparison, and a pointer-lifetime code inspection. No patched native V execution yet.
[!NOTE]
You can use the 👍 reaction to increase the issue's priority for developers.Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
- Dominant language
- V
- Stars
- 38.1k
- Forks
- 2.3k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 682
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vlang/v
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sagemathinc/sagebrush#1683 ·
Maintainers usually reply within 1 day
-
bot-triaged module: aotinductor module: compile-time module: inductor module: performance module: rocm oncall: export oncall: pt2 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
baseballyama/rsvelte#5235 ·
Maintainers usually reply within 1 day
-
lang-core: member access on a component instance reads its internal fields instead of giving nullOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
midspiral/LemmaScript#355 · 1 comment ·
Maintainers usually reply within 1 day