GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fuzz Tests Are Crashing at Start-up on ClusterFuzz · Issue #1905 · gitpython-developers/GitPython

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

New issue
Copy link
New issue
Copy link
Closed
Closed
Fuzz Tests Are Crashing at Start-up on ClusterFuzz#1905
Copy link

Description

@DaveLak
DaveLak
opened on Apr 22, 2024
Issue body actions

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.util
INFO: Instrumenting git.remote
INFO: 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 refresh
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh(<full-path-to-git-executable>)

All git commands will error until this is rectified.

This initial message can be silenced or aggravated in 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 exception

Example:
    export GIT_PYTHON_REFRESH=quiet


The 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 specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh(<full-path-to-git-executable>)

All git commands will error until this is rectified.

This initial message can be silenced or aggravated in 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 exception

Example:
    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 the compile_python_fuzzers function called by build.sh. Arguments passed to compile_python_fuzzers after the fuzz harness are forwarded to Pyinstaller, which accepts an --add-binary flag to add arbitrary binaries to the bundle and are made available to the bundled program at runtime.

We should be able to:

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

Next Steps

  • I'll test out the possible solution described above and open a PR if it works as expected. Done in Fix Fuzzer Crash in ClusterFuzz Due to Missing Git Executable #1906
  • If it doesn't work, I'll document the outcome in this issue.

Activity

  1. DaveLak
    added a commit that references this issue on Apr 22, 2024

    Fix Fuzzer Crash in ClusterFuzz Due to Missing Git Executable

    f4b95cf
  2. Byron commented on Apr 23, 2024

    @Byron
    Byron
    on Apr 23, 2024
    Member
    More actions

    Thanks for reporting!

    This should be fixed by #1906 .

  3. Byron
    closed this as completedon Apr 23, 2024
  4. DaveLak
    added a commit that references this issue on Apr 26, 2024

    Attempt 2 - Fix Missing Git Executable Causing ClusterFuzz Crash

    dac3535
  5. DaveLak commented on Apr 26, 2024

    @DaveLak
    DaveLak
    on Apr 26, 2024
    ContributorAuthor
    More actions

    #1906 didn't quite do the trick but #1909 should 🙂

    Reacted by Sebastian Thiel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.