aboutsummaryrefslogtreecommitdiff
path: root/lib/fuzzer
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-08-04 00:16:28 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-08-07 00:48:32 -0700
commit517cfb0dd1e2b5b8efc8e90ce4e5593a38fa158c (patch)
treeb630ec6fa767f2aaf6932472a8acb85ac5089cf5 /lib/fuzzer
parent5f92a036f9a9a137e4276d0f605e4cb940eca3a7 (diff)
downloadzig-517cfb0dd1e2b5b8efc8e90ce4e5593a38fa158c.tar.gz
zig-517cfb0dd1e2b5b8efc8e90ce4e5593a38fa158c.zip
fuzzing: progress towards web UI
* libfuzzer: close file after mmap * fuzzer/main.js: connect with EventSource and debug dump the messages. currently this prints how many fuzzer runs have been attempted to console.log. * extract some `std.debug.Info` logic into `std.debug.Coverage`. Prepares for consolidation across multiple different executables which share source files, and makes it possible to send all the PC/SourceLocation mapping data with 4 memcpy'd arrays. * std.Build.Fuzz: - spawn a thread to watch the message queue and signal event subscribers. - track coverage map data - respond to /events URL with EventSource messages on a timer
Diffstat (limited to 'lib/fuzzer')
-rw-r--r--lib/fuzzer/main.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/fuzzer/main.js b/lib/fuzzer/main.js
index 71e6b5fa54..872ac3d4b5 100644
--- a/lib/fuzzer/main.js
+++ b/lib/fuzzer/main.js
@@ -12,6 +12,9 @@
const text_decoder = new TextDecoder();
const text_encoder = new TextEncoder();
+ const eventSource = new EventSource("events");
+ eventSource.addEventListener('message', onMessage, false);
+
WebAssembly.instantiateStreaming(wasm_promise, {
js: {
log: function(ptr, len) {
@@ -38,11 +41,15 @@
});
});
+ function onMessage(e) {
+ console.log("Message", e.data);
+ }
+
function render() {
- domSectSource.classList.add("hidden");
+ domSectSource.classList.add("hidden");
- // TODO this is temporary debugging data
- renderSource("/home/andy/dev/zig/lib/std/zig/tokenizer.zig");
+ // TODO this is temporary debugging data
+ renderSource("/home/andy/dev/zig/lib/std/zig/tokenizer.zig");
}
function renderSource(path) {