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 — gh-107652: Set up CIFuzz to run fuzz targets continuously by illia-v · Pull Request #107653 · python/cpython

Conversation

@illia-v

@illia-v illia-v commented Aug 5, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This sets up CIFuzz to run fuzz targets with three types of sanitizers for every pull request to the main branch and every commit in the main branch.

  • Issue: Set up CIFuzz to run fuzz targets continuously #107652

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bradlarsen reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@illia-v
Set up CIFuzz to run fuzz targets continuously
f2c1668
@illia-v
illia-v requested review from ezio-melotti and hugovk as code owners August 5, 2023 11:05
@bedevere-bot bedevere-bot added the awaiting review label Aug 5, 2023
@bedevere-bot bedevere-bot mentioned this pull request Aug 5, 2023
Set up CIFuzz to run fuzz targets continuously #107652
Closed
@illia-v illia-v mentioned this pull request Aug 5, 2023
Use of uninitialized memory in Objects/longobject.c #106914
Closed
@github-advanced-security

github-advanced-security AI commented Aug 5, 2023

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk reviewed Aug 5, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread .github/workflows/build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread .github/workflows/build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

@illia-v @hugovk
Change names of job steps
58d0e57
Co-authored-by: Hugo van Kemenade <[email protected]>
@illia-v
illia-v requested a review from hugovk August 5, 2023 11:50
@hugovk

hugovk commented Aug 5, 2023

Copy link
Copy Markdown
Member

I'm mindful of CI availability and note this adds three slow, ~23-28 minute jobs:

Screenshot_20230805_144434_Chrome

Is there any caching that can be used to speed them up?

Should we restrict these jobs to only trigger when C files change, and not Python/other support files?

And, if we've already run this on PRs, do we also need to run on main after merge?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Aug 5, 2023

Copy link
Copy Markdown
Member

And, if we've already run this on PRs, do we also need to run on main after merge?

I'd second this, especially if given OSS Fuzz's runs (per the comment at the top of the new job).

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@illia-v

illia-v commented Aug 6, 2023

Copy link
Copy Markdown
Contributor Author

I'm mindful of CI availability and note this adds three slow, ~23-28 minute jobs:

Is there any caching that can be used to speed them up?

I agree, but it seems that CIFuzz does not support any settings for caching and Python compilation happens in its Docker containers.

There is a fuzz-seconds: 600 setting, I used the default (and the recommended minimum) 10-minute value because it makes the tests run for roughly the same amount of time as "Windows (x86)".

Should we restrict these jobs to only trigger when C files change, and not Python/other support files?

This sounds like a good idea!

And, if we've already run this on PRs, do we also need to run on main after merge?

Running on PR updates should be enough.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

illia-v added 2 commits August 6, 2023 11:49
@illia-v
Change the condition for running CIFuzz
ccae802
@illia-v
Mention CIFuzz in README for fuzz tests
6aedeb8
@vstinner

vstinner commented Aug 22, 2023

Copy link
Copy Markdown
Member

I don't understand well which Python is tested. Does the job builds Python and run the fuzzer on the freshly built Python?


CIFuzz (address) pass but it see a log with an error:

=================================================================
==83==ERROR: AddressSanitizer: ABRT on unknown address 0x000000000053 (pc 0x7f4f5cf8600b bp 0x7fffccb9f100 sp 0x7fffccb9ee80 T0)
SCARINESS: 10 (signal)
    #0 0x7f4f5cf8600b in raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #1 0x7f4f5cf65858 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x22858) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #2 0x586744 in LLVMFuzzerTestOneInput /src/cpython3/Modules/_xxtestfuzz/fuzzer.c
    #3 0x4578d3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #4 0x4570ba in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:514:3
    #5 0x458f24 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:826:7
    #6 0x459159 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile> >&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:857:3
    #7 0x4487bf in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:912:6
    #8 0x471e12 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #9 0x7f4f5cf67082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
    #10 0x4391fd in _start (build-out/fuzz_ast_literal_eval+0x4391fd)

DEDUP_TOKEN: raise--abort--LLVMFuzzerTestOneInput
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x4300b) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee) in raise
==83==ABORTING
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@illia-v

illia-v commented Aug 25, 2023

Copy link
Copy Markdown
Contributor Author

@vstinner please check "How it works".

It builds CPython from the source at a particular pull request, and it does not report crashes that occurred on older OSS-Fuzz builds. You can find that particular error in the list of known issues here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@illia-v
Merge branch 'main' into cifuzz
65f2ba3
@AA-Turner

AA-Turner commented Aug 25, 2023

Copy link
Copy Markdown
Member

Could CIFuzz be run as a buildbot instead of on CI? There's been a concerted effort to reduce CI times as of late, and I do worry that this PR adds a substantial amount of work for little apparent benefit, given that OSS Fuzz runs anyway on actual commits.

If we could do a "test with fuzz buildbots" label, that might be a compromise?

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Aug 25, 2023

Copy link
Copy Markdown
Member

There's been a concerted effort to reduce CI times as of late, and I do worry that this PR adds a substantial amount of work for little apparent benefit, given that OSS Fuzz runs anyway on actual commits.

If the CI job is not mandatory and doesn't prevent to merge a PR, I think that it's acceptable to use GHA resources.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@illia-v

illia-v commented Aug 25, 2023

Copy link
Copy Markdown
Contributor Author

If we could do a "test with fuzz buildbots" label, that might be a compromise?

I am not sure how often the label will be set, it is pretty likely that this approach will not solve the problem of OSS-Fuzz builds being left broken from time to time

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@illia-v
Merge branch 'main' into cifuzz
6754686
@illia-v

illia-v commented Oct 4, 2023

Copy link
Copy Markdown
Contributor Author

@ezio-melotti @hugovk is there anything I can do here to make this PR ready for merging?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Oct 6, 2023

Copy link
Copy Markdown
Member

@illia-v It's the core dev sprint next week, I'll bring it up for discussion then. I think fuzzing can be extremely valuable, and we need to balance how long it runs so we're not waiting too long for PRs to complete.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Oct 6, 2023

Copy link
Copy Markdown
Member

It seems @15r10nk found several issues that OSS-Fuzz missed, I assume using a different approach. If we're to adopt fuzzing, perhaps we should try his mechanism that seems to find more (release-blocking!) issues?

A

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

hugovk
hugovk reviewed Oct 9, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Let's give this a shot! It's a bit slow, but it's about the same as the Windows jobs. We're trying to make the Windows ones faster, and if the duration fuzzing jobs end up being a problem, we can address it then.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

illia-v reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread .github/workflows/build.yml Resolved

Uh oh!

There was an error while loading. Please reload this page.

illia-v added 2 commits October 9, 2023 15:36
@illia-v
Merge branch 'main' into cifuzz
582a598
@illia-v
Add cifuzz to allowed-failures and allowed-skips
c5cec4a
hugovk
hugovk approved these changes Oct 9, 2023
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot removed the awaiting review label Oct 9, 2023
@bedevere-app bedevere-app Bot added the awaiting core review label Oct 9, 2023
@hugovk
hugovk merged commit ea7b53f into python:main Oct 9, 2023
@bedevere-app bedevere-app Bot removed the awaiting core review label Oct 9, 2023
@sobolevn sobolevn mentioned this pull request Oct 9, 2023
gh-107652: Fix CIFuzz build #110576
Merged
@hugovk hugovk mentioned this pull request Oct 10, 2023
gh-107652: Fix CIFuzz typo #110602
Merged
@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member

Is there a doc somewhere explaining how to handle a CIFuzz failure? Or this CI never fails? :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner

vstinner commented Oct 11, 2023

Copy link
Copy Markdown
Member

I just would like to know who I should contact if it goes wrong. @hugovk if I understood correctly :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk

hugovk commented Oct 11, 2023

Copy link
Copy Markdown
Member

If/when it fails, let's open an issue and figure it out :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead

gpshead commented Mar 16, 2024

Copy link
Copy Markdown
Member

We've been seeing CIFuzz failures on otherwise good PRs not related to the PR change at hand of late with the build failing:

./Programs/_freeze_module importlib._bootstrap_external ./Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
Segmentation fault (core dumped)
make: *** [Makefile:1660: Python/frozen_modules/importlib._bootstrap_external.h] Error 139

these are understandably confusing people.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead gpshead mentioned this pull request Mar 16, 2024
CIFuzz build failures - _freeze_module segfaults during the build, fuzz testing doesn't start. #116886
Closed
@vstinner

vstinner commented Mar 16, 2024

Copy link
Copy Markdown
Member

We've been seeing CIFuzz failures on otherwise good PRs not related to the PR change at hand of late with the build failing:
./Programs/_freeze_module importlib._bootstrap_external ./Lib/importlib/_bootstrap_external.py Python/frozen_modules/importlib._bootstrap_external.h
Segmentation fault (core dumped)

@gpshead created issue #116886.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sobolevn sobolevn mentioned this pull request Jun 26, 2024
gh-121023: Improve _xxtestfuzz/README.rst #121024
Merged
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@illia-v @hugovk @Glyphack
pythongh-107652: Set up CIFuzz to run fuzz targets continuously (pyth…
2c8fd50
…on#107653)

Co-authored-by: Hugo van Kemenade <[email protected]>
@AA-Turner AA-Turner mentioned this pull request Feb 3, 2025
Convert change detection to a Python script #129627
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes
@ezio-melotti ezio-melotti Awaiting requested review from ezio-melotti ezio-melotti is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@illia-v @github-advanced-security @hugovk @AA-Turner @vstinner @gpshead @bedevere-bot
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.
You are visitor 01402503 — 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.