Bound subprocess output capture to prevent ByteArrayOutputStream OOM
維護者通常 1 天內回覆
已經有一個關聯 PR 被合併了。
- #1727 來自 @fglock —— 已合併
評估
研究方向
Start in PerlOnJavaProcess.copyOutput (around line 165 of PerlOnJavaProcess.java), where the stderr reader writes into a ByteArrayOutputStream without a size limit. Decide between a bounded buffer and streaming to a file, then check that a reader failure reaches the parent process. Done means a run that emits sustained output no longer hits OutOfMemoryError and a reader failure is reported instead of stalling silently.
由索引模型根據 Issue 內容生成。
描述
Summary
PerlOnJavaProcess.copyOutput accumulates subprocess output in a ByteArrayOutputStream without a bounded capture size. A CPAN test that emits sustained warnings can grow the buffer to the JVM array-size limit and throw OutOfMemoryError in the output-copy thread.
Evidence
During CPAN release acceptance run 20261009-194921-60036, Mojolicious 9.49 emitted repeated warnings while running its tests. The captured target log reached 2,147,500,150 bytes. The stderr-copy thread then failed with:
java.lang.OutOfMemoryError: Required array length 2147483639 + 3846 is too large
at java.io.ByteArrayOutputStream.ensureCapacity
at java.io.ByteArrayOutputStream.write
at org.perlonjava.runtime.perlmodule.PerlOnJavaProcess.copyOutput(PerlOnJavaProcess.java:165)
After this, the target produced no output and was reported as a timeout after 2,400 seconds (1,606 seconds without output). The affected output contained repeated Use of uninitialized value in hash element warnings from Mojolicious DOM code, alongside File::stat experimental @_ warnings. The warning causes have their own tracking; this report concerns the process-output capture exhausting memory and losing its stderr reader.
Expected behavior
Large subprocess output should not grow a single in-memory buffer until it reaches the JVM array limit. Output capture should remain bounded or stream to a file, and an output-reader failure should be surfaced to the parent process instead of leaving the test apparently stalled.
- 主要語言
- Perl
- 星號
- 65
- 分支
- 8
- 平均合併
- 5 小時 54 分鐘
- 30 天內合併 PR
- 184
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
fglock/PerlOnJava 的其他 Issue
-
area:runtime documentation enhancement
難度 2/5 1-3 小時 新手友好度 72/100
fglock/PerlOnJava#1579 ·
維護者通常 1 天內回覆
-
area:backend bug
難度 4/5 3-5 天 新手友好度 55/100
fglock/PerlOnJava#1981 · 1 則留言 ·
維護者通常 1 天內回覆
-
area:runtime bug
難度 4/5 3-5 天 新手友好度 57/100
fglock/PerlOnJava#1980 · 1 則留言 ·
維護者通常 1 天內回覆
-
area:parser bug
難度 4/5 3-5 天 新手友好度 48/100
fglock/PerlOnJava#1979 · 1 則留言 ·
維護者通常 1 天內回覆
-
perf: continue eval STRING optimization work (follow-up to #1940)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 4/5 3-5 天 新手友好度 52/100
fglock/PerlOnJava#1961 · 1 則留言 ·
維護者通常 1 天內回覆
查看 fglock/PerlOnJava 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
-
ai-driven-fuzzing bug claude Minor
難度 2/5 1-3 小時 新手友好度 72/100
linagora/lemonldap-ng-plugins#170 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
libwww-perl/HTTP-Message#236 ·
-
1.severity: security
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
wave-followup
難度 2/5 1-3 小時 新手友好度 74/100