freestanding_check: hosted-RNG check misses rand/srand in headers, macro aliases and function pointers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- build-system, tooling
Línea de trabajo
Start in tools/freestanding_check.sh, where the hosted-RNG stage greps src/.c and extensions/.c for rand( and srand(), and read tools/freestanding_allowlist.txt to see why stage 1 passes. The proposed fix replaces the textual check with an nm -u scan of the hosted objects built by the gate's rows, so the design needs deciding first. Done when the four planted cases (static inline in a header, macro alias, function pointer, untracked file) make make freestanding-check exit nonzero, and src/freestanding/ stays green.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The hosted-RNG half of tools/freestanding_check.sh (#1818; fail-closed fix in the PR for #2308) searches only tracked src/*.c and extensions/*.c, outside src/freestanding/, for the literal spelling rand( / srand(. The following reach libc rand/srand from hosted runtime code without being seen:
- A call inside a
static inlinefunction, or a macro body, in a header (src/*.h,extensions/*.h). - A call through a macro alias, e.g.
#define RNG randand thenRNG(), or through a function pointer (int (*r)(void) = rand;). - Untracked files.
git grepsearches the index, so a new file that has not beengit added is skipped in a local run. CI only sees committed files, so this matters only locally.
Stage 1 cannot catch any of these, because rand/srand are in tools/freestanding_allowlist.txt.
Possible root fix: check the symbol level instead of the spelling. Every hosted object built by the gate's rows would have no undefined reference to rand/srand (nm -u over the objects that are not freestanding), so headers, macros and pointers are all covered. The textual grep could stay as a fast first pass.
Found while reviewing the hq#58 fix (https://github.com/InauguralSystems/hq/issues/58).
Done when
- A planted
static inline int r(void) { return rand(); }in a header that a runtime.cfile includes and calls makesmake freestanding-checkexit nonzero. - A planted
#define RNG randplusRNG()insrc/*.cmakes it exit nonzero. - A planted
int (*p)(void) = rand;insrc/*.cmakes it exit nonzero. -
src/freestanding/keeps its ownrandimplementation, and that case is still green.
Generated by Claude Code
- Lenguaje dominante
- C
- Estrellas
- 3
- Forks
- 7
- Merge medio
- 6 h 32 min
- PR fusionados (30 d)
- 285
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una 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 InauguralSystems/EigenScript
-
good first issue needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
InauguralSystems/EigenScript#2347 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
InauguralSystems/EigenScript#2335 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:embed kind:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
InauguralSystems/EigenScript#2311 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:gates kind:gate-defect
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
InauguralSystems/EigenScript#2305 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area:ci bug found-by:duet-audit
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
InauguralSystems/EigenScript#2283 ·
Los mantenedores suelen responder en 1 día
Todos los issues de InauguralSystems/EigenScript
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FujiNetWIFI/fujinet-config#379 ·
Los mantenedores suelen responder en 1 día
-
Ship /Local/Applications, the Local domain's Applications folderPosiblemente ocupada @pkgdemon la tomó hoy. Abiertoarea:base enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
nextbsd/nextbsd-userland#612 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zephyrproject-rtos/zephyr#125543 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
colbymchenry/codegraph#3277 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100