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

Đang mở
#2,822 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
docker, go
Lĩnh vực
build-system, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Go
Star
11.5k
Fork
510
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
71

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của php/frankenphp

Tất cả issue của php/frankenphp

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.