paste: serial mode exhausts file descriptors by opening every input simultaneously
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Empieza en src/uu/paste/src/paste.rs, especialmente en el bucle que abre las entradas en las líneas 101–115 y en la rama de procesamiento en serie. Reproduce el fallo por el límite de descriptores con el comando de Bash del issue y comprueba después que el modo en serie procesa las entradas individualmente. Se considera terminado cuando el reproductor funciona con la salida y el estado esperados; el issue informa de que pasan las 27 pruebas de integración existentes de paste.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
With paste -s, uutils opens every input file before processing any of them. This makes serial mode fail with "Too many open files" on batches that GNU paste processes successfully one file at a time.
Reproduced on Linux x86_64 at commit c1f172886c6643f61ffde5a1ce3db0aaf14e182b, in both debug and release builds. Compared with GNU coreutils 9.7 and the project-recommended GNU 9.12 reference package (Ubuntu 9.12-0ubuntu1~ppa1).
Reproducer
Run in Bash from the repository root:
cargo build --no-default-features --features paste
d=$(mktemp -d)
for i in {1..40}; do
printf 'a\nb\n' > "$d/f$i"
done
(ulimit -n 32; LC_ALL=C target/debug/coreutils paste -s "$d"/f*)
echo "status: $?"
Actual: no stdout, status 1, and:
paste: Too many open files
Expected: 40 lines containing a<TAB>b, status 0. Replacing target/debug/coreutils paste with GNU paste gives that result under the same limit.
The limit change applies only to the subshell. The reproducer leaves its temporary input directory in place.
Validation and cause
The failure also occurs with 1,032 files under a 1,024-descriptor limit, with --serial, custom delimiters, and -z. Small batches succeed. Both GNU versions passed all 12 tested combinations; each uutils build failed the six combinations exceeding the descriptor limit. All 27 existing paste integration tests pass.
The input-opening loop in paste.rs, lines 101-115 retains every file handle before reaching the serial branch. Serial mode should open, process, and close each file individually.
Related reports
Searches of open/closed issues, PRs, and comments for paste plus "too many open", "file descriptors", "RLIMIT_NOFILE", "EMFILE", and "opens all" found no matching report. #15254 and #15642 concern missing-file errors; this reproducer uses only existing, readable files.
Investigation and report prepared with AI assistance.
- Lenguaje dominante
- Rust
- Estrellas
- 24.3k
- Forks
- 2.1k
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 347
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de uutils/coreutils
-
fmt: stops at an unreadable file operand and says only 'read error' for a directoryPosiblemente ocupada @emirmrkaljevic la tomó hoy. AbiertoU - fmt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
shuf: exhausted random source destroys the input during an in-place shufflePosiblemente ocupada @limadog9 la tomó hoy. AbiertoU - shuf
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
unexpand: final newline prevents conversion of leading Unicode blanksPosiblemente ocupada @Ybucaille la tomó hoy. AbiertoU - unexpand
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
chmod -v: missing 'could not be accessed' line for operands that can't be stat'edPosiblemente ocupada @emirmrkaljevic la tomó hace 1 día. AbiertoU - chmod
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
chown, chgrp: 'cannot dereference' instead of 'cannot access' for a missing operandPosiblemente ocupada @emirmrkaljevic la tomó hace 1 día. AbiertoU - chgrp U - chown
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
Todos los issues de uutils/coreutils
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dsx-ai-factory/infra-controller#8341 ·
Los mantenedores suelen responder en 1 día
-
enhancement triage:deciding
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
open-telemetry/otel-arrow#4540 ·
Los mantenedores suelen responder en 2 días
-
benchmark: CSV report files contain blank records on WindowsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertocomponent:benchmark
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
agentic-os-org/ANOLISA#9177 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día