Skip to content

FailedToComputeOperands error when running cairo1-run #1852

@m-kus

Description

@m-kus

Describe the bug

I get Error: VirtualMachine(FailedToComputeOperands(("op1", Relocatable { segment_index: 0, offset: 5271 }))) when executing a Cairo1 program using cairo1-run.

To Reproduce
Steps to reproduce the behavior:

  1. Download attached lib.cairo file
  2. Link corelib (e.g. ln -s $HOME/Library/Caches/com.swmansion.scarb/registry/std/v2.8.2/core corelib)
  3. Run cairo1-run lib.cairo --layout recursive --args '[8 0 0 0 0 0 0 0 0 1718123181 4167220599 1821360523 2392821280 144118917 1860318131 2418694429 224340261]'
  4. See error

Expected behavior
The program should exit without errors (observed behavior with cairo-lang-runner)

What version/commit are you on?
3fb0344

Additional context
lib.cairo.txt

UPD
Minimal reproducible program (by @maciejka)

fn main() {
    let h: [u32; 1] = [1];
    let mut s = h.span();
    assert(s.pop_front().is_some(), '');
}

Error:

Error: VirtualMachine(FailedToComputeOperands(("op1", Relocatable { segment_index: 0, offset: 47 })))

On the most recent commit 159f67d I got another error:

thread 'main' panicked at cairo-lang-lowering-2.9.0-dev.0/src/optimizations/const_folding.rs:555:13:
`bounded_int_is_zero` not found in `core::internal::bounded_int`.

UPD2
That was mismatched corelib version, should be 2.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions