google / google/oss-fuzz

[Infra] Please provide openmp runtime

Open
#11,547 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
12.6k
Forks
2.9k
Avg merge
2d 2h
Merged PRs (30d)
62

Description

I understand that fuzzers are themselves externally parallelly run,
and thus should not use parallelization internally.

However. There's this funny thing:
https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5-2.pdf
```
4.3 Structured Blocks
1 Restrictions
2 Restrictions to structured blocks are as follows:
3 • Entry to a structured block must not be the result of a branch.
4 • The point of exit cannot be a branch out of the structured block.
C / C++
5 • The point of entry to a structured block must not be a call to setjmp.
6 • longjmp must not violate the entry/exit criteria of structured blocks.
C / C++
C++
7 • throw, co_await, co_yield and co_return must not violate the entry/exit criteria of
8 structured blocks.
```

IOW
```
void foo() {
#pragma omp parallel
{
throw 42;
}
}
```
... is invalid, and will cause deterministic program termination.
But in fuzzers, that ends up being
```
void foo() {
// no openmp stuff!
{
throw 42;
}
}
```
so an exception can escape `foo()` now instead of causing program termination,
and perhaps caught up the call stack. The problem being,
you are no longer fuzzing the same code,
and fuzzers will never uncover this program-termination bug.

This is not a theoretical concern, i've just encountered one case: https://github.com/darktable-org/rawspeed/commit/787695f19bba53c5186cd89ee383884e69d6a285

Contributor guide

Open the contributing guide

Research direction

No repository files or tests are named. Start by locating the OSS-Fuzz build and runtime setup that controls compiler and linker support for C++ fuzz targets, then check how an OpenMP-enabled target is built. Done means the OpenMP runtime is available without disabling parallel code, preserving the target's runtime behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, infrastructure, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.