tool-conventions icon indicating copy to clipboard operation
tool-conventions copied to clipboard

Coredumps: Allow truncating locals and operand stack vecs when all values are optimized away

Open fitzgen opened this issue 2 years ago • 2 comments

In Wasmtime, we don't currently include locals or the operand stack in core dumps currently (although we intend to soon) and in fact have even lost all information about how many locals there were or the size of the operand stack. Therefore, we emit empty vecs for locals and the operand stack, rather than a vec of N missing values, because we don't even know N.

I think this is reasonable behavior for an optimizing compiler, but also something that we should probably explicitly document as acceptable so that coredump-consuming tools are given a heads up and consider this case.

I wanted to bounce this off folks before making a PR adding such language.

Thoughts?

cc @xtuc @dschuff @itsrainy

fitzgen avatar May 18 '23 18:05 fitzgen

I think it's acceptable to use an empty vector for missing/truncated locals, a debugger can refer to the source WebAssembly module for number/types of locals. Works with stack as well but has to be computed.

xtuc avatar May 18 '23 19:05 xtuc

Yeah, this makes sense to me too.

dschuff avatar May 18 '23 21:05 dschuff