Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <thread>
#include <sys/mman.h>
#include <assert.h>
struct Foo {
int a;
void *ptr;
Foo() : a(4) {
ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
This file has been truncated, but you can view the full file.
==2444257== Helgrind, a thread error detector
==2444257== Copyright (C) 2007-2017, and GNU GPL'd, by OpenWorks LLP et al.
==2444257== Using Valgrind-3.23.0.GIT and LibVEX; rerun with -h for copyright info
==2444257== Command: target/x86_64-unknown-linux-gnu/release/wat
==2444257==
0
==2444257== ---Thread-Announcement------------------------------------------
==2444257==
==2444257== Thread #1 is the program's root thread
==2444257==
Finished `release` profile [optimized + debuginfo] target(s) in 0.10s
Running `target/x86_64-unknown-linux-gnu/release/wat`
0
==================
WARNING: ThreadSanitizer: data race (pid=2339260)
Write of size 8 at 0x7faaa6b96000 by thread T3:
#0 __tsan_memcpy /rustc/llvm/src/llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_memintrinsics.cpp:27:3 (wat+0xe69be) (BuildId: 2ed7393f2cc8e94b8a2c0cace5ca376100e9035a)
#1 core::intrinsics::copy_nonoverlapping::h557b8d907fa657c7 /home/alex/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics/mod.rs:4390:14 (wat+0x3979bd) (BuildId: 2ed7393f2cc8e94b8a2c0cace5ca376100e9035a)
#2 core::slice::_$LT$impl$u20$$u5b$T$u5d$$GT$::copy_from_slice::h12b494d3c29e653e /home/alex/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:3735:13 (wat+0x3979bd)
#3 _$LT$$LT$wasmtime..compile..runtime..MmapVecWrapper$u20$as$u20$wasmtime_environ..compile..module_art
Finished `release` profile [optimized] target(s) in 0.10s
Running `target/x86_64-unknown-linux-gnu/release/wat`
0
==================
WARNING: ThreadSanitizer: data race (pid=2285684)
Write of size 8 at 0x724000008028 by thread T1:
#0 memmove <null> (wat+0xe893e) (BuildId: a3a6796c17d7de568cd8820845c07bac41837262)
#1 <null> <null> (libgcc_s.so.1+0x243c3) (BuildId: 3072445288dd2aba348bf583c65f70509aab8141)
#2 wasmtime::runtime::code_memory::CodeMemory::publish::hb3246a7a669651d2 <null> (wat+0x31a75b) (BuildId: a3a6796c17d7de568cd8820845c07bac41837262)
#3 wasmtime::compile::runtime::publish_mmap::he7291abf92f4259c <null> (wat+0x3c610e) (BuildId: a3a6796c17d7de568cd8820845c07bac41837262)
diff --git a/src/vms/wasmtime.rs b/src/vms/wasmtime.rs
index 115f93d..befdc3d 100644
--- a/src/vms/wasmtime.rs
+++ b/src/vms/wasmtime.rs
@@ -3,7 +3,13 @@ use crate::utils::{CompileTestFilter, ExecuteTestFilter, TestFilter};
use wasmi_new::ModuleImportsIter;
pub struct Wasmtime {
- pub strategy: wasmtime::Strategy,
+ pub strategy: Strategy,
@alexcrichton
alexcrichton / top.js
Created November 19, 2024 00:03
top triggers
// Installation:
//
// 1. Place this file in a folder "$somewhere/raidboss/top.js".
// a. example: C:/Users/alex/Downloads/tmp/raidboss/top.js
// 2. ACT > Plugins > OverlayPlugin.dll > Cactbot Config
// 3. Set "Cactbot user directory" to "$somewhere" from above.
// a. example: C:/Users/alex/Downloads/tmp
// 4. Reload the overlay
// 5. In "Cactbot Config" under "Raidboss" at the bottom you should see a path to "top.js"
// 6. Under "top.js" you should see "The Omega Protocol (Ultimate)"
128.cwasm: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <wasm[0]::function[0]>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 4c 8b 4f 58 mov 0x58(%rdi),%r9
--- good 2021-05-20 08:57:47.000000000 -0700
+++ bad 2021-05-20 08:56:49.000000000 -0700
@@ -227,11 +227,31 @@
INFO rustc_metadata::creader resolving crate `unwind`
INFO rustc_metadata::creader resolving crate `proc_macros`
INFO rustc_metadata::creader falling back to a load
-INFO rustc_metadata::locator dylib reading metadata from: /Users/acrichton/code/wat/target/debug/deps/libproc_macros-5d137cd480dff532.dylib
-INFO rustc_metadata::creader register crate `proc_macros` (cnum = 18. private_dep = false)
-INFO rustc_metadata::creader resolving crate `proc_macros`
-INFO rustc_metadata::creader resolving crate `proc_macros`
;; documentation comment
type $my_record = record {
;; field documentation
field1: u32,
field2: $other_record,
field3: list[string],
field4: in-buffer[u8],
}
;; comment on this type
(module
(import "" "" (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64)))
(func (export "a")
i64.const 0
i64.const 1
i64.const 2
i64.const 3
i64.const 4
i64.const 5
i64.const 6