Closed 0xfoobar closed 3 years ago
Aha, thanks so much for reproducing this one! I'll take a look.
OK, I have verified that the problem exists, thanks for catching this! Will have to figure out what's going on here.
OK, put up a PR that should solve this!
Issue
You have no idea how long it took me to whittle this one down :) When you view variables in the Truffle debugger with the
v
command while inspecting a transaction, sometimes calldata arrays are corrupted. For example, I pass in an array of length 1 in web3js, but when viewed in the Truffle debugger, it is of length 324 with random bytes inserted throughout.This only occurs sometimes, and I noticed that if I stuck a breakpoint at the beginning of the function and inspected the variables, they were normal. It was only after entering & existing a nested scope that they became corrupted.
Steps to Reproduce
Now call this in web3js with something like
Then enter the debugger with
truffle debug $TXHASH
and enter a breakpoint within the function. Note the array corruption by enteringv
. Now remove the nested scope from the function and repeat. Note that the array now looks good.Example Corruption
Data should be 0, but is a large number instead.![Screen Shot 2021-05-19 at 10 32 55 PM](https://user-images.githubusercontent.com/83792390/118924788-6a4d9d80-b8f2-11eb-8322-668f70220b4e.png)