1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 // Tests that deadlocks do not occur when an OOM occurs during symbolization.
15 volatile unsigned Sink
= 0;
17 // Do not inline this function. We want to trigger NEW_FUNC symbolization when
18 // libFuzzer finds this function. We use a macro to make the name as long
19 // possible, hoping to increase the time spent in symbolization and increase the
20 // chances of triggering a deadlock.
21 __attribute__((noinline
)) void BINGO() {
22 // Busy work. Inserts a delay here so the deadlock is more likely to trigger.
23 for (unsigned i
= 0; i
< 330000000; i
++) Sink
+= i
;
26 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data
, size_t Size
) {
28 if (Size
< 3) return 0;