purego: add a fuzz test for callback round trips - #531
Open
kumagi wants to merge 4 commits into
Open
Conversation
Decode fuzzer bytes into callback signatures via a sequential opcode stream, compile a C forwarder once per content hash, and compare arguments and returns byte-for-byte through the real C ABI. Seeds run on every plain go test; new shapes are explored under go test -fuzz.
Match callback_test.go: callbacks only exist on darwin and Linux (plus 386-nocallback nuances handled at run time), so freebsd/netbsd and windows must not compile this file. Fixes undefined purego.Dlopen on Windows.
Same shared-/tmp hazard as the struct fuzz cache: CI minor-arches runs several QEMU targets in sequence on one runner.
CI arm runs hard-float and soft-float back to back on one runner sharing /tmp with different CCs under the same GOARCH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What issue is this addressing?
#528
What type of issue is this addressing?
feature
What this PR does | solves
Decode fuzzer bytes into callback signatures via a sequential opcode stream, compile a C forwarder once per content hash, and compare arguments and returns byte-for-byte through the real C ABI. Seeds run on every plain go test; new shapes are explored under go test -fuzz.