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

[Bug] aptos move coverage source panics when used on features module in move-stdlib #14360

Closed
Rqnsom opened this issue Aug 21, 2024 · 3 comments · Fixed by #14449
Closed

[Bug] aptos move coverage source panics when used on features module in move-stdlib #14360

Rqnsom opened this issue Aug 21, 2024 · 3 comments · Fixed by #14449
Assignees
Labels
bug Something isn't working community compiler-v2

Comments

@Rqnsom
Copy link
Contributor

Rqnsom commented Aug 21, 2024

🐛 Bug

While doing some research at Eiger for the extension of the move-spec-test project, I found a problem in the aptos move coverage command.

To reproduce

Code snippet to reproduce

cd aptos-core/aptos-move/framework/move-stdlib;
aptos move test --coverage;
aptos move coverage source --module features;

Stack trace/error message

$ aptos move coverage source --module features
thread 'main' panicked at third_party/move/tools/move-coverage/src/source_coverage.rs:194:69:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Behavior

The command shouldn't have crashed; instead, a coverage report for the features module should have been printed out.

System information

  • Aptos Core Version
$ move-stdlib git:(main) ✗ aptos -V
aptos 4.0.0
  • Rust Version
$ move-stdlib git:(main) ✗ rustc -V
rustc 1.78.0 (9b00956e5 2024-04-29)
  • Computer OS
$ move-stdlib git:(main) ✗ uname -moprsv                                                                                                                                                                                                                                                                                                                git:(main↓10|…1
Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64 arm

Additional context

N/A

@Rqnsom Rqnsom added the bug Something isn't working label Aug 21, 2024
@brmataptos brmataptos self-assigned this Aug 22, 2024
@rahxephon89
Copy link
Contributor

Thanks for reporting this @Rqnsom. We will fix it soon.

@brmataptos
Copy link
Contributor

FYI: This is due to traces for cross-module inline code being wrongly mapped to corresponding lines in the using module.
Will first fix to disable this from happening, but add a flag to include the inline code coverage info (which will be more expensive to gather).

@wrwg
Copy link
Contributor

wrwg commented Aug 23, 2024

We know that coverage for inline functions is broken (#9154, #12919) but not that this crashes the tool. Perhaps for compiler v2, we can finally fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community compiler-v2
Projects
Status: Done
4 participants