Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fuzz Tests Are Crashing at Start-up on ClusterFuzz #1905

Closed
@DaveLak

Description

@DaveLak

PR#1901 was successful in fixing the broken build but resurfaced another issue that is preventing the fuzzer from running.

The Problem

It appears that a Git executable is not available in the ClusterFuzz container environment where fuzz tests are executed, causing an error in the fuzz harnesses when GitPython attempts to initialize.

This issue has been previously seen and reported on the OSS-Fuzz issue tracker:google/oss-fuzz#10600

Relevant Portion of the ClusterFuzz Crash Logs from 2024-04-20
# <Prior output omitted for brevity>INFO: Instrumenting git.index.utilINFO: Instrumenting git.remoteINFO: Instrumenting [git.repo.fun](http://git.repo.fun/)Traceback (most recent call last):  File"git/__init__.py", line 296,in<module>  File"git/__init__.py", line 287,in refresh  File"git/cmd.py", line 631,in refreshImportError: Bad git executable.The git executable must be specifiedin one of the following ways:    - be includedin your$PATH    - beset via$GIT_PYTHON_GIT_EXECUTABLE    - explicitlyset via git.refresh(<full-path-to-git-executable>)All git commands will erroruntil this is rectified.This initial message can be silenced or aggravatedin the future by setting the$GIT_PYTHON_REFRESH environment variable. Use one of the following values:    - quiet|q|silence|s|silent|none|n|0:for no message or exception    - warn|w|warning|log|l|1:for a warning message (logging level CRITICAL, displayed by default)    - error|e|exception|raise|r|2:for a raised exceptionExample:export GIT_PYTHON_REFRESH=quietThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File"[fuzz_config.py](http://fuzz_config.py/)", line 26,in<module>  File"PyInstaller/loader/pyimod02_importers.py", line 419,in exec_module  File"git/__init__.py", line 298,in<module>ImportError: Failed to initialize: Bad git executable.The git executable must be specifiedin one of the following ways:    - be includedin your$PATH    - beset via$GIT_PYTHON_GIT_EXECUTABLE    - explicitlyset via git.refresh(<full-path-to-git-executable>)All git commands will erroruntil this is rectified.This initial message can be silenced or aggravatedin the future by setting the$GIT_PYTHON_REFRESH environment variable. Use one of the following values:    - quiet|q|silence|s|silent|none|n|0:for no message or exception    - warn|w|warning|log|l|1:for a warning message (logging level CRITICAL, displayed by default)    - error|e|exception|raise|r|2:for a raised exceptionExample:export GIT_PYTHON_REFRESH=quiet[80625] Failed to execute script'fuzz_config' due to unhandled exception!cf::fuzzing_strategies: fork:2,value_profile:1

Possible Solution

OSS-Fuzz uses Pyinstaller to bundle fuzz harnesses and their dependencies in thecompile_python_fuzzers function called bybuild.sh. Arguments passed tocompile_python_fuzzers after the fuzz harness are forwarded to Pyinstaller, which accepts an--add-binary flag to add arbitrary binaries to the bundle andare made available to the bundled program at runtime.

We should be able to:

  1. Download a pre built Git binary fromkernal.org in thecontainer-environment-bootstrap.sh script. Never mind, the downloadable archives are source, not builds.
  2. Bundle thegit available in the OSS-Fuzz build container with the fuzz harness inbuild.sh
  3. And use GitPython'sgit.refresh(<full-path-to-git-executable>) method inside aPyintaller runtime check to initialize GitPython with the bundled Git executable when running from the bundled application.

Next Steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp