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

Rust: cargo fuzz command not found (missing in docker image?) #12168

Closed
Mingun opened this issue Jul 7, 2024 · 13 comments · Fixed by #12178
Closed

Rust: cargo fuzz command not found (missing in docker image?) #12168

Mingun opened this issue Jul 7, 2024 · 13 comments · Fixed by #12178

Comments

@Mingun
Copy link

Mingun commented Jul 7, 2024

Hi! I'm maintainer of quick-xml. Recently I noticed, that build fuzzers for project is unsuccessful, last logs is here:

The reason is that cargo fuzz command was not found (in docker image?).

The end of GitHub Action run (too long for issue to post full log)
2024-07-07T14:24:06.4958329Z Current runner version: '2.317.0'
2024-07-07T14:24:06.4980683Z ##[group]Operating System
2024-07-07T14:24:06.4981417Z Ubuntu
2024-07-07T14:24:06.4981750Z 22.04.4
2024-07-07T14:24:06.4982048Z LTS
2024-07-07T14:24:06.4982452Z ##[endgroup]
2024-07-07T14:24:06.4982868Z ##[group]Runner Image
2024-07-07T14:24:06.4983268Z Image: ubuntu-22.04
2024-07-07T14:24:06.4983729Z Version: 20240630.1.0
2024-07-07T14:24:06.4984737Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20240630.1/images/ubuntu/Ubuntu2204-Readme.md
2024-07-07T14:24:06.4986180Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20240630.1
2024-07-07T14:24:06.4987101Z ##[endgroup]
2024-07-07T14:24:06.4987507Z ##[group]Runner Image Provisioner
2024-07-07T14:24:06.4987943Z 2.0.370.1
2024-07-07T14:24:06.4988335Z ##[endgroup]
2024-07-07T14:24:06.4990540Z ##[group]GITHUB_TOKEN Permissions
2024-07-07T14:24:06.4992121Z Actions: read
2024-07-07T14:24:06.4992839Z Attestations: read
2024-07-07T14:24:06.4993366Z Checks: read
2024-07-07T14:24:06.4993746Z Contents: read
2024-07-07T14:24:06.4994077Z Deployments: read
2024-07-07T14:24:06.4994560Z Discussions: read
2024-07-07T14:24:06.4994944Z Issues: read
2024-07-07T14:24:06.4995266Z Metadata: read
2024-07-07T14:24:06.4995707Z Packages: read
2024-07-07T14:24:06.4996393Z Pages: read
2024-07-07T14:24:06.4996745Z PullRequests: read
2024-07-07T14:24:06.4997395Z RepositoryProjects: read
2024-07-07T14:24:06.4997844Z SecurityEvents: read
2024-07-07T14:24:06.4998206Z Statuses: read
2024-07-07T14:24:06.4998661Z ##[endgroup]
2024-07-07T14:24:06.5001641Z Secret source: None
2024-07-07T14:24:06.5002163Z Prepare workflow directory
2024-07-07T14:24:06.5614228Z Prepare all required actions
2024-07-07T14:24:06.5772864Z Getting action download info
2024-07-07T14:24:06.7905194Z Download action repository 'google/oss-fuzz@master' (SHA:e4951edd3d3251626f859590c3c5802eb422d933)
2024-07-07T14:24:08.9753726Z Download action repository 'actions/upload-artifact@v3' (SHA:a8a3f3ad30e3422c9c7b888a15615d19a852ae32)
2024-07-07T14:24:09.1968418Z Complete job name: Fuzzing
2024-07-07T14:24:09.2581130Z ##[group]Build container for action use: '/home/runner/work/_actions/google/oss-fuzz/master/infra/cifuzz/actions/build_fuzzers/../../../build_fuzzers.Dockerfile'.
2024-07-07T14:24:09.2635084Z ##[command]/usr/bin/docker build -t bfa14a:d57b951fc17449cb8e6131983b7a778b -f "/home/runner/work/_actions/google/oss-fuzz/master/infra/cifuzz/actions/build_fuzzers/../../../build_fuzzers.Dockerfile" "/home/runner/work/_actions/google/oss-fuzz/master/infra"
2024-07-07T14:24:12.9113604Z #0 building with "default" instance using docker driver
2024-07-07T14:24:12.9114344Z 
2024-07-07T14:24:12.9114745Z #1 [internal] load build definition from build_fuzzers.Dockerfile
2024-07-07T14:24:12.9115478Z #1 transferring dockerfile: 1.26kB 0.0s done
2024-07-07T14:24:12.9117534Z #1 DONE 0.0s
2024-07-07T14:24:12.9117820Z 
2024-07-07T14:24:12.9118248Z #2 [internal] load metadata for gcr.io/oss-fuzz-base/cifuzz-base:latest
2024-07-07T14:24:13.5758399Z #2 DONE 0.8s
2024-07-07T14:24:13.7092660Z 
2024-07-07T14:24:13.7093382Z #3 [internal] load .dockerignore
2024-07-07T14:24:13.7094074Z #3 transferring context: 125B done
2024-07-07T14:24:13.7094660Z #3 DONE 0.0s
2024-07-07T14:24:13.7095016Z 
2024-07-07T14:24:13.7095205Z #4 [internal] load build context
2024-07-07T14:24:13.7095788Z #4 transferring context: 937.93kB 0.0s done
2024-07-07T14:24:13.7097180Z #4 DONE 0.0s
2024-07-07T14:24:13.7097457Z 
2024-07-07T14:24:13.7099299Z #5 [1/4] FROM gcr.io/oss-fuzz-base/cifuzz-base:latest@sha256:961e96ba49f9ca1150c1ef54eec4e90509590aae83ee73f980683cb3f8a2a85a
...
2024-07-07T14:24:41.5428494Z #5 DONE 27.9s
2024-07-07T14:24:41.7670341Z 
2024-07-07T14:24:41.7671132Z #6 [2/4] WORKDIR /opt/oss-fuzz/infra
2024-07-07T14:24:41.7671712Z #6 DONE 0.0s
2024-07-07T14:24:41.7671967Z 
2024-07-07T14:24:41.7672101Z #7 [3/4] ADD . /opt/oss-fuzz/infra
2024-07-07T14:24:41.7672721Z #7 DONE 0.1s
2024-07-07T14:24:41.7672896Z 
2024-07-07T14:24:41.7673209Z #8 [4/4] RUN python3 -m pip install -r /opt/oss-fuzz/infra/cifuzz/requirements.txt
...
2024-07-07T14:24:43.0433877Z #8 DONE 1.3s
2024-07-07T14:24:43.0434120Z 
2024-07-07T14:24:43.0434279Z #9 exporting to image
2024-07-07T14:24:43.0434712Z #9 exporting layers
2024-07-07T14:24:47.0941959Z #9 exporting layers 4.2s done
2024-07-07T14:24:47.1177391Z #9 writing image sha256:92fd999156dafea5ab6f1e886e8fe1be35c5834e853608a771ee319294925004 done
2024-07-07T14:24:47.1178517Z #9 naming to docker.io/library/bfa14a:d57b951fc17449cb8e6131983b7a778b done
2024-07-07T14:24:47.1179125Z #9 DONE 4.2s
2024-07-07T14:24:47.1229507Z ##[endgroup]
2024-07-07T14:24:47.1256513Z ##[group]Build container for action use: '/home/runner/work/_actions/google/oss-fuzz/master/infra/cifuzz/actions/run_fuzzers/../../../run_fuzzers.Dockerfile'.
2024-07-07T14:24:47.1258488Z ##[command]/usr/bin/docker build -t bfa14a:c88be9d0c2cc493589a95302b534a312 -f "/home/runner/work/_actions/google/oss-fuzz/master/infra/cifuzz/actions/run_fuzzers/../../../run_fuzzers.Dockerfile" "/home/runner/work/_actions/google/oss-fuzz/master/infra"
2024-07-07T14:24:47.4152952Z #0 building with "default" instance using docker driver
2024-07-07T14:24:47.4153725Z 
2024-07-07T14:24:47.4154181Z #1 [internal] load build definition from run_fuzzers.Dockerfile
2024-07-07T14:24:47.4155137Z #1 transferring dockerfile: 1.26kB done
2024-07-07T14:24:47.4155800Z #1 DONE 0.0s
2024-07-07T14:24:47.4156668Z 
2024-07-07T14:24:47.4157130Z #2 [internal] load metadata for gcr.io/oss-fuzz-base/cifuzz-base:latest
2024-07-07T14:24:47.5132767Z #2 DONE 0.2s
2024-07-07T14:24:47.5648083Z 
2024-07-07T14:24:47.5648716Z #3 [internal] load .dockerignore
2024-07-07T14:24:47.5649706Z #3 transferring context: 125B done
2024-07-07T14:24:47.5650859Z #3 DONE 0.0s
2024-07-07T14:24:47.5651253Z 
2024-07-07T14:24:47.5652156Z #4 [1/4] FROM gcr.io/oss-fuzz-base/cifuzz-base:latest@sha256:961e96ba49f9ca1150c1ef54eec4e90509590aae83ee73f980683cb3f8a2a85a
2024-07-07T14:24:47.5653382Z #4 DONE 0.0s
2024-07-07T14:24:47.5653617Z 
2024-07-07T14:24:47.5653789Z #5 [internal] load build context
2024-07-07T14:24:47.5654338Z #5 transferring context: 18.05kB 0.0s done
2024-07-07T14:24:47.5654894Z #5 DONE 0.0s
2024-07-07T14:24:47.5655124Z 
2024-07-07T14:24:47.5655305Z #6 [2/4] WORKDIR /opt/oss-fuzz/infra
2024-07-07T14:24:47.5655807Z #6 CACHED
2024-07-07T14:24:47.5656004Z 
2024-07-07T14:24:47.5656164Z #7 [3/4] ADD . /opt/oss-fuzz/infra
2024-07-07T14:24:47.5656649Z #7 CACHED
2024-07-07T14:24:47.5656842Z 
2024-07-07T14:24:47.5657346Z #8 [4/4] RUN python3 -m pip install -r /opt/oss-fuzz/infra/cifuzz/requirements.txt
2024-07-07T14:24:47.5658237Z #8 CACHED
2024-07-07T14:24:47.5658470Z 
2024-07-07T14:24:47.5658626Z #9 exporting to image
2024-07-07T14:24:47.5659097Z #9 exporting layers done
2024-07-07T14:24:47.5659996Z #9 writing image sha256:fc7d8957398254b1b082b8dd528af19caee9ba9541f9accc0b99649c6cfadeab done
2024-07-07T14:24:47.5661195Z #9 naming to docker.io/library/bfa14a:c88be9d0c2cc493589a95302b534a312 done
2024-07-07T14:24:47.5662044Z #9 DONE 0.0s
2024-07-07T14:24:47.5699519Z ##[endgroup]
2024-07-07T14:24:47.6055582Z ##[group]Run google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
2024-07-07T14:24:47.6056084Z with:
2024-07-07T14:24:47.6056337Z   oss-fuzz-project-name: quick-xml
2024-07-07T14:24:47.6056665Z   language: rust
2024-07-07T14:24:47.6056897Z   dry-run: false
2024-07-07T14:24:47.6057120Z   sanitizer: address
2024-07-07T14:24:47.6057363Z   architecture: x86_64
2024-07-07T14:24:47.6057615Z   bad-build-check: true
2024-07-07T14:24:47.6057909Z   keep-unaffected-fuzz-targets: false
2024-07-07T14:24:47.6058234Z   output-sarif: false
2024-07-07T14:24:47.6058481Z ##[endgroup]
2024-07-07T14:24:47.6354701Z ##[command]/usr/bin/docker run --name bfa14ad57b951fc17449cb8e6131983b7a778b_1bea93 --label bfa14a --workdir /github/workspace --rm -e "INPUT_OSS-FUZZ-PROJECT-NAME" -e "INPUT_LANGUAGE" -e "INPUT_DRY-RUN" -e "INPUT_ALLOWED-BROKEN-TARGETS-PERCENTAGE" -e "INPUT_SANITIZER" -e "INPUT_ARCHITECTURE" -e "INPUT_PROJECT-SRC-PATH" -e "INPUT_BAD-BUILD-CHECK" -e "INPUT_KEEP-UNAFFECTED-FUZZ-TARGETS" -e "INPUT_OUTPUT-SARIF" -e "OSS_FUZZ_PROJECT_NAME" -e "LANGUAGE" -e "DRY_RUN" -e "ALLOWED_BROKEN_TARGETS_PERCENTAGE" -e "SANITIZER" -e "ARCHITECTURE" -e "PROJECT_SRC_PATH" -e "LOW_DISK_SPACE" -e "BAD_BUILD_CHECK" -e "CIFUZZ_DEBUG" -e "CFL_PLATFORM" -e "KEEP_UNAFFECTED_FUZZ_TARGETS" -e "OUTPUT_SARIF" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/quick-xml/quick-xml":"/github/workspace" bfa14a:d57b951fc17449cb8e6131983b7a778b
2024-07-07T14:24:48.0086300Z 2024-07-07 14:24:48,004 - root - DEBUG - Is github: True.
2024-07-07T14:24:48.0086916Z 2024-07-07 14:24:48,005 - root - DEBUG - base_commit: None
2024-07-07T14:24:48.0087505Z 2024-07-07 14:24:48,005 - root - DEBUG - pr_ref: refs/pull/780/merge
2024-07-07T14:24:48.0088113Z 2024-07-07 14:24:48,005 - root - DEBUG - No PROJECT_SRC_PATH.
2024-07-07T14:24:48.0088899Z 2024-07-07 14:24:48,006 - root - INFO - ci_system: <continuous_integration.InternalGithub object at 0x7ffbf3486dc0>.
2024-07-07T14:24:48.0089909Z 2024-07-07 14:24:48,006 - root - INFO - ClusterFuzzDeployment: <clusterfuzz_deployment.OSSFuzz object at 0x7ffbf3486f10>.
2024-07-07T14:24:48.0090784Z 2024-07-07 14:24:48,006 - root - INFO - InternalGithub: preparing for fuzzer build.
2024-07-07T14:24:48.0091987Z 2024-07-07 14:24:48,006 - helper - INFO - Running: docker build -t gcr.io/oss-fuzz/quick-xml --file /opt/oss-fuzz/projects/quick-xml/Dockerfile /opt/oss-fuzz/projects/quick-xml.
2024-07-07T14:24:48.1829801Z #1 [internal] load build definition from Dockerfile
2024-07-07T14:24:48.1830756Z #1 sha256:d5c1e11ef3174134a768af0ac453a45cc5c25bbaed6056d2dd1b092b41c1301f
2024-07-07T14:24:48.1831601Z #1 transferring dockerfile: 836B done
2024-07-07T14:24:48.1832124Z #1 DONE 0.0s
2024-07-07T14:24:48.1832345Z 
2024-07-07T14:24:48.1833367Z #2 [internal] load metadata for gcr.io/oss-fuzz-base/base-builder-rust:latest
2024-07-07T14:24:48.1834077Z #2 sha256:5254f27cedd378833ff509b6b7a20838c8ff45e5ad477d115cb93fbb65d617fa
2024-07-07T14:24:48.7848123Z #2 DONE 0.6s
2024-07-07T14:24:48.7848447Z 
2024-07-07T14:24:48.7848642Z #3 [internal] load .dockerignore
2024-07-07T14:24:48.7849480Z #3 sha256:9e6eb4e54df631f69b175af18b99e657f71079b6848ee1813bca79d0763a4046
2024-07-07T14:24:48.7850022Z #3 transferring context: 2B done
2024-07-07T14:24:48.7850494Z #3 DONE 0.0s
2024-07-07T14:24:48.7850656Z 
2024-07-07T14:24:48.7850761Z #5 [internal] load build context
2024-07-07T14:24:48.7851356Z #5 sha256:d5c7cca306092010644d6f436df620e1fc0ddd16b76df0313bbfd2d447162504
2024-07-07T14:24:48.7851957Z #5 transferring context: 956B done
2024-07-07T14:24:48.7852362Z #5 DONE 0.0s
2024-07-07T14:24:48.7852544Z 
2024-07-07T14:24:48.7853486Z #8 [1/4] FROM gcr.io/oss-fuzz-base/base-builder-rust:latest@sha256:dff31ce14824b36b85ef69fa8726dde6c9df253f76de7185fce105c9783d1f73
...
2024-07-07T14:25:11.9777118Z #8 DONE 23.3s
2024-07-07T14:25:12.1282541Z 
2024-07-07T14:25:12.1283762Z #7 [2/4] RUN git clone --depth 1 https://github.com/tafia/quick-xml
2024-07-07T14:25:12.1284960Z #7 sha256:0786a503334d1c3ae437a596ea06adfc4d1ec38992de0b50f772d6b708ddf2d4
2024-07-07T14:25:12.2791897Z #7 0.172 Cloning into 'quick-xml'...
2024-07-07T14:25:12.8394636Z #7 DONE 0.8s
2024-07-07T14:25:12.8394976Z 
2024-07-07T14:25:12.8395143Z #6 [3/4] WORKDIR /src
2024-07-07T14:25:12.8396510Z #6 sha256:fa401ed30603223e421617a9f9b1ed099b688bce0be9b4a6a3f4c8a147e0805e
2024-07-07T14:25:12.8397362Z #6 DONE 0.0s
2024-07-07T14:25:12.8397594Z 
2024-07-07T14:25:12.8397760Z #4 [4/4] COPY build.sh /src/
2024-07-07T14:25:12.8398547Z #4 sha256:a5adf999e30eaa9faf6d6725ccb8061a69892f9c5a5c1cca44e92e7afa2b3dee
2024-07-07T14:25:12.8399334Z #4 DONE 0.0s
2024-07-07T14:25:12.9935860Z 
2024-07-07T14:25:12.9936452Z #9 exporting to image
2024-07-07T14:25:12.9937245Z #9 sha256:eb2651147723e9d3423694f42e282ea7f58d1db630d537777b57f87ca49cb0c5
2024-07-07T14:25:12.9938077Z #9 exporting layers
2024-07-07T14:25:14.6809887Z #9 exporting layers 1.8s done
2024-07-07T14:25:14.6810743Z #9 writing image sha256:2ebcbd72ba02ad818f8c895edc8299921808e0644cd5a2306fd0386a81ad79ad done
2024-07-07T14:25:14.6811690Z #9 naming to gcr.io/oss-fuzz/quick-xml:latest done
2024-07-07T14:25:14.6812067Z #9 DONE 1.8s
2024-07-07T14:25:15.1063311Z 2024-07-07 14:25:15,105 - root - INFO - Docker container: 364f1ce2b3ce.
2024-07-07T14:25:15.1066194Z 2024-07-07 14:25:15,105 - helper - INFO - Running: docker run --rm --privileged --shm-size=2g --platform linux/amd64 -e FUZZING_ENGINE=libfuzzer -e CIFUZZ=True -e SANITIZER=address -e ARCHITECTURE=x86_64 -e FUZZING_LANGUAGE=rust -e OUT=/github/workspace/build-out --volumes-from 364f1ce2b3ce gcr.io/oss-fuzz/quick-xml /bin/bash -c 'cp -r /src/quick-xml /github/workspace/storage/quick-xml'.
2024-07-07T14:25:16.7296202Z 2024-07-07 14:25:16,729 - root - DEBUG - Stderr of command "git fetch origin refs/pull/780/merge" is: From https://github.com/tafia/quick-xml
2024-07-07T14:25:16.7297722Z  * branch            refs/pull/780/merge -> FETCH_HEAD
2024-07-07T14:25:16.7298291Z .
2024-07-07T14:25:16.7588780Z 2024-07-07 14:25:16,758 - root - DEBUG - Stderr of command "git checkout -f FETCH_HEAD" is: Note: switching to 'FETCH_HEAD'.
2024-07-07T14:25:16.7589783Z 
2024-07-07T14:25:16.7590397Z You are in 'detached HEAD' state. You can look around, make experimental
2024-07-07T14:25:16.7591479Z changes and commit them, and you can discard any commits you make in this
2024-07-07T14:25:16.7592523Z state without impacting any branches by switching back to a branch.
2024-07-07T14:25:16.7593137Z 
2024-07-07T14:25:16.7593558Z If you want to create a new branch to retain commits you create, you may
2024-07-07T14:25:16.7594671Z do so (now or later) by using -c with the switch command. Example:
2024-07-07T14:25:16.7595243Z 
2024-07-07T14:25:16.7595491Z   git switch -c <new-branch-name>
2024-07-07T14:25:16.7595843Z 
2024-07-07T14:25:16.7596280Z Or undo this operation with:
2024-07-07T14:25:16.7596653Z 
2024-07-07T14:25:16.7596789Z   git switch -
2024-07-07T14:25:16.7597011Z 
2024-07-07T14:25:16.7597470Z Turn off this advice by setting config variable advice.detachedHead to false
2024-07-07T14:25:16.7598142Z 
2024-07-07T14:25:16.7598846Z HEAD is now at 8748cd6 Merge 6a48a28f4cc182112d9005f66f8ab4336ace3293 into 0960333aefea3772777c3cf4960d9cb4f5c43fce
2024-07-07T14:25:16.7599889Z .
2024-07-07T14:25:18.7344674Z 2024-07-07 14:25:18,733 - root - DEBUG - Stderr of command "git submodule update -f --init --recursive" is: Submodule 'encoding' (https://github.com/whatwg/encoding.git) registered for path 'test-gen/encoding'
2024-07-07T14:25:18.7346023Z Cloning into '/github/workspace/storage/quick-xml/test-gen/encoding'...
2024-07-07T14:25:18.7346538Z From https://github.com/whatwg/encoding
2024-07-07T14:25:18.7347089Z  * branch            4f549cd26fd5f6a8f8bd8fc3fede519515cdea4f -> FETCH_HEAD
2024-07-07T14:25:18.7347535Z .
2024-07-07T14:25:18.7347995Z 2024-07-07 14:25:18,734 - root - INFO - repo_dir: /github/workspace/storage/quick-xml.
2024-07-07T14:25:18.7405165Z 2024-07-07 14:25:18,739 - root - INFO - Docker container: 364f1ce2b3ce.
2024-07-07T14:25:18.7405884Z 2024-07-07 14:25:18,740 - root - INFO - Building with address sanitizer.
2024-07-07T14:25:18.7408447Z 2024-07-07 14:25:18,740 - helper - INFO - Running: docker run --rm --privileged --shm-size=2g --platform linux/amd64 -e FUZZING_ENGINE=libfuzzer -e CIFUZZ=True -e SANITIZER=address -e ARCHITECTURE=x86_64 -e FUZZING_LANGUAGE=rust -e OUT=/github/workspace/build-out --volumes-from 364f1ce2b3ce gcr.io/oss-fuzz/quick-xml /bin/bash -c 'cd / && rm -rf /src/quick-xml/* && cp -r /github/workspace/storage/quick-xml /src && cd - && compile'.
2024-07-07T14:25:19.0329548Z /src
2024-07-07T14:25:19.0343469Z ---------------------------------------------------------------
2024-07-07T14:25:19.0352434Z vm.mmap_rnd_bits = 28
2024-07-07T14:25:19.0415048Z Compiling libFuzzer to /usr/lib/libFuzzingEngine.a...  done.
2024-07-07T14:25:19.0521005Z ---------------------------------------------------------------
2024-07-07T14:25:19.0521646Z CC=clang
2024-07-07T14:25:19.0521987Z CXX=clang++
2024-07-07T14:25:19.0525402Z CFLAGS=-O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link
2024-07-07T14:25:19.0532380Z CXXFLAGS=-O1 -fno-omit-frame-pointer -gline-tables-only -Wno-error=enum-constexpr-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -Wno-error=deprecated-declarations -Wno-error=implicit-function-declaration -Wno-error=implicit-int -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link -stdlib=libc++
2024-07-07T14:25:19.0536272Z RUSTFLAGS=--cfg fuzzing -Zsanitizer=address -Cdebuginfo=1 -Cforce-frame-pointers
2024-07-07T14:25:19.0537323Z ---------------------------------------------------------------
2024-07-07T14:25:19.2377580Z + cd /src/quick-xml
2024-07-07T14:25:19.2378073Z + cargo fuzz build -O
2024-07-07T14:25:19.2754458Z error: no such command: `fuzz`
2024-07-07T14:25:19.2755002Z 
2024-07-07T14:25:19.2755218Z 	Did you mean `fix`?
2024-07-07T14:25:19.2755560Z 
2024-07-07T14:25:19.2756444Z 	View all installed commands with `cargo --list`
2024-07-07T14:25:19.2757603Z 	Find a package to install `fuzz` with `cargo search cargo-fuzz`
2024-07-07T14:25:19.5833654Z 2024-07-07 14:25:19,582 - root - ERROR - Building fuzzers failed.
2024-07-07T14:25:19.5835389Z 2024-07-07 14:25:19,582 - root - ERROR - Error building fuzzers for (commit: 8748cd6c43e6a78d035ec54524be03d23caa06de, pr_ref: refs/pull/780/merge).
2024-07-07T14:25:19.7792143Z Cleaning up orphan processes

There was no changes quick-xml side in fuzzing settings. Why build failed? I noticed that steps refers to the master branch of required actions, it that correct? Maybe some breaking changes was made in action and I should use some tag instead? But official example still offers using master...

@cpu
Copy link
Contributor

cpu commented Jul 8, 2024

Maybe some breaking changes was made in action and I should use some tag instead? But official example still offers using master...

I don't think pinning the action version will help in this case (but I'm not very familiar with this repo, so would be happily corrected!).

I suspect the issue might be related to the base-builder-rust image? We're also seeing this in Rustls and our Dockerfile, like Quickxml's, pulls the latest of that image.

@manunio
Copy link
Contributor

manunio commented Jul 8, 2024

I'm getting same build error with following rust projects, It might be a wider issue affecting many rust projects:

  • askama
  • trust-dns
  • toml_edit
  • bson-rust
  • ron
  • miniz_oxide
  • wasmer
  • naga

@Mingun Mingun changed the title Rust project quick-xml: cargo fuzz command not found Rust: cargo fuzz command not found (missing in docker image?) Jul 8, 2024
Byron added a commit to GitoxideLabs/gitoxide that referenced this issue Jul 9, 2024
@manunio
Copy link
Contributor

manunio commented Jul 9, 2024

cargo install at:

cargo install cargo-fuzz && rm -rf /rust/registry

is failing with following error:

#5 22.01    Compiling serde_derive v1.0.204
#5 22.90    Compiling thiserror-impl v1.0.61
#5 22.96    Compiling clap_derive v4.5.8
#5 27.45    Compiling clap v4.5.9
#5 27.91 error[E0658]: `#[diagnostic]` attribute name space is experimental
#5 27.91    --> /rust/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.204/src/de/mod.rs:537:5
#5 27.91     |
#5 27.91 537 |     diagnostic::on_unimplemented(
#5 27.91     |     ^^^^^^^^^^
#5 27.91     |
#5 27.91     = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
#5 27.91     = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
#5 27.91     = note: this compiler was built on 2024-02-11; consider upgrading it if it is out of date
#5 27.91
#5 27.91 error[E0658]: `#[diagnostic]` attribute name space is experimental
#5 27.91    --> /rust/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.204/src/ser/mod.rs:220:5
#5 27.91     |
#5 27.91 220 |     diagnostic::on_unimplemented(
#5 27.91     |     ^^^^^^^^^^
#5 27.91     |
#5 27.91     = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
#5 27.91     = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
#5 27.91     = note: this compiler was built on 2024-02-11; consider upgrading it if it is out of date
#5 27.91
#5 29.91 For more information about this error, try `rustc --explain E0658`.
#5 29.92 The following warnings were emitted during compilation:
#5 29.92
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92 warning: serde@1.0.204: cargo:rustc-check-cfg requires -Zcheck-cfg flag
#5 29.92
#5 29.92 error: could not compile `serde` (lib) due to 2 previous errors
#5 29.94 error: failed to compile `cargo-fuzz v0.12.0`, intermediate artifacts can be found at `/tmp/cargo-installcELvNo`.
#5 29.94 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Tested with following command:

BUILDKIT_PROGRESS=plain docker build --no-cache -t gcr.io/oss-fuzz-base/base-builder-rust --file $PWD/infra/base-images/base-builder-rust/Dockerfile $PWD/infra/base-images/base-builder-rust

@Mingun
Copy link
Author

Mingun commented Jul 9, 2024

That feeling when you follow the repository, you see this PR and the problems that it has already created in a couple of projects, but you do not associate it with your problems 😕 . The issue: serde-rs/serde#2767

@Mingun
Copy link
Author

Mingun commented Jul 9, 2024

So it seems that changing this line to nightly-2024-07-07 should fix the issue:

ENV RUSTUP_TOOLCHAIN nightly-2024-02-12

@maflcko
Copy link
Contributor

maflcko commented Jul 9, 2024

So it seems that changing this line to nightly-2024-07-07 should fix the issue:

Only changing this line will likely break the coverage build. (The changes from https://github.com/google/oss-fuzz/pull/12077/files would be needed as well)

Would it be possible to use a previous version of serde instead?

@alexcrichton
Copy link
Contributor

I believe the easiest fix for this would be to add --locked to the cargo install cargo-fuzz command, and I'm in the process of testing that out locally to make sure it works (will send a PR if it does)

@manunio
Copy link
Contributor

manunio commented Jul 9, 2024

I believe the easiest fix for this would be to add --locked to the cargo install cargo-fuzz command, and I'm in the process of testing that out locally to make sure it works (will send a PR if it does)

I was just typing this :)

Edit:
Tested the fix with askama it fixed the cargo-fuzz error, but now it fails for askama itself with following error:

  Compiling serde_derive v1.0.204
error[E0658]: `#[diagnostic]` attribute name space is experimental
   --> /rust/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.204/src/de/mod.rs:537:5
    |
537 |     diagnostic::on_unimplemented(
    |     ^^^^^^^^^^
    |
    = note: see issue #111996 <https://github.com/rust-lang/rust/issues/111996> for more information
    = help: add `#![feature(diagnostic_namespace)]` to the crate attributes to enable
    = note: this compiler was built on 2024-02-11; consider upgrading it if it is out of date

alexcrichton added a commit to alexcrichton/oss-fuzz that referenced this issue Jul 9, 2024
Helps pin dependencies at the time of when `cargo-fuzz` itself was
published to avoid dependency updates breaking builds. This fixes a
current issue where all Rust projects using `cargo fuzz` are broken due
to the installation of `cargo-fuzz` failing due to failing to build a
newer dependency with an older nightly.

Closes google#12168
@catenacyber
Copy link
Contributor

Tested the fix with askama it fixed the cargo-fuzz error, but now it fails for askama itself with following error:

This is because serde does not build on older nightly cf serde-rs/serde#2770 (comment) and #12171 for a workaround

@manunio
Copy link
Contributor

manunio commented Jul 9, 2024

This is because serde does not build on older nightly cf serde-rs/serde#2770 (comment) and #12171 for a workaround

I thought so, Thanks for the workaround.

oliverchang pushed a commit that referenced this issue Jul 11, 2024
Helps pin dependencies at the time of when `cargo-fuzz` itself was
published to avoid dependency updates breaking builds. This fixes a
current issue where all Rust projects using `cargo fuzz` are broken due
to the installation of `cargo-fuzz` failing due to failing to build a
newer dependency with an older nightly.

Closes #12168
Byron added a commit to GitoxideLabs/gitoxide that referenced this issue Jul 11, 2024
It was recently fixed, see google/oss-fuzz#12168 (comment) for details.
@kaczmarczyck
Copy link
Contributor

Hi! OpenSK still fails when running

cargo fuzz build --release --debug-assertions

with the same error as above.

Probably related to us pinning the compiler version here? #12013

@maflcko
Copy link
Contributor

maflcko commented Jul 22, 2024

@kaczmarczyck Looks like the failure is when compiling serde, so maybe temporarily pinning serde, like 037a2b0 may fix it?

@kaczmarczyck
Copy link
Contributor

Thanks! It works locally, so let's try #12269

LuaKT pushed a commit to LMonitor/gitoxide that referenced this issue Aug 20, 2024
LuaKT pushed a commit to LMonitor/gitoxide that referenced this issue Aug 20, 2024
It was recently fixed, see google/oss-fuzz#12168 (comment) for details.
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 a pull request may close this issue.

7 participants