Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

[Bug] Add more bytecodes processed in translate_instruction #250

Closed
jcivlin opened this issue Jul 21, 2023 · 7 comments
Closed

[Bug] Add more bytecodes processed in translate_instruction #250

jcivlin opened this issue Jul 21, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@jcivlin
Copy link
Collaborator

jcivlin commented Jul 21, 2023

I enabled Solve compilation from .move source with resolution of libstd dependency (PR is coming), we passing the FE, which means all addresses (from use std::...) got resolved, but then we fail in translate_instruction (it is at the very end of function):


>  move-mv-llvm-compiler --compile /home/sol/work/git/move/language/move-stdlib/tests/ascii_tests.move  -L  -S --test -o /tmp/stdlib

thread 'main' panicked at 'not yet implemented: Prop(AttrId(7), Assert, 0x560f1a68ad00 : Call(NodeId(630), Le, [0x560f1a5c0500 : Temporary(NodeId(628), 1), 0x560f1a68aca0 : Temporary(NodeId(629), 2)]))', language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:1167:17 
stack backtrace:
   0: rust_begin_unwind
             at /build/rustc-v6rcRM/rustc-1.66.1+dfsg0ubuntu1~llvm/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /build/rustc-v6rcRM/rustc-1.66.1+dfsg0ubuntu1~llvm/library/core/src/panicking.rs:65:14
   2: move_mv_llvm_compiler::stackless::translate::FunctionContext::translate_instruction
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:1167:17
   3: move_mv_llvm_compiler::stackless::translate::FunctionContext::translate
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:982:13
   4: move_mv_llvm_compiler::stackless::translate::ModuleContext::translate
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:220:13
   5: move_mv_llvm_compiler::main
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/main.rs:247:13
   6: core::ops::function::FnOnce::call_once
             at /build/rustc-v6rcRM/rustc-1.66.1+dfsg0ubuntu1~llvm/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@jcivlin jcivlin added the bug Something isn't working label Jul 21, 2023
@nvjle
Copy link

nvjle commented Aug 22, 2023

Is this still a problem? If so, could you add a reproducing command line-- or better yet-- create a regression test that can be run through the harness? The above command line does not seem to match the current compiler's command line options.

@jcivlin
Copy link
Collaborator Author

jcivlin commented Aug 22, 2023

The short -L option was removed, but it fails the same way with --stdlib:

RUST_BACKTRACE=1 ~/work/git/move/target/debug/move-mv-llvm-compiler --compile /home/sol/work/git/move/language/move-stdlib/tests/ascii_tests.move  --stdlib  -S --test -o /tmp/stdlib
thread 'main' panicked at 'not yet implemented: Prop(AttrId(7), Assert, 0x55a3b200bb10 : Call(NodeId(630), Le, [0x55a3b21c7f50 : Temporary(NodeId(628), 1), 0x55a3b21c7fb0 : Temporary(NodeId(629), 2)]))', language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:494:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/panicking.rs:65:14
   2: move_mv_llvm_compiler::stackless::translate::FunctionContext::translate_instruction
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:494:17
   3: move_mv_llvm_compiler::stackless::translate::FunctionContext::translate
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/translate.rs:317:13
   4: move_mv_llvm_compiler::stackless::module_context::ModuleContext::translate
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/stackless/module_context.rs:62:13
   5: move_mv_llvm_compiler::main
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/main.rs:271:13
   6: core::ops::function::FnOnce::call_once
             at /rustc/69f9c33d71c871fc16ac445211281c6e7a340943/library/core/src/ops/function.rs:251:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@jcivlin
Copy link
Collaborator Author

jcivlin commented Aug 22, 2023

Script in #300 simplifies testing of byte codes created in bulk by the move compiler.
Especially it is convenient for testing compilation of the packages.

@jcivlin
Copy link
Collaborator Author

jcivlin commented Aug 30, 2023

[language/solana/move-to-solana/src/stackless/translate.rs:312] &instr = Prop(
    AttrId(
        7,
    ),
    Assert,
    0x55aaf7feb670 : Call(NodeId(630), Le, [0x55aaf7ff56d0 : Temporary(NodeId(628), 1), 0x55aaf7feb610 : Temporary(NodeId(629), 2)]),
)
thread 'main' panicked at 'not yet implemented: Prop(AttrId(7), Assert, 0x55aaf7feb670 : Call(NodeId(630), Le, [0x55aaf7ff56d0 : Temporary(NodeId(628), 1), 0x55aaf7feb610 : Temporary(NodeId(629), 2)]))', language/solana/move-to-solana/src/stackless/translate.rs:490:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: move_to_solana::stackless::translate::FunctionContext::translate_instruction
             at /home/sol/work/git/move/language/solana/move-to-solana/src/stackless/translate.rs:490:17
   3: move_to_solana::stackless::translate::FunctionContext::translate
             at /home/sol/work/git/move/language/solana/move-to-solana/src/stackless/translate.rs:313:13
   4: move_to_solana::stackless::module_context::ModuleContext::translate
             at /home/sol/work/git/move/language/solana/move-to-solana/src/stackless/module_context.rs:64:13
   5: move_mv_llvm_compiler::main
             at /home/sol/work/git/move/language/tools/move-mv-llvm-compiler/src/main.rs:243:13
   6: core::ops::function::FnOnce::call_once
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
(

@jcivlin
Copy link
Collaborator Author

jcivlin commented Aug 31, 2023

This is a small reproducer:

#[test_only]
module std::ascii_tests {
    use std::ascii;

    #[test]
    fun test_assert_ascii_chars() {
        let k = 0;
        // assert!(ascii::is_valid_char(k), 0);
    }
}

This test will fail on assert, compiler it with --test --stdlib options.

Prop bytecode, not supported in translate.rs is generated for assert.

@dmakarov
Copy link
Collaborator

dmakarov commented Sep 3, 2023

Not an issue when compiling with move-cli with Solana backend. See this comment #204 (comment)

@jcivlin
Copy link
Collaborator Author

jcivlin commented Sep 4, 2023

Confirming that this has been fixed by #316.
Closing.

Thx, Dmitri!

@jcivlin jcivlin closed this as completed Sep 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants