Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filecache: use os.CreateTemp to create files #2088

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

achille-roussel
Copy link
Collaborator

This might be a fix for #2039

Since #1816, the file cache appended .tmp to the file path name to avoid leaving incomplete files in the cache when an error occurs. However, this is the definition of os.Create:

func Create(name string) (*File, error) {
	return OpenFile(name, O_RDWR|O_CREATE|O_TRUNC, 0666)
}

File creation does not include the O_EXCL flag, which means that when the file already exists, it is opened and truncated.

This PR changes the file cache to use os.CreateTemp instead, which guarantees that the file name will be unique by injecting a random string in the file name and opening the file with O_EXCL to prevent racing calls that would accidentally use the same name from both suceeding:

func CreateTemp(dir, pattern string) (*File, error) {
	if dir == "" {
		dir = TempDir()
	}

	prefix, suffix, err := prefixAndSuffix(pattern)
	if err != nil {
		return nil, &PathError{Op: "createtemp", Path: pattern, Err: err}
	}
	prefix = joinPath(dir, prefix)

	try := 0
	for {
		name := prefix + nextRandom() + suffix
		f, err := OpenFile(name, O_RDWR|O_CREATE|O_EXCL, 0600)
		if IsExist(err) {
			if try++; try < 10000 {
				continue
			}
			return nil, &PathError{Op: "createtemp", Path: prefix + "*" + suffix, Err: ErrExist}
		}
		return f, err
	}
}

In #2039, we observe errors where the memory mapping containing the code was getting corrupted somehow. We first assumed that it was caused by a lifecycle issue on the compiled modules that hold these memory segments. The hypothesis I'm making with this change is that concurrent calls to os.Create for the same compiled module race each other; when the second call occurs, it truncates the content that was being written by the first call. After that, the program cannot rely on the content of the file anymore.

I don't have a test to verify the hypothesis, but regardless, I believe this change is useful to make because it addresses a potential race condition that will manifest sooner or later.

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@achille-roussel achille-roussel added the bug Something isn't working label Feb 23, 2024
@achille-roussel achille-roussel self-assigned this Feb 23, 2024
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@achille-roussel
Copy link
Collaborator Author

I submitted a second commit after realizing that we could get rid of the in-memory synchronization in the file cache and rely exclusively on the atomicity guarantees offered by the file system. Besides the code simplification, relying on the file system also offers synchronization that works when multiple processes share the same cache directory.

@mathetake mathetake removed their request for review February 23, 2024 02:38
@evacchi
Copy link
Contributor

evacchi commented Feb 23, 2024

so, the assumption essentially is

A) reads the file, validates the header
B) truncates the file
A) continues and completes deserialization somewhat successfully but the contents are garbled

in other words, if this is correct we should be able to reproduce the failure on CI by crafting a cache entry with correct metadata but random or zeroed data in the body

In a quick experiment I commented out lines 206-210 in:

if err = cm.executable.Map(int(executableLen)); err != nil {
err = fmt.Errorf("compilationcache: error mmapping executable (len=%d): %v", executableLen, err)
return
}
_, err = io.ReadFull(reader, cm.executable.Bytes())
if err != nil {
err = fmt.Errorf("compilationcache: error reading executable (len=%d): %v", executableLen, err)
return
}
if runtime.GOARCH == "arm64" {
// On arm64, we cannot give all of rwx at the same time, so we change it to exec.
if err = platform.MprotectRX(cm.executable.Bytes()); err != nil {
return
}
}

i.e. the cache now always returns a right-sized buffer with whatever garbage mmap returns, this indeed causes an immediate failure that might be

the trick is similar for wazevo in

_, err = io.ReadFull(reader, executable)
if err != nil {
err = fmt.Errorf("compilationcache: error reading executable (len=%d): %v", executableLen, err)
return nil, false, err
}

and the resulting failures look compatible to me

trace for `compiler`
[evacchi@fedora wazero]$ go test ./internal/integration_test/filecache/... -run TestFileCache_compiler
unexpected fault address 0x7f5e4d55106e
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x1 addr=0x7f5e4d55106e pc=0x7f5e4d55106e]

goroutine 19 [running]:
runtime.throw({0x7405a4?, 0xa000?})
	/usr/lib/golang/src/runtime/panic.go:1047 +0x5d fp=0xc0000f9880 sp=0xc0000f9850 pc=0x4380fd
runtime.sigpanic()
	/usr/lib/golang/src/runtime/signal_unix.go:855 +0x28a fp=0xc0000f98e0 sp=0xc0000f9880 pc=0x44f06a
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).execWasmFunction(0xc000244000, {0xbc19e0, 0xc0001101e0}, 0x0?, 0x90?)
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go:1061 +0x68 fp=0xc0000f9958 sp=0xc0000f98e0 pc=0x5d73a8
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).call(0xc000244000, {0xbc19e0, 0xc0001101e0}, {0x0?, 0xc0000f9a78?, 0x5d609b?}, {0x0, 0x0, 0x0})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go:795 +0x36a fp=0xc0000f9a30 sp=0xc0000f9958 pc=0x5d65ea
github.com/tetratelabs/wazero/internal/engine/compiler.(*callEngine).Call(0xc00015a100?, {0xbc19e0?, 0xc0001101e0?}, {0x0?, 0x0?, 0x0?})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go:742 +0xd9 fp=0xc0000f9aa8 sp=0xc0000f9a30 pc=0x5d6219
github.com/tetratelabs/wazero/internal/wasm.(*Store).instantiate(0xc00014e360, {0xbc19e0, 0xc0001101e0}, 0xc000102820, {0xc00011a43c, 0x4}, 0xc00023a000, {0xc00011a444, 0x1, 0x1})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/wasm/store.go:389 +0x44d fp=0xc0000f9b58 sp=0xc0000f9aa8 pc=0x5aa04d
github.com/tetratelabs/wazero/internal/wasm.(*Store).Instantiate(0x201000000?, {0xbc19e0, 0xc0001101e0}, 0x0?, {0xc00011a43c?, 0x0?}, 0x1f?, {0xc00011a444, 0x1, 0x1})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/wasm/store.go:320 +0x65 fp=0xc0000f9bd8 sp=0xc0000f9b58 pc=0x5a9b25
github.com/tetratelabs/wazero.(*runtime).InstantiateModule(0xc000110780, {0xbc19e0, 0xc0001101e0}, {0xbc2e50?, 0xc0001566c0}, {0xbc51b8?, 0xc0000f9d68})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/runtime.go:312 +0x1fb fp=0xc0000f9cd0 sp=0xc0000f9bd8 pc=0x69241b
github.com/tetratelabs/wazero.(*runtime).InstantiateWithConfig(0x473846?, {0xbc19e0, 0xc0001101e0}, {0xc00020c000?, 0x40ecaa?, 0xc000110750?}, {0xbc51b8, 0xc0000f9d68})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/runtime.go:277 +0x8b fp=0xc0000f9d20 sp=0xc0000f9cd0 pc=0x69218b
github.com/tetratelabs/wazero.(*runtime).Instantiate(0xbc19e0?, {0xbc19e0, 0xc0001101e0}, {0xc00020c000, 0x4a, 0x80})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/runtime.go:268 +0xf3 fp=0xc0000f9e68 sp=0xc0000f9d20 pc=0x692093
github.com/tetratelabs/wazero/internal/integration_test/filecache.testListeners.func1(0xc0001024e0)
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:148 +0x41d fp=0xc0000f9f70 sp=0xc0000f9e68 pc=0x6af9fd
testing.tRunner(0xc0001024e0, 0xc0001100f0)
	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc0000f9fc0 sp=0xc0000f9f70 pc=0x4ee4eb
testing.(*T).Run.func1()
	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc0000f9fe0 sp=0xc0000f9fc0 pc=0x4ef52a
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000f9fe8 sp=0xc0000f9fe0 pc=0x46ce01
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

goroutine 1 [chan receive]:
runtime.gopark(0xdb5d80?, 0xc000014078?, 0x60?, 0xab?, 0xc0000fda28?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc0000fd9a8 sp=0xc0000fd988 pc=0x43ae56
runtime.chanrecv(0xc0000b20e0, 0xc0000fdaa7, 0x1)
	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc0000fda38 sp=0xc0000fd9a8 pc=0x40825d
runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc0000fda60 sp=0xc0000fda38 pc=0x407d98
testing.(*T).Run(0xc00018c1a0, {0x74c093?, 0x4ee205?}, 0xb6f820)
	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc0000fdb20 sp=0xc0000fda60 pc=0x4ef3a5
testing.runTests.func1(0xdb5d80?)
	/usr/lib/golang/src/testing/testing.go:2036 +0x45 fp=0xc0000fdb70 sp=0xc0000fdb20 pc=0x4f1565
testing.tRunner(0xc00018c1a0, 0xc0000fdc88)
	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc0000fdbc0 sp=0xc0000fdb70 pc=0x4ee4eb
testing.runTests(0xc0000d8280?, {0xda25a0, 0x2, 0x2}, {0x0?, 0x100c0000d4638?, 0xdb54e0?})
	/usr/lib/golang/src/testing/testing.go:2034 +0x489 fp=0xc0000fdcb8 sp=0xc0000fdbc0 pc=0x4f1449
testing.(*M).Run(0xc0000d8280)
	/usr/lib/golang/src/testing/testing.go:1906 +0x63a fp=0xc0000fdf00 sp=0xc0000fdcb8 pc=0x4efdba
main.main()
	_testmain.go:49 +0x1aa fp=0xc0000fdf80 sp=0xc0000fdf00 pc=0x6b070a
runtime.main()
	/usr/lib/golang/src/runtime/proc.go:250 +0x207 fp=0xc0000fdfe0 sp=0xc0000fdf80 pc=0x43aa27
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000fdfe8 sp=0xc0000fdfe0 pc=0x46ce01

goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000088fb0 sp=0xc000088f90 pc=0x43ae56
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:387
runtime.forcegchelper()
	/usr/lib/golang/src/runtime/proc.go:305 +0xb0 fp=0xc000088fe0 sp=0xc000088fb0 pc=0x43ac90
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000088fe8 sp=0xc000088fe0 pc=0x46ce01
created by runtime.init.6
	/usr/lib/golang/src/runtime/proc.go:293 +0x25

goroutine 3 [runnable]:
runtime.goschedIfBusy()
	/usr/lib/golang/src/runtime/proc.go:344 +0x30 fp=0xc000089780 sp=0xc000089768 pc=0x43ad50
runtime.bgsweep(0x0?)
	/usr/lib/golang/src/runtime/mgcsweep.go:303 +0x151 fp=0xc0000897c8 sp=0xc000089780 pc=0x425651
runtime.gcenable.func1()
	/usr/lib/golang/src/runtime/mgc.go:178 +0x26 fp=0xc0000897e0 sp=0xc0000897c8 pc=0x41a846
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000897e8 sp=0xc0000897e0 pc=0x46ce01
created by runtime.gcenable
	/usr/lib/golang/src/runtime/mgc.go:178 +0x6b

goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc0000b2000?, 0xbbd238?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000089f70 sp=0xc000089f50 pc=0x43ae56
runtime.goparkunlock(...)
	/usr/lib/golang/src/runtime/proc.go:387
runtime.(*scavengerState).park(0xdb5560)
	/usr/lib/golang/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc000089fa0 sp=0xc000089f70 pc=0x4234b3
runtime.bgscavenge(0x0?)
	/usr/lib/golang/src/runtime/mgcscavenge.go:633 +0x65 fp=0xc000089fc8 sp=0xc000089fa0 pc=0x423aa5
runtime.gcenable.func2()
	/usr/lib/golang/src/runtime/mgc.go:179 +0x26 fp=0xc000089fe0 sp=0xc000089fc8 pc=0x41a7e6
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000089fe8 sp=0xc000089fe0 pc=0x46ce01
created by runtime.gcenable
	/usr/lib/golang/src/runtime/mgc.go:179 +0xaa

goroutine 5 [finalizer wait]:
runtime.gopark(0x0?, 0xb6f740?, 0x80?, 0x20?, 0x1000000010?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000088628 sp=0xc000088608 pc=0x43ae56
runtime.runfinq()
	/usr/lib/golang/src/runtime/mfinal.go:193 +0x107 fp=0xc0000887e0 sp=0xc000088628 pc=0x419887
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000887e8 sp=0xc0000887e0 pc=0x46ce01
created by runtime.createfing
	/usr/lib/golang/src/runtime/mfinal.go:163 +0x45

goroutine 6 [chan receive]:
runtime.gopark(0xc0001160d8?, 0x0?, 0xd1?, 0x60?, 0xc00009bdf8?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00009bd78 sp=0xc00009bd58 pc=0x43ae56
runtime.chanrecv(0xc000128150, 0xc00009be77, 0x1)
	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc00009be08 sp=0xc00009bd78 pc=0x40825d
runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc00009be30 sp=0xc00009be08 pc=0x407d98
testing.(*T).Run(0xc00018c340, {0x742968?, 0x40f087?}, 0xc0001300d8)
	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc00009bef0 sp=0xc00009be30 pc=0x4ef3a5
github.com/tetratelabs/wazero/internal/integration_test/filecache.runAllFileCacheTests(0x4ee205?, {0xbc2ea0?, 0xc0000b4940})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:45 +0xe5 fp=0xc00009bf30 sp=0xc00009bef0 pc=0x6adcc5
github.com/tetratelabs/wazero/internal/integration_test/filecache.TestFileCache_compiler(0x0?)
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:30 +0xd0 fp=0xc00009bf70 sp=0xc00009bf30 pc=0x6adb50
testing.tRunner(0xc00018c340, 0xb6f820)
	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc00009bfc0 sp=0xc00009bf70 pc=0x4ee4eb
testing.(*T).Run.func1()
	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc00009bfe0 sp=0xc00009bfc0 pc=0x4ef52a
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00009bfe8 sp=0xc00009bfe0 pc=0x46ce01
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

goroutine 18 [chan receive]:
runtime.gopark(0xc00008c800?, 0xc00014c028?, 0xd2?, 0x60?, 0xc00009ca20?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00009c9a0 sp=0xc00009c980 pc=0x43ae56
runtime.chanrecv(0xc0001281c0, 0xc00009ca9f, 0x1)
	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc00009ca30 sp=0xc00009c9a0 pc=0x40825d
runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc00009ca58 sp=0xc00009ca30 pc=0x407d98
testing.(*T).Run(0xc000102340, {0x7425f6?, 0x4ebf55?}, 0xc0001100f0)
	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc00009cb18 sp=0xc00009ca58 pc=0x4ef3a5
github.com/tetratelabs/wazero/internal/integration_test/filecache.testListeners(0xc000102340, {0xbc2ea0?, 0xc0000b4940})
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:125 +0x437 fp=0xc00009cf48 sp=0xc00009cb18 pc=0x6aeab7
github.com/tetratelabs/wazero/internal/integration_test/filecache.runAllFileCacheTests.func2(0xc0000b6480?)
	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:46 +0x25 fp=0xc00009cf70 sp=0xc00009cf48 pc=0x6adde5
testing.tRunner(0xc000102340, 0xc0001300d8)
	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc00009cfc0 sp=0xc00009cf70 pc=0x4ee4eb
testing.(*T).Run.func1()
	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc00009cfe0 sp=0xc00009cfc0 pc=0x4ef52a
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00009cfe8 sp=0xc00009cfe0 pc=0x46ce01
created by testing.(*T).Run
	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

goroutine 20 [GC worker (idle)]:
runtime.gopark(0xc00008a760?, 0x488997?, 0xb0?, 0xa7?, 0x4ee4eb?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00008a750 sp=0xc00008a730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00008a7e0 sp=0xc00008a750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00008a7e8 sp=0xc00008a7e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 9 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00008af50 sp=0xc00008af30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00008afe0 sp=0xc00008af50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00008afe8 sp=0xc00008afe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 34 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000084750 sp=0xc000084730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000847e0 sp=0xc000084750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000847e8 sp=0xc0000847e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 21 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000504750 sp=0xc000504730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005047e0 sp=0xc000504750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005047e8 sp=0xc0005047e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 22 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000504f50 sp=0xc000504f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000504fe0 sp=0xc000504f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000504fe8 sp=0xc000504fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 23 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000505750 sp=0xc000505730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005057e0 sp=0xc000505750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005057e8 sp=0xc0005057e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 24 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000505f50 sp=0xc000505f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000505fe0 sp=0xc000505f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000505fe8 sp=0xc000505fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 25 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000506750 sp=0xc000506730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005067e0 sp=0xc000506750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005067e8 sp=0xc0005067e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 10 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00008b750 sp=0xc00008b730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00008b7e0 sp=0xc00008b750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00008b7e8 sp=0xc00008b7e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 26 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000506f50 sp=0xc000506f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000506fe0 sp=0xc000506f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000506fe8 sp=0xc000506fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 11 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00008bf50 sp=0xc00008bf30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00008bfe0 sp=0xc00008bf50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00008bfe8 sp=0xc00008bfe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 12 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000500750 sp=0xc000500730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005007e0 sp=0xc000500750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005007e8 sp=0xc0005007e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 13 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000500f50 sp=0xc000500f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000500fe0 sp=0xc000500f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000500fe8 sp=0xc000500fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 35 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000084f50 sp=0xc000084f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000084fe0 sp=0xc000084f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000084fe8 sp=0xc000084fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 27 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000507750 sp=0xc000507730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005077e0 sp=0xc000507750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005077e8 sp=0xc0005077e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 36 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000085750 sp=0xc000085730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000857e0 sp=0xc000085750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000857e8 sp=0xc0000857e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 28 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000507f50 sp=0xc000507f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000507fe0 sp=0xc000507f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000507fe8 sp=0xc000507fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 29 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050c750 sp=0xc00050c730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050c7e0 sp=0xc00050c750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050c7e8 sp=0xc00050c7e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 14 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000501750 sp=0xc000501730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005017e0 sp=0xc000501750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005017e8 sp=0xc0005017e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 30 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050cf50 sp=0xc00050cf30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050cfe0 sp=0xc00050cf50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050cfe8 sp=0xc00050cfe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 37 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000085f50 sp=0xc000085f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000085fe0 sp=0xc000085f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000085fe8 sp=0xc000085fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 31 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050d750 sp=0xc00050d730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050d7e0 sp=0xc00050d750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050d7e8 sp=0xc00050d7e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 38 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000086750 sp=0xc000086730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000867e0 sp=0xc000086750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000867e8 sp=0xc0000867e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 39 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000086f50 sp=0xc000086f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000086fe0 sp=0xc000086f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000086fe8 sp=0xc000086fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 32 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050df50 sp=0xc00050df30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050dfe0 sp=0xc00050df50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050dfe8 sp=0xc00050dfe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 40 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000087750 sp=0xc000087730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000877e0 sp=0xc000087750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000877e8 sp=0xc0000877e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 33 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050e750 sp=0xc00050e730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050e7e0 sp=0xc00050e750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050e7e8 sp=0xc00050e7e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 15 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000501f50 sp=0xc000501f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000501fe0 sp=0xc000501f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000501fe8 sp=0xc000501fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 50 [GC worker (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000508750 sp=0xc000508730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005087e0 sp=0xc000508750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005087e8 sp=0xc0005087e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 51 [GC worker (idle)]:
runtime.gopark(0xde46e0?, 0x1?, 0x7a?, 0x3?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000508f50 sp=0xc000508f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000508fe0 sp=0xc000508f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000508fe8 sp=0xc000508fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 52 [GC worker (idle)]:
runtime.gopark(0xde46e0?, 0x1?, 0x2e?, 0x2c?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000509750 sp=0xc000509730 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005097e0 sp=0xc000509750 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005097e8 sp=0xc0005097e0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

goroutine 53 [GC worker (idle)]:
runtime.gopark(0x504d5d4168d?, 0x0?, 0x0?, 0x0?, 0x0?)
	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000509f50 sp=0xc000509f30 pc=0x43ae56
runtime.gcBgMarkWorker()
	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000509fe0 sp=0xc000509f50 pc=0x41c5b1
runtime.goexit()
	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000509fe8 sp=0xc000509fe0 pc=0x46ce01
created by runtime.gcBgMarkStartWorkers
	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25
FAIL	github.com/tetratelabs/wazero/internal/integration_test/filecache	5.349s
FAIL
[evacchi@fedora wazero]$
trace for wazevo
[evacchi@fedora wazero]$ go test ./internal/integration_test/filecache/... -run TestFileCache_wazevo
--- FAIL: TestFileCache_wazevo (0.88s)
    --- FAIL: TestFileCache_wazevo/spectest (0.88s)
        require.go:331: expected no error, but was exit status 2: unexpected fault address 0x7f4f003b7000
            fatal error: fault
            [signal SIGSEGV: segmentation violation code=0x2 addr=0x7f4f003b7000 pc=0x7f4f003b7000]

            goroutine 18507 [running]:
            runtime.throw({0x7405a4?, 0x0?})
            	/usr/lib/golang/src/runtime/panic.go:1047 +0x5d fp=0xc000463f60 sp=0xc000463f30 pc=0x4380fd
            runtime: g 18507: unexpected return pc for runtime.sigpanic called from 0x7f4f003b7000
            stack: frame={sp:0xc000463f60, fp:0xc000463fc0} stack=[0xc0000ec000,0xc0000f0000)

            runtime.sigpanic()
            	/usr/lib/golang/src/runtime/signal_unix.go:855 +0x28a fp=0xc000463fc0 sp=0xc000463f60 pc=0x44f06a
            created by testing.(*T).Run
            	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

            goroutine 1 [chan receive]:
            runtime.gopark(0xdb5d80?, 0xc000120068?, 0x60?, 0xeb?, 0xc000167a28?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc0001679a8 sp=0xc000167988 pc=0x43ae56
            runtime.chanrecv(0xc000188070, 0xc000167aa7, 0x1)
            	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc000167a38 sp=0xc0001679a8 pc=0x40825d
            runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
            	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc000167a60 sp=0xc000167a38 pc=0x407d98
            testing.(*T).Run(0xc000102ea0, {0x748db7?, 0x4ee205?}, 0xb6f828)
            	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc000167b20 sp=0xc000167a60 pc=0x4ef3a5
            testing.runTests.func1(0xdb5d80?)
            	/usr/lib/golang/src/testing/testing.go:2036 +0x45 fp=0xc000167b70 sp=0xc000167b20 pc=0x4f1565
            testing.tRunner(0xc000102ea0, 0xc000167c88)
            	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc000167bc0 sp=0xc000167b70 pc=0x4ee4eb
            testing.runTests(0xc000136280?, {0xda25a0, 0x2, 0x2}, {0x0?, 0x100c000130648?, 0x0?})
            	/usr/lib/golang/src/testing/testing.go:2034 +0x489 fp=0xc000167cb8 sp=0xc000167bc0 pc=0x4f1449
            testing.(*M).Run(0xc000136280)
            	/usr/lib/golang/src/testing/testing.go:1906 +0x63a fp=0xc000167f00 sp=0xc000167cb8 pc=0x4efdba
            main.main()
            	_testmain.go:49 +0x1aa fp=0xc000167f80 sp=0xc000167f00 pc=0x6b070a
            runtime.main()
            	/usr/lib/golang/src/runtime/proc.go:250 +0x207 fp=0xc000167fe0 sp=0xc000167f80 pc=0x43aa27
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000167fe8 sp=0xc000167fe0 pc=0x46ce01

            goroutine 2 [force gc (idle)]:
            runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007afb0 sp=0xc00007af90 pc=0x43ae56
            runtime.goparkunlock(...)
            	/usr/lib/golang/src/runtime/proc.go:387
            runtime.forcegchelper()
            	/usr/lib/golang/src/runtime/proc.go:305 +0xb0 fp=0xc00007afe0 sp=0xc00007afb0 pc=0x43ac90
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007afe8 sp=0xc00007afe0 pc=0x46ce01
            created by runtime.init.6
            	/usr/lib/golang/src/runtime/proc.go:293 +0x25

            goroutine 3 [GC sweep wait]:
            runtime.gopark(0xdb5201?, 0x0?, 0x0?, 0x0?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007b780 sp=0xc00007b760 pc=0x43ae56
            runtime.goparkunlock(...)
            	/usr/lib/golang/src/runtime/proc.go:387
            runtime.bgsweep(0x0?)
            	/usr/lib/golang/src/runtime/mgcsweep.go:319 +0xde fp=0xc00007b7c8 sp=0xc00007b780 pc=0x4255de
            runtime.gcenable.func1()
            	/usr/lib/golang/src/runtime/mgc.go:178 +0x26 fp=0xc00007b7e0 sp=0xc00007b7c8 pc=0x41a846
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007b7e8 sp=0xc00007b7e0 pc=0x46ce01
            created by runtime.gcenable
            	/usr/lib/golang/src/runtime/mgc.go:178 +0x6b

            goroutine 4 [GC scavenge wait]:
            runtime.gopark(0x4e220d68275?, 0x4a66e?, 0x0?, 0x0?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007bf70 sp=0xc00007bf50 pc=0x43ae56
            runtime.goparkunlock(...)
            	/usr/lib/golang/src/runtime/proc.go:387
            runtime.(*scavengerState).park(0xdb5560)
            	/usr/lib/golang/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc00007bfa0 sp=0xc00007bf70 pc=0x4234b3
            runtime.bgscavenge(0x0?)
            	/usr/lib/golang/src/runtime/mgcscavenge.go:633 +0x65 fp=0xc00007bfc8 sp=0xc00007bfa0 pc=0x423aa5
            runtime.gcenable.func2()
            	/usr/lib/golang/src/runtime/mgc.go:179 +0x26 fp=0xc00007bfe0 sp=0xc00007bfc8 pc=0x41a7e6
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007bfe8 sp=0xc00007bfe0 pc=0x46ce01
            created by runtime.gcenable
            	/usr/lib/golang/src/runtime/mgc.go:179 +0xaa

            goroutine 18 [finalizer wait]:
            runtime.gopark(0x0?, 0xb6f760?, 0x70?, 0xe0?, 0x1000000010?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007a628 sp=0xc00007a608 pc=0x43ae56
            runtime.runfinq()
            	/usr/lib/golang/src/runtime/mfinal.go:193 +0x107 fp=0xc00007a7e0 sp=0xc00007a628 pc=0x419887
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007a7e8 sp=0xc00007a7e0 pc=0x46ce01
            created by runtime.createfing
            	/usr/lib/golang/src/runtime/mfinal.go:163 +0x45

            goroutine 19 [chan receive]:
            runtime.gopark(0xc00011eb68?, 0x0?, 0x61?, 0xeb?, 0xc000088e08?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000088d88 sp=0xc000088d68 pc=0x43ae56
            runtime.chanrecv(0xc0001880e0, 0xc000088e87, 0x1)
            	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc000088e18 sp=0xc000088d88 pc=0x40825d
            runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
            	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc000088e40 sp=0xc000088e18 pc=0x407d98
            testing.(*T).Run(0xc000103040, {0x7420a8?, 0x4ee3e0?}, 0xc00012c180)
            	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc000088f00 sp=0xc000088e40 pc=0x4ef3a5
            github.com/tetratelabs/wazero/internal/integration_test/filecache.runAllFileCacheTests(0x0?, {0xbc2ea0?, 0xc00015e8c0})
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:42 +0x86 fp=0xc000088f40 sp=0xc000088f00 pc=0x6adc66
            github.com/tetratelabs/wazero/internal/integration_test/filecache.TestFileCache_wazevo(0x0?)
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:38 +0x37 fp=0xc000088f70 sp=0xc000088f40 pc=0x6adbb7
            testing.tRunner(0xc000103040, 0xb6f828)
            	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc000088fc0 sp=0xc000088f70 pc=0x4ee4eb
            testing.(*T).Run.func1()
            	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc000088fe0 sp=0xc000088fc0 pc=0x4ef52a
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000088fe8 sp=0xc000088fe0 pc=0x46ce01
            created by testing.(*T).Run
            	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

            goroutine 20 [chan receive]:
            runtime.gopark(0xc00050f800?, 0xc0001205d8?, 0xc2?, 0x29?, 0xc000169b90?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000169b10 sp=0xc000169af0 pc=0x43ae56
            runtime.chanrecv(0xc0028f49a0, 0xc000169c0f, 0x1)
            	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc000169ba0 sp=0xc000169b10 pc=0x40825d
            runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
            	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc000169bc8 sp=0xc000169ba0 pc=0x407d98
            testing.(*T).Run(0xc000103380, {0xc002899082?, 0x0?}, 0xc00546cf60)
            	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc000169c88 sp=0xc000169bc8 pc=0x4ef3a5
            github.com/tetratelabs/wazero/internal/integration_test/spectest.RunCase(0x0?, {0x0?}, {0x748b60?, 0xc00015e940?}, {0xbc1970?, 0xc00011c010}, {0xbc2ea0?, 0xc00015e940}, 0xffffffffffffffff, 0x0, ...)
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/spectest/spectest.go:369 +0x2ec fp=0xc000169d40 sp=0xc000169c88 pc=0x6a0ccc
            github.com/tetratelabs/wazero/internal/integration_test/spectest.Run(0xc00015e900?, {0x4?}, {0xbc1970, 0xc00011c010}, {0xbc2ea0, 0xc00015e940})
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/spectest/spectest.go:346 +0x35a fp=0xc000169e28 sp=0xc000169d40 pc=0x6a095a
            github.com/tetratelabs/wazero/internal/integration_test/filecache.testSpecTestCompilerCache(0xc000103380, {0xbc2ea0, 0xc00015e8c0})
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:95 +0x1dc fp=0xc000169f48 sp=0xc000169e28 pc=0x6ae05c
            github.com/tetratelabs/wazero/internal/integration_test/filecache.runAllFileCacheTests.func1(0x0?)
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:43 +0x25 fp=0xc000169f70 sp=0xc000169f48 pc=0x6ade45
            testing.tRunner(0xc000103380, 0xc00012c180)
            	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc000169fc0 sp=0xc000169f70 pc=0x4ee4eb
            testing.(*T).Run.func1()
            	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc000169fe0 sp=0xc000169fc0 pc=0x4ef52a
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000169fe8 sp=0xc000169fe0 pc=0x46ce01
            created by testing.(*T).Run
            	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

            goroutine 96 [GC worker (idle)]:
            runtime.gopark(0xc000076760?, 0x488997?, 0xaa?, 0x38?, 0x4ee4eb?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000076750 sp=0xc000076730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000767e0 sp=0xc000076750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000767e8 sp=0xc0000767e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 5 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe299?, 0x1?, 0x1a?, 0x38?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007c750 sp=0xc00007c730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00007c7e0 sp=0xc00007c750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007c7e8 sp=0xc00007c7e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 98 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0x5e?, 0x42?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000492750 sp=0xc000492730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004927e0 sp=0xc000492750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004927e8 sp=0xc0004927e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 97 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x3?, 0x3a?, 0x5c?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000076f50 sp=0xc000076f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000076fe0 sp=0xc000076f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000076fe8 sp=0xc000076fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 99 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0x77?, 0x2e?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000492f50 sp=0xc000492f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000492fe0 sp=0xc000492f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000492fe8 sp=0xc000492fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 114 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe127?, 0x3?, 0x44?, 0x70?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000077750 sp=0xc000077730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000777e0 sp=0xc000077750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000777e8 sp=0xc0000777e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 115 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe55f?, 0x1?, 0x34?, 0x55?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000077f50 sp=0xc000077f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000077fe0 sp=0xc000077f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000077fe8 sp=0xc000077fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 116 [GC worker (idle)]:
            runtime.gopark(0x4e20ecff0db?, 0x3?, 0xc0?, 0x4b?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000078750 sp=0xc000078730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000787e0 sp=0xc000078750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000787e8 sp=0xc0000787e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 117 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe54b?, 0x3?, 0x86?, 0x83?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000078f50 sp=0xc000078f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000078fe0 sp=0xc000078f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000078fe8 sp=0xc000078fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 100 [GC worker (idle)]:
            runtime.gopark(0x4e220dd1b70?, 0x1?, 0x64?, 0xca?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000493750 sp=0xc000493730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004937e0 sp=0xc000493750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004937e8 sp=0xc0004937e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 101 [GC worker (idle)]:
            runtime.gopark(0x4e220e2ecc6?, 0x1?, 0xf2?, 0x60?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000493f50 sp=0xc000493f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000493fe0 sp=0xc000493f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000493fe8 sp=0xc000493fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 102 [GC worker (idle)]:
            runtime.gopark(0x4e20ecf828b?, 0x3?, 0xc4?, 0x43?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000494750 sp=0xc000494730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004947e0 sp=0xc000494750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004947e8 sp=0xc0004947e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 118 [GC worker (idle)]:
            runtime.gopark(0x4e20ecffb8f?, 0x1?, 0xe0?, 0x3d?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000079750 sp=0xc000079730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0000797e0 sp=0xc000079750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000797e8 sp=0xc0000797e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 6 [GC worker (idle)]:
            runtime.gopark(0x4e20e5f72f3?, 0x3?, 0x3c?, 0xa?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00007cf50 sp=0xc00007cf30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00007cfe0 sp=0xc00007cf50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00007cfe8 sp=0xc00007cfe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 103 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0xdc?, 0xb9?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000494f50 sp=0xc000494f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000494fe0 sp=0xc000494f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000494fe8 sp=0xc000494fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 119 [GC worker (idle)]:
            runtime.gopark(0x4e20ecff559?, 0x3?, 0x9c?, 0xee?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000079f50 sp=0xc000079f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000079fe0 sp=0xc000079f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000079fe8 sp=0xc000079fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 130 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0x50?, 0x63?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00048e750 sp=0xc00048e730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00048e7e0 sp=0xc00048e750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00048e7e8 sp=0xc00048e7e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 131 [GC worker (idle)]:
            runtime.gopark(0x4e20ecff5f9?, 0x3?, 0x8c?, 0x13?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00048ef50 sp=0xc00048ef30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00048efe0 sp=0xc00048ef50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00048efe8 sp=0xc00048efe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 104 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe091?, 0x3?, 0xe0?, 0x18?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000495750 sp=0xc000495730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004957e0 sp=0xc000495750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004957e8 sp=0xc0004957e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 120 [GC worker (idle)]:
            runtime.gopark(0x4e21f73944c?, 0x1?, 0xa0?, 0x91?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000584750 sp=0xc000584730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005847e0 sp=0xc000584750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005847e8 sp=0xc0005847e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 132 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0x16?, 0xed?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00048f750 sp=0xc00048f730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00048f7e0 sp=0xc00048f750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00048f7e8 sp=0xc00048f7e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 133 [GC worker (idle)]:
            runtime.gopark(0xc00003ab20?, 0xc0003c9c01?, 0xef?, 0xf5?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00048ff50 sp=0xc00048ff30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00048ffe0 sp=0xc00048ff50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00048ffe8 sp=0xc00048ffe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 134 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe07d?, 0x1?, 0x8e?, 0x56?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000490750 sp=0xc000490730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004907e0 sp=0xc000490750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004907e8 sp=0xc0004907e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 105 [GC worker (idle)]:
            runtime.gopark(0x4e20e5f9805?, 0x1?, 0x30?, 0x2c?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000495f50 sp=0xc000495f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000495fe0 sp=0xc000495f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000495fe8 sp=0xc000495fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 135 [GC worker (idle)]:
            runtime.gopark(0x4e20f9ffc77?, 0x1?, 0x8a?, 0xb?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000490f50 sp=0xc000490f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000490fe0 sp=0xc000490f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000490fe8 sp=0xc000490fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 106 [GC worker (idle)]:
            runtime.gopark(0x4e21eee2e3e?, 0x1?, 0xc6?, 0xdd?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000580750 sp=0xc000580730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0005807e0 sp=0xc000580750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005807e8 sp=0xc0005807e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 136 [GC worker (idle)]:
            runtime.gopark(0x4e20ecf826d?, 0x3?, 0x18?, 0x6f?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000491750 sp=0xc000491730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc0004917e0 sp=0xc000491750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004917e8 sp=0xc0004917e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 137 [GC worker (idle)]:
            runtime.gopark(0x4e20f5dd1e3?, 0x1?, 0x8?, 0xc5?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000491f50 sp=0xc000491f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000491fe0 sp=0xc000491f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000491fe8 sp=0xc000491fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 138 [GC worker (idle)]:
            runtime.gopark(0x4e20ecfe181?, 0x1?, 0xc5?, 0xae?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050a750 sp=0xc00050a730 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050a7e0 sp=0xc00050a750 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050a7e8 sp=0xc00050a7e0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 139 [GC worker (idle)]:
            runtime.gopark(0xde46e0?, 0x1?, 0x2c?, 0x5a?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc00050af50 sp=0xc00050af30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc00050afe0 sp=0xc00050af50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc00050afe8 sp=0xc00050afe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 107 [GC worker (idle)]:
            runtime.gopark(0x4e20f9ffb69?, 0x1?, 0x92?, 0x8?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000580f50 sp=0xc000580f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000580fe0 sp=0xc000580f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000580fe8 sp=0xc000580fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 121 [GC worker (idle)]:
            runtime.gopark(0x4e20e5f6e39?, 0x3?, 0x12?, 0x63?, 0x0?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000584f50 sp=0xc000584f30 pc=0x43ae56
            runtime.gcBgMarkWorker()
            	/usr/lib/golang/src/runtime/mgc.go:1275 +0xf1 fp=0xc000584fe0 sp=0xc000584f50 pc=0x41c5b1
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000584fe8 sp=0xc000584fe0 pc=0x46ce01
            created by runtime.gcBgMarkStartWorkers
            	/usr/lib/golang/src/runtime/mgc.go:1199 +0x25

            goroutine 18491 [chan receive]:
            runtime.gopark(0xc00050f800?, 0xc000120818?, 0xf3?, 0x35?, 0xc000165d30?)
            	/usr/lib/golang/src/runtime/proc.go:381 +0xd6 fp=0xc000165cb0 sp=0xc000165c90 pc=0x43ae56
            runtime.chanrecv(0xc0028f51f0, 0xc000165daf, 0x1)
            	/usr/lib/golang/src/runtime/chan.go:583 +0x49d fp=0xc000165d40 sp=0xc000165cb0 pc=0x40825d
            runtime.chanrecv1(0xdb5160?, 0x6d8d00?)
            	/usr/lib/golang/src/runtime/chan.go:442 +0x18 fp=0xc000165d68 sp=0xc000165d40 pc=0x407d98
            testing.(*T).Run(0xc0034c1380, {0xc0045801e0?, 0xc000165f08?}, 0xc000380bd0)
            	/usr/lib/golang/src/testing/testing.go:1630 +0x405 fp=0xc000165e28 sp=0xc000165d68 pc=0x4ef3a5
            github.com/tetratelabs/wazero/internal/integration_test/spectest.RunCase.func1(0xc0034c1380)
            	/home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/spectest/spectest.go:387 +0x50d fp=0xc000165f70 sp=0xc000165e28 pc=0x6a126d
            testing.tRunner(0xc0034c1380, 0xc00546cf60)
            	/usr/lib/golang/src/testing/testing.go:1576 +0x10b fp=0xc000165fc0 sp=0xc000165f70 pc=0x4ee4eb
            testing.(*T).Run.func1()
            	/usr/lib/golang/src/testing/testing.go:1629 +0x2a fp=0xc000165fe0 sp=0xc000165fc0 pc=0x4ef52a
            runtime.goexit()
            	/usr/lib/golang/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000165fe8 sp=0xc000165fe0 pc=0x46ce01
            created by testing.(*T).Run
            	/usr/lib/golang/src/testing/testing.go:1629 +0x3ea

            /home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:80
            /home/evacchi/Devel/github.com/tetratelabs/wazero/internal/integration_test/filecache/filecache_test.go:43

I think it might be worth hardening the file structure on disk adding a "trailer" after the body; i.e. the file structure would become (more or less):

HEADER | EXEC_HEADER | BODY | TRAILER

notice that wazevo data comes with a trailing "sourceMap" but this is skipped unless a specific flag in Fn_HEAD

the TRAILER might contain either a checksum of BODY or just a repetition of the LEN (found already in EXEC_HEADER). The second is cheaper because it's enough to check LEN against the LEN found in EXEC_HEADER, but it's a bit less safe.

(I am not implying this should be part of the PR, just reasoning out loud)

@achille-roussel
Copy link
Collaborator Author

Hardening of the file format sounds great to me, I would add the checksum even if it's more compute, the in-memory cache should amortize that cost quite effectively, something like CRC would probably be good enough?

That being said, this PR would still fix the problem as-is since it makes the insertion of files in the cache an atomic operation, so there is never a conditions where opening a file would cause the truncation of an existing one.

Copy link
Collaborator

@ncruces ncruces left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to add a checksum, Castagnoli has hardware support in hash/crc32.

But this PR should also fix the race, as long as no one corrupts the cache on purpose.

internal/filecache/file_cache.go Show resolved Hide resolved
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@mathetake mathetake merged commit f0a5b37 into main Feb 23, 2024
67 checks passed
@mathetake mathetake deleted the filecache-create-temp-files branch February 23, 2024 22:00
evacchi pushed a commit to evacchi/wazero that referenced this pull request Feb 28, 2024
Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants