Skip to content

test: csharp func_start nested-generic-types-mix ReDoS regression (Closes #3321) - #5363

Merged
squid-protocol merged 1 commit into
mainfrom
churn/3321-20261017T1733Z
Oct 17, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
churn/3321-20261017T1733Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3321

What

Test-only. test_csharp_func_start_nested_generic_types_mix_redos_3321 pins the shapes of runtime's NestedGenericTypesMix.cs: alternating MyStructN<int>.MyClassN+1<int>. chains (60/260/500 levels on one line, 40 short lines of 30 levels) and deep non-chained A<B<C<...>>> nesting. Each is ReDoS-immune within 1 s and still finds a real method.

Why no engine change (the issue is stale)

Measured on the real file (fetched from dotnet/runtime main, 34,110 bytes, 1,022 lines): func_start.finditer over the whole file takes 0.01 s; no line is slow. #3320's fix (each < has one owner in the return-type token) is the mechanism the issue suspected. A 3-shape chain sweep over every language's func_start found nothing over 0.2 s.

Class table

Member Status
csharp dotted generic chain covered (#3320 + this test)
csharp deep nesting covered here
other languages' func_start, same chain shapes no slowdown found (no test added)

No regex change, so no golden re-bless. pr_gates --fast: 6/6 pass.

Cross-repo

None.

🤖 Generated with Claude Code

…rt of #3321)

#3321's hang (runtime NestedGenericTypesMix.cs) no longer reproduces: the whole 34 KB
file scans in 0.01 s since #3320's one-owner-per-`<` fix. Pin the shapes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 17, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

No description provided.

@squid-protocol
squid-protocol marked this pull request as ready for review October 17, 2026 17:38
@squid-protocol
squid-protocol enabled auto-merge (squash) October 17, 2026 17:39
@squid-protocol
squid-protocol merged commit c9605d7 into main Oct 17, 2026
42 checks passed
@squid-protocol
squid-protocol deleted the churn/3321-20261017T1733Z branch October 17, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: csharp func_start hangs on deeply nested generic declarations (NestedGenericTypesMix.cs) — latent

1 participant