Bound subprocess output capture to prevent ByteArrayOutputStream OOM
Maintainer antworten meist innerhalb von 1 Tag
Ein zugehöriger Pull Request wurde bereits gemerged.
- #1727 von @fglock — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Perl
- Sterne
- 64
- Forks
- 8
- Ø Merge
- 5 Std. 28 Min.
- Gemergte PRs (30 T.)
- 199
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus fglock/PerlOnJava
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
fglock/PerlOnJava#1579 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:runtime bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
fglock/PerlOnJava#1859 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
fglock/PerlOnJava#1854 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 56/100
fglock/PerlOnJava#1851 ·
Maintainer antworten meist innerhalb von 1 Tag
-
perf: close method-call throughput gap to blead PerlEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenarea:performance enhancement
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
fglock/PerlOnJava#1846 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in fglock/PerlOnJava
Ähnliche Issues
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
LMS-Community/slimserver#1692 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLsEvtl. vergeben @muntasir-396 hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
openfoodfacts/openfoodfacts-server#15042 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag