Skip to content

Commit 7d0f2e4

Browse files
authored
Merge pull request #27 from ol2764RIT/database
DATABASE (chasek approved)
2 parents 5845f7b + dfcc987 commit 7d0f2e4

23 files changed

Lines changed: 4087 additions & 11 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ Cloud/GCE/config.sh
1414
# node.js dependencies, used by the JavaScript parser for the FuzzIL compiler
1515
node_modules
1616
package-lock.json
17+
18+
# V8 build directory for testing
19+
v8_build_test/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
# PostgreSQL Corpus Example for Fuzzilli
4+
# This script demonstrates how to use the new PostgreSQL corpus feature
5+
6+
echo "=== Fuzzilli PostgreSQL Corpus Example ==="
7+
echo ""
8+
9+
echo "1. Basic PostgreSQL corpus usage:"
10+
echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8"
11+
echo ""
12+
13+
echo "2. With custom sync interval and validation:"
14+
echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://user:pass@host:5432/db --sync-interval=30 --validate-before-cache --execution-history-size=20 --profile=v8 /path/to/d8"
15+
echo ""
16+
17+
echo "3. Multiple fuzzer instances sharing the same PostgreSQL database:"
18+
echo "# Fuzzer 1:"
19+
echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8"
20+
echo ""
21+
echo "# Fuzzer 2 (in another terminal):"
22+
echo "swift run FuzzilliCli --corpus=postgresql --postgres-url=postgresql://localhost:5432/fuzzilli --profile=v8 /path/to/d8"
23+
echo ""
24+
25+
echo "4. Available PostgreSQL corpus options:"
26+
echo " --corpus=postgresql : Use PostgreSQL corpus"
27+
echo " --postgres-url=url : PostgreSQL connection string (required)"
28+
echo " --sync-interval=n : Sync interval in seconds (default: 10)"
29+
echo " --validate-before-cache : Enable program validation (default: true)"
30+
echo " --execution-history-size=n : Recent executions to keep in memory (default: 10)"
31+
echo ""
32+
33+
echo "5. PostgreSQL connection string format:"
34+
echo " postgresql://username:password@hostname:port/database"
35+
echo " Example: postgresql://fuzzilli:password@localhost:5432/fuzzilli"
36+
echo ""
37+
38+
echo "6. Features of PostgreSQL corpus:"
39+
echo " - In-memory caching for fast access"
40+
echo " - PostgreSQL backend for persistence and sharing"
41+
echo " - Execution metadata tracking (coverage, execution count, etc.)"
42+
echo " - Periodic synchronization with central database"
43+
echo " - Thread-safe operations"
44+
echo " - Distributed fuzzing support"
45+
echo ""
46+
47+
echo "7. Help and validation:"
48+
echo "swift run FuzzilliCli --help # Show all options"
49+
echo "swift run FuzzilliCli --corpus=postgresql # Shows validation error"
50+
echo ""
51+
52+
echo "=== Example Complete ==="

Package.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ let package = Package(
3030
url: "https://github.com/apple/swift-collections.git",
3131
.upToNextMinor(from: "1.2.0")
3232
),
33+
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.20.0"),
34+
.package(url: "https://github.com/vapor/postgres-kit.git", from: "2.9.0"),
3335
],
3436
targets: [
3537
.target(name: "libsocket",
@@ -47,6 +49,8 @@ let package = Package(
4749
dependencies: [
4850
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
4951
.product(name: "Collections", package: "swift-collections"),
52+
.product(name: "PostgresNIO", package: "postgres-nio"),
53+
.product(name: "PostgresKit", package: "postgres-kit"),
5054
"libsocket",
5155
"libreprl",
5256
"libcoverage"],

0 commit comments

Comments
 (0)