Bound subprocess output capture to prevent ByteArrayOutputStream OOM
Mantenedores costumam responder em até 1 dia
Um pull request relacionado já foi integrado.
- #1727 de @fglock — integrado
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 48/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Perl
- Estrelas
- 65
- Forks
- 8
- Merge médio
- 5h 52min
- PRs com merge (30d)
- 194
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fglock/PerlOnJava
-
area:runtime documentation enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
fglock/PerlOnJava#1579 ·
Mantenedores costumam responder em até 1 dia
-
area:cpan-port enhancement help wanted
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
fglock/PerlOnJava#1880 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
perf: achieve measured 1:1 standard Perl throughput after #1850Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea:performance enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
fglock/PerlOnJava#1863 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:memory area:performance area:runtime bug
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 52/100
fglock/PerlOnJava#1860 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
area:performance enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
fglock/PerlOnJava#1846 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fglock/PerlOnJava
Issues semelhantes
-
✏️ Editing - Tags
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
openfoodfacts/openfoodfacts-server#15127 ·
Mantenedores costumam responder em até 1 dia
-
FIDO2 (ecdsa-sk / ed25519-sk) ingress keys rejected: missing in get_supported_ssh_algorithms_listAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
ovh/the-bastion#695 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
observablt-ci
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
elastic/golang-crossbuild#840 ·
Mantenedores costumam responder em até 1 dia
-
Sync playback crashes repeatedly in a sync group (v9.1.1)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
LMS-Community/slimserver#1701 · 6 comentários ·
Mantenedores costumam responder em até 1 dia