Repository navigation
Commit 7a607a7
committed
fix(extractor): PipeReader/PipeWriter are not IDisposable — stop flagging them as leaks (mined FP)
Mining Pipelines.Sockets.Unofficial surfaced a systematic false positive: the
field-disposable name heuristic in IsDisposableType matches anything ending in
"Reader"/"Writer", so `System.IO.Pipelines` PipeReader/PipeWriter fields
(SocketConnection._input/_output, assigned `new WrappedReader/WrappedWriter`) were
reported as undisposed-IDisposable leaks (OWN001). But PipeReader/PipeWriter are
NOT IDisposable — they finish via Complete(), not Dispose() — so this is a false
alarm, and it would fire on essentially any code using System.IO.Pipelines.
New IsNonDisposableReaderWriter excludes PipeReader/PipeWriter (matched on the
simple name, so a qualified `System.IO.Pipelines.PipeReader` is covered too) from
the EndsWith("Reader"/"Writer") heuristic. The curated IDisposable names and the
…Stream/…Subscription families are unchanged; no existing corpus/sample uses these
types, so behaviour elsewhere is unaffected.
Regression guard: frontend/roslyn/samples/PipeFieldsSample.cs (a class that
constructs PipeReader/PipeWriter fields and never disposes them) is added to the
wpf-extractor CI job, which asserts it produces NO finding.
Found by `scripts/mine.sh` over a real repo; not reproducible without a .NET SDK
locally, so validated by CI + a re-mine.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED1 parent 70376da commit 7a607a7
3 files changed
Lines changed: 67 additions & 2 deletions
File tree
- .github/workflows
- frontend/roslyn
- OwnSharp.Extractor
- samples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
157 | 165 | | |
158 | 166 | | |
159 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1412 | 1412 | | |
1413 | 1413 | | |
1414 | 1414 | | |
1415 | | - | |
1416 | | - | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
1417 | 1427 | | |
1418 | 1428 | | |
1419 | 1429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments