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: Bad syscall_ptr #1614

Closed
1 task
enitrat opened this issue Jan 26, 2024 · 0 comments
Closed
1 task

bug: Bad syscall_ptr #1614

enitrat opened this issue Jan 26, 2024 · 0 comments
Assignees
Labels
bug Something isn't working snforge

Comments

@enitrat
Copy link
Contributor

enitrat commented Jan 26, 2024

Which component is your bug related to?

snforge

Foundry Version

0.14.0

What operating system are you using?

MacOS

What system architecture are you using?

arm

What happened

Bug Report

Cairo version:
2.4.4

Current behavior:
Running snforge test unit_tests on keep-starknet-strange/unruggable.meme#168 fails after introducing the unique_count function.

fn unique_count<T, +Copy<T>, +Drop<T>, +PartialEq<T>, +Into<T, felt252>>(mut self: Span<T>) -> u32 {
    let mut dict: Felt252Dict<felt252> = Default::default();
    let mut counter = 0;
    loop {
        match self.pop_front() {
            Option::Some(value) => {
                let value: felt252 = (*value).into();
                if dict.get(value).is_one() {
                    continue;
                }
                dict.insert(value, One::one());
                counter += 1;
            },
            Option::None => { break; }
        }
    };
    counter
}

This function is called here: keep-starknet-strange/unruggable.meme@3c9650d#diff-6efe688b97fc8a048f099b061edb855bc8e01aeaf909e9695614946336fe8a5aR412

interestingly, the unit test associated to this function doesn't fail.
keep-starknet-strange/unruggable.meme@3c9650d#diff-5eac007cd88b52b4d4889af203d613ca1aa11bdfdf555a9024599265b04735acR3

Trace

Failure data:
    Got an exception while executing a hint:
    Bad syscall_ptr; expected: Relocatable { segment_index: 10, offset: 0 }, got: Relocatable { segment_index: 12, offset: 0 }.

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.
@enitrat enitrat added the bug Something isn't working label Jan 26, 2024
@github-actions github-actions bot added the new label Jan 26, 2024
@Arcticae Arcticae removed the asap label Jan 29, 2024
@Arcticae Arcticae moved this from Triage to TODO in Starknet foundry Jan 29, 2024
@Arcticae Arcticae self-assigned this Jan 29, 2024
@Arcticae Arcticae moved this from TODO to In Progress in Starknet foundry Jan 29, 2024
@Arcticae Arcticae removed the new label Jan 29, 2024
Arcticae added a commit that referenced this issue Feb 2, 2024
<!-- Reference any GitHub issues resolved by this PR -->

Closes #1614 

## Introduced changes

<!-- A brief description of the changes -->

- Fixes inconsistency which is generated because of inconsistent syscall
pointer when syscall_arena builtin is allocated in the segments (done
only if it is required, on CASM generation level)

## Checklist

<!-- Make sure all of these are complete -->

- [x] Linked relevant issue
- [x] Updated relevant documentation
- [x] Added relevant tests
- [x] Performed self-review of the code
- [x] Added changes to `CHANGELOG.md`
@Arcticae Arcticae closed this as completed Feb 5, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Starknet foundry Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working snforge
Projects
Archived in project
Development

No branches or pull requests

3 participants