Harden dumpDebugLoc against malformed .debug_loc sections
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start in dumpDebugLoc in third_party/llvm-project/dwarf2yaml.cpp, where the exit(1) on a null list sits, and read parseOneLocationList to see how entry.Loc is sized before the copy. Check how the address size is taken from the first CU. Done means a malformed list prints a warning and skips the rest of the section instead of exiting, the entry.Loc length is bounded, and a debug-build assert covers the shared address size. The issue does not give the length limit, so that needs a maintainer decision.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Background:
#6879 was a SIGSEGV in dumpDebugLoc for modules with empty .debug_loc
sections. Fixed by #7910 with a null-CU guard. While reviewing that fix,
three defensive improvements to the same function became apparent. None
is a regression, but each turns a malformed-input case into a hard
failure when it could fail gracefully.
Location: third_party/llvm-project/dwarf2yaml.cpp, dumpDebugLoc.
-
exit(1)on parse failure.if (!list) { errs() << "debug_loc error\n"; exit(1); }A single malformed location list aborts the entire
wasm-optrun. A
warning plus break (skip the rest of the section) would let the tool
finish processing the module with incomplete debug info, which is
the behavior for every other diagnostic in wasm-opt. -
Unbounded copy of location expression bytes.
entry.Locis read from the section byparseOneLocationList. There is
no upper bound on its length before the copy intoloc.Location. A
malformed length field causes unbounded allocation. -
Address-size heuristic.
The comment "should be ok since they all have the same address size?"
is a heuristic. All CUs in well-formed modules share the same
AddrSize, so reading it from the first CU is safe in practice, but
the assumption is not enforced.
Proposed changes:
- Replace
exit(1)with a warning and break. - Add a length sanity check before copying
entry.Loc. - Promote the
address-sizecomment from a question to an explicit
assumption with a debug-build assert.
Refs #6879, #7910.
- Lenguaje dominante
- WebAssembly
- Estrellas
- 8.7k
- Forks
- 895
- Merge medio
- 1 d 21 h
- PR fusionados (30 d)
- 95
Preparar el entorno
- 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 WebAssembly/binaryen
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
WebAssembly/binaryen#9135 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 76/100
WebAssembly/binaryen#9018 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
OptimizeInstructions: `--tnh` makes `ref.cast` non-nullable before a possibly infinite loopPosiblemente ocupada @tamaroning la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
WebAssembly/binaryen#9246 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Memory64Lowering: table.get/table.set keep i64 index on lowered table64, output fails validationAbierto
Dificultad 3/5 Medio día Aptitud para principiantes 66/100
WebAssembly/binaryen#9245 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
WebAssembly/binaryen#9244 ·
Los mantenedores suelen responder en 1 día
Todos los issues de WebAssembly/binaryen
Issues similares
-
bug format I/O medium priority rt_lib
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Invalid model / false unsat: to_fp of real * 2^int with a symbolic rounding mode treats RTN as RTZAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
KhronosGroup/SPIRV-LLVM-Translator#4082 ·
Los mantenedores suelen responder en 2 días
-
bug diagnostics
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
vx-lang/Vx#1718 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
bradcypert/plum#227 ·
Los mantenedores suelen responder en 1 día