Skip to content

Commit aed56b4

Browse files
ADKasterIdanHo
authored andcommitted
Documentation: Update Lagom ReadMe with new fuzzer build instructions
1 parent d19bd59 commit aed56b4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Meta/Lagom/ReadMe.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ Lagom can be used to fuzz parts of SerenityOS's code base. Fuzzers can be run lo
1717
Lagom can be used to fuzz parts of SerenityOS's code base. This requires buildling with `clang`, so it's convenient to use a different build directory for that. Fuzzers work best with Address Sanitizer enabled. Run CMake like this:
1818

1919
# From the root of the SerenityOS checkout:
20-
mkdir BuildLagom && cd BuildLagom
21-
cmake -GNinja -DBUILD_LAGOM=ON -DENABLE_FUZZER_SANITIZER=ON -DENABLE_ADDRESS_SANITIZER=ON -DENABLE_UNDEFINED_SANITIZER=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
22-
ninja Meta/Lagom/all
20+
cmake -GNinja -S Meta/Lagom -B Build/lagom-fuzzers \
21+
-DBUILD_LAGOM=ON \
22+
-DENABLE_FUZZER_SANITIZER=ON \
23+
-DENABLE_ADDRESS_SANITIZER=ON \
24+
-DENABLE_UNDEFINED_SANITIZER=ON \
25+
-DCMAKE_CXX_COMPILER=clang++ \
26+
-DCMAKE_C_COMPILER=clang
27+
cd Build/lagom-fuzzers
28+
ninja
2329
# Or as a handy rebuild-rerun line:
24-
ninja FuzzJs && Meta/Lagom/Fuzzers/FuzzJs
30+
ninja FuzzJs && ./Fuzzers/FuzzJs
2531

2632
Any fuzzing results (particularly slow inputs, crashes, etc.) will be dropped in the current directory.
2733

2834
clang emits different warnings than gcc, so you may have to remove `-Werror` in CMakeLists.txt and Meta/Lagom/CMakeLists.txt.
2935

30-
Fuzzers work better if you give them a fuzz corpus, e.g. `Meta/Lagom/Fuzzers/FuzzBMP ../Base/res/html/misc/bmpsuite_files/rgba32-61754.bmp` Pay attention that LLVM also likes creating new files, don't blindly commit them (yet)!
36+
Fuzzers work better if you give them a fuzz corpus, e.g. `./Fuzzers/FuzzBMP ../Base/res/html/misc/bmpsuite_files/rgba32-61754.bmp` Pay attention that LLVM also likes creating new files, don't blindly commit them (yet)!
3137

3238
To run several fuzz jobs in parallel, pass `-jobs=24 -workers=24`.
3339

@@ -99,7 +105,7 @@ To reproduce a crash, run it like this: `MyFuzzer crash-27480a219572aa5a11b28596
99105
To reproduce a crash in gdb, you want to disable various signal handlers, so that gdb sees the actual location of the crash:
100106

101107
```
102-
$ gdb ./Meta/Lagom/Fuzzers/FuzzBMP
108+
$ gdb ./Fuzzers/FuzzBMP
103109
<... SNIP some output ...>
104110
(gdb) run -handle_abrt=0 -handle_segv=0 crash-27480a219572aa5a11b285968a3632a4cf25388e
105111
<... SNIP some output ...>

0 commit comments

Comments
 (0)