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

Strange behavior with standalone executable using rust api #5670

Closed
negasora opened this issue Jun 27, 2024 · 2 comments
Closed

Strange behavior with standalone executable using rust api #5670

negasora opened this issue Jun 27, 2024 · 2 comments
Labels
Component: Rust API Issue needs changes to the Rust API Impact: Medium Issue is impactful with a bad, or no, workaround Type: Bug Issue is a non-crashing bug with repro steps
Milestone

Comments

@negasora
Copy link
Member

Version: 4.1.5594-dev commercial
API Revision: 015bb4fa79d01a1e2d4887cba96d150c7e1dd3bb

This code works fine:

use binaryninja::binaryview::BinaryViewExt;

fn main() {
    let headless_session = binaryninja::headless::Session::new();
    let bv = headless_session.load("/usr/bin/true").unwrap();
    for func in &bv.functions() {
        for basic_block in &func.basic_blocks() {
            for _ in basic_block.iter() {
                continue;
            }
        }
    }
}

This code fails to load the bv:

use binaryninja::binaryview::BinaryViewExt;

fn main() {
    let headless_session = binaryninja::headless::Session::new();
    let bv = headless_session.load("/usr/bin/true").unwrap();
    for func in &bv.functions() {
        for basic_block in &func.basic_blocks() {
            continue;
        }
    }
}

Note that the only change is the removal of the innermost loop

rust_test.zip

@negasora negasora added Type: Bug Issue is a non-crashing bug with repro steps Impact: Medium Issue is impactful with a bad, or no, workaround Component: Rust API Issue needs changes to the Rust API labels Jun 27, 2024
@rbran
Copy link
Contributor

rbran commented Jun 28, 2024

please try #5672

@negasora
Copy link
Member Author

That fixed it, ty!

@plafosse plafosse added this to the Elysium milestone Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Rust API Issue needs changes to the Rust API Impact: Medium Issue is impactful with a bad, or no, workaround Type: Bug Issue is a non-crashing bug with repro steps
Projects
None yet
Development

No branches or pull requests

3 participants