Skip to content

stacktrace: Search through context for a valid location#5

Merged
bitwalker merged 1 commit into0xMiden:nextfrom
walnuthq:pr/fix-stacktrace
Dec 31, 2025
Merged

stacktrace: Search through context for a valid location#5
bitwalker merged 1 commit into0xMiden:nextfrom
walnuthq:pr/fix-stacktrace

Conversation

@djolertrk
Copy link
Collaborator

Before this PR, the test from 0xMiden/compiler#810 looks as:

Stack Trace:
 `-> root_ns:root@1.0.0::init in <unavailable>:

Last 5 Instructions (of current frame):
 |   drop
 |   eq
 |   not
 |   drop
 |   pad
 `-> <error occured here>


Last 5 Instructions (any frame):
 |   end
 |   split
 |   span
 |   drop
 |   pad
 `-> <error occured here>


Last Known State (at most recent instruction which succeeded):
 | Operand Stack: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
Error:   x Main thread panicked.
  |-> at tests/integration/src/rust_masm_tests/debug_source_locations.rs:70:18
  `->   × program execution failed at step 184 (cycle 183): assertion failed at clock cycle 183 with error code: 0

after this workaround, it is:

Stack Trace:
 `-> root_ns:root@1.0.0::init in /Users/djtodorovic/projects/crypto/MIDEN/compiler/tests/rust-apps-wasm/rust-sdk/assert-debug-test/src/lib.rs:26:13:

Last 5 Instructions (of current frame):
 |   drop
 |   eq
 |   not
 |   drop
 |   pad
 `-> <error occured here>


Last 5 Instructions (any frame):
 |   end
 |   split
 |   span
 |   drop
 |   pad
 `-> <error occured here>


Last Known State (at most recent instruction which succeeded):
 | Operand Stack: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 
Error:   x Main thread panicked.
  |-> at tests/integration/src/rust_masm_tests/debug_source_locations.rs:70:18
  `->   × program execution failed at step 184 (cycle 183): assertion failed at clock cycle 183 with error code: 0
          ╭─[/Users/djtodorovic/projects/crypto/MIDEN/compiler/tests/rust-apps-wasm/rust-sdk/assert-debug-test/src/lib.rs:26:13]
       25 │ pub fn entrypoint(x: u32) -> u32 {
       26 │     assert!(x > 100);
          ·             ▲
       27 │     x
          ╰────

@djolertrk
Copy link
Collaborator Author

cc @greenhat @bitwalker

@bitwalker
Copy link
Collaborator

@djolertrk If you sign your commit and force push, I'll get this merged

@bitwalker bitwalker merged commit c9010f3 into 0xMiden:next Dec 31, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants