Skip to content

C call Rust can not get arguments #118355

Closed
Closed
@Sword-Destiny

Description

@Sword-Destiny

I have a C program call Rust program by function execve("./rust_test", argv, env).
When I read argv in Rust main function by std::env::args(),

I get this message:

thread 'main' panicked at library/alloc/src/raw_vec.rs:534:5:
capacity overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

the target: cross compile aarch64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions