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

Offen
#2,822 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
docker, go

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
Go
Sterne
11.5k
Forks
510
Ø Merge
1 T. 7 Std.
Gemergte PRs (30 T.)
71

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus php/frankenphp

Alle Issues in php/frankenphp

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.