Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions projects/opentelemetry-go-contrib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
# limitations under the License.
#
################################################################################
REPO=$PWD

pushd otelconf/v0.3.0
compile_native_go_fuzzer_v2 $(go list) FuzzJSON FuzzJSON
compile_native_go_fuzzer_v2 $(go list) FuzzYAML FuzzYAML
popd
cd $REPO/otelconf/v0.3.0
compile_native_go_fuzzer_v2 $(go list) FuzzJSON otelconf_v0.3.0_FuzzJSON
compile_native_go_fuzzer_v2 $(go list) FuzzYAML otelconf_v0.3.0_FuzzYAML
compile_native_go_fuzzer_v2 $(go list) FuzzYAMLWithEnvVars otelconf_v0.3.0_FuzzYAMLWithEnvVars
17 changes: 14 additions & 3 deletions projects/opentelemetry-go/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
#
################################################################################

pushd sdk/metric/internal/aggregate
compile_native_go_fuzzer_v2 $(go list) FuzzGetBin FuzzGetBin
popd
REPO=$PWD

cd $REPO/attribute
# Mitigate the error: found packages attribute_test and attribute in /src/opentelemetry-go/attribute.
# Remove all Go files with *_test package before building the fuzzer.
grep -rl --include="*.go" '^package .*_test' . | xargs rm -f
Comment on lines +21 to +24
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this I got (from https://github.com/google/oss-fuzz/actions/runs/19094642663/job/54551813623):

Running go  [build -buildmode c-archive -tags gofuzz_libfuzzer,libfuzzer,gofuzz -trimpath -gcflags all=-d=libfuzzer -gcflags syscall=-d=libfuzzer=0 -gcflags runtime/cgo=-d=libfuzzer=0 -gcflags runtime/pprof=-d=libfuzzer=0 -overlay /tmp/gofuzzbuild1941669612/ossFuzzOverlayFile.json1224461702 -o sdk_attribute_FuzzHashKVs.a ./main.346016195.go]
main.346016195.go:12:2: found packages attribute_test (benchmark_libFuzzer.go) and attribute (doc.go) in /src/opentelemetry-go/attribute
panic: exit status 1

goroutine 1 [running]:
main.main()
	/tmp/go-118-fuzz-build/main.go:196 +0x140e
ERROR:__main__:Building fuzzers failed.

Copy link
Copy Markdown
Contributor Author

@pellared pellared Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already an issue that is related to this problem:

CC @AdamKorcz

compile_native_go_fuzzer_v2 $(go list) FuzzHashKVs sdk_attribute_FuzzHashKVs

cd $REPO/sdk/metric/internal/aggregate
compile_native_go_fuzzer_v2 $(go list) FuzzGetBin sdk_metric_internal_aggregate_FuzzGetBin

cd $REPO/trace
compile_native_go_fuzzer_v2 $(go list) FuzzTraceIDFromHex trace_FuzzTraceIDFromHex
compile_native_go_fuzzer_v2 $(go list) FuzzSpanIDFromHex trace_FuzzSpanIDFromHex