Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing runc-dmz failure for runc #458

Merged
merged 1 commit into from
Oct 13, 2023
Merged

Fix missing runc-dmz failure for runc #458

merged 1 commit into from
Oct 13, 2023

Conversation

fish98
Copy link
Contributor

@fish98 fish98 commented Oct 12, 2023

The following error would occur when building fuzz driver FuzzStateApi for runc after migrating go version to 1.21.0, which would lead to building failure.

Running go-fuzz -tags gofuzz -func FuzzStateApi -o state_api_fuzzer.a github.com/opencontainers/runc/libcontainer
libcontainer/dmz/dmz_linux.go:21:12: pattern runc-dmz: no matching files found
failed to build packages:exit status 1
ERROR:__main__:Building fuzzers failed.

AFAIU, the reason is runc requires runc-dmz binary available for building in libcontainer/dmz/dmz_linux.go, while go build process would ignore go:generate when the target file is not directly used.

Although it would not be the best approach to fix the error, the error is fixed by manually running the compiling for runc-dmz before building the fuzz driver.

PS. Compile with default ossfuzz CFLAGS would trigger ASAN and DWARF errors, leading to compile failure.

Signed-off-by: TTFISH <jiongchiyu@gmail.com>
@cyphar
Copy link

cyphar commented Oct 13, 2023

If you compile runc with runc_nodmz, the build error will go away (but of course, it means you couldn't fuzz runc-dmz -- though I think none of our fuzzers touch any of the code that would use runc-dmz).

@fish98
Copy link
Contributor Author

fish98 commented Oct 13, 2023

If you compile runc with runc_nodmz, the build error will go away (but of course, it means you couldn't fuzz runc-dmz -- though I think none of our fuzzers touch any of the code that would use runc-dmz).

Many thanks for your response. I do believe that we do not have the need for fuzzing runc-dmz. However, based on the building process of oss-fuzz and my experimental results, it appears that adding the "compile runc with runc_nodmz" option does not help with a successful compilation of the FuzzStateApi fuzzer. I used the following building command with environment setting:

python infra/helper.py shell runc # outside
export BUILDTAGS="runc_nodmz" # one at a time
export RUNC_DMZ=legacy
compile

I have not yet found a better solution to address this building failure. Please do advise if I misunderstood your suggestion. Thank you 😺

@AdamKorcz AdamKorcz merged commit e3d01f1 into cncf:main Oct 13, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants