Open brmataptos opened 5 days ago
You can reproduce the test output along with useful information for debugging with
MVC_LOG=trace MVC_BACKTRACE=1 RUST_BACKTRACE=1 UB=1 cargo test --profile ci -p move-compiler -p move-compiler-v2 -p move-compiler-v2-transactional-tests -p move-compiler-transactional-tests -p aptos-transactional-test-harness >& test.out25
That produces a 583MB file, so don't load it in an editor. Load it in less
, and search (/
) first for Unused assignment
, showing something like:
ESC[0mESC[1mESC[38;5;11mwarningESC[0mESC[1m: Unused assignment to `to`. Consider removing or prefixing with an underscore: `_to`
Backtrace: Backtrace [
{ fn: "std::backtrace_rs::backtrace::libunwind::trace", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/libunwind.rs", line: 105 },
{ fn: "std::backtrace_rs::backtrace::trace_unsynchronized", file: "/rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/../../backtrace/src/backtrace/mod.rs", line: 66 },
Now, search backwards (?
) for object\.move:621
:
17: move_to<object::TombStone>($t9, $t11)
# at /Users/brm/code/aptos-core/aptos-move/framework/aptos-framework/sources/object.move:544:16+18
# live vars: $t6
18: $t12 := move($t6)
# at /Users/brm/code/aptos-core/aptos-move/framework/aptos-framework/sources/object.move:621:41+12
# live vars: $t12
19: $t14 := 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
# at /Users/brm/code/aptos-core/aptos-move/framework/aptos-framework/sources/object.move:544:16+18
# live vars: $t12, $t14
20: $t13 := move($t14)
# at /Users/brm/code/aptos-core/aptos-move/framework/aptos-framework/sources/object.move:545:27+37
# live vars: $t12
Note that $t12
is assigned and is live at instruction 18. Why is it being flagged as unused?
I've managed to reproduce the test failure with a slightly smaller test output:
MVC_LOG=trace MVC_BACKTRACE=1 RUST_BACKTRACE=1 UB=1 cargo test --profile ci -p aptos-transactional-test-harness v2-tests/smoke_test >& test.out26
This time it's only 210MB. Still too big for an editor.
I added a simpler test case in third_party/move/move-compiler-v2/tests/unused-assignment/object_test.move on branch https://github.com/aptos-labs/aptos-core/tree/brm-issue-13880. Enjoy.
๐ Bug
I've only seen these messages in some big runs, where V2 is used to pre-compile libraries for aptos-transactional-test-harness (for V2 tests).
The code currently looks like: