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

Unexpected error #400

Open
sonmarcho opened this issue Dec 18, 2024 · 4 comments
Open

Unexpected error #400

sonmarcho opened this issue Dec 18, 2024 · 4 comments

Comments

@sonmarcho
Copy link
Member

Reported by @ Cemoixerestre.
The following program triggers an "Unexpected" failure:

fn f(a: &mut i32, b: &mut i32, c: &mut i32, conds : &[bool]) {
    let mut y = &mut *a;
    let mut z = &mut *b;
    let mut i = 0;
    while i < conds.len() {
        if conds[i] {
            y = &mut *a;
            z = &mut *b;
        }
        else {
            y = &mut *b;
            z = &mut *c;
        }
        i += 1;
    }
    *y += 3;
    *a += 4;
    *z += 5;
}
@sonmarcho
Copy link
Member Author

sonmarcho commented Dec 18, 2024

Slightly minimized:

fn f(a: &mut i32, b: &mut i32, cond : bool) {
    let mut y = &mut *a;
    let mut i = 0;
    while i < 32 {
        if cond {
            y = &mut *a;
        }
        else {
            y = &mut *b;
        }
        i += 1;
    }
}

@Cemoixerestre
Copy link

I minimized this example even further:

fn main() {
    let mut a = 0;
    let mut b = 1;
    let mut y = &mut a;
    let mut i = 0;
    while i < 32 {
        y = &mut b;
        i += 1;
    }
}

The error message is not exactly the same, is it a distinct issue?

[Info ] Imported: counter_example_aeneas.llbc
[Error] Internal error, please file an issue
Source: 'src/main.rs', lines 6:4-9:5

@sonmarcho
Copy link
Member Author

Yes, it is probably a distinct issue... But I will clause this only once all the snippets above get accepted by the translation.

@sonmarcho
Copy link
Member Author

I investigated the issue: it stems from the fact that the implementation does not properly handle joins of loan values. It is a known issue (the same problem appears in this test, which is marked as known-failure). I've been wanting to tackle it for a while, but first I have to slightly modify the way region abstractions are handled by the synthesis (this is an engineering problem, not a fundamental issue).

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

No branches or pull requests

2 participants