OSS-Fuzz fuzz build fails in cgi_test.go and frankenphp.go

Aperta
#2,822 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, go

Direzione di ricerca

Start with cgi_test.go and frankenphp.go, then reproduce the failure using the OSS-Fuzz build_image and build_fuzzers commands in the issue. Remove the benchmark function from cgi_test.go and add the missing os import to frankenphp.go; confirm the fuzz targets compile with the fuzzing build and check_build.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
What happened?

The FrankenPHP OSS-Fuzz fuzz build fails while compiling the Go fuzz targets. The failure occurs in the fuzzing build, before the fuzzers can be produced. The reported errors include missing references to testing.B in the generated cgi_test.go_fuzz.go file and to os in frankenphp.go. The affected code contains a benchmark function in cgi_test.go:

func BenchmarkSplitRawHeader(b *testing.B) {
    ...
}

This benchmark is not required by the fuzz targets but is included in the fuzzing build transformation. The fuzz build does not provide the benchmark testing context required by this function.

The failure also indicates that frankenphp.go uses the os package without the corresponding import.

The issue can be reproduced with the OSS-Fuzz build command:

python infra/helper.py build_image frankenphp
python infra/helper.py build_fuzzers \
  --sanitizer address \
  --engine libfuzzer \
  --architecture x86_64 \
  frankenphp

Expected behavior: the FrankenPHP fuzz targets should compile successfully.

The fix removes the benchmark function from cgi_test.go and adds the missing os import to frankenphp.go. The patch was successfully verified with the OSS-Fuzz fuzzing build and check_build.

Image
Build Type

Docker (Debian Trixie)

Worker Mode

No

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration
phpinfo() output
Not applicable. The failure occurs during the OSS-Fuzz fuzz-target build before a FrankenPHP runtime instance is started, so no phpinfo() output is available.
Relevant log output
Relevant log output
The fuzz build reported missing references to testing.B in cgi_test.go_fuzz.go and os in frankenphp.go. The build then failed during fuzz-target compilation.
Lingua principale
Go
Stelle
11.5k
Fork
510
Merge medio
1g 7h
PR unite (30g)
71

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di php/frankenphp

Tutte le issue di php/frankenphp

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.