Skip to content

Strange behavioral from 'std::env' when calling Rust program from C++ Program #88108

Open
@PooyaEimandar

Description

@PooyaEimandar

I port an application from C++ to RUST which is responsible to parse the input arguments and then do some actions.
I tried to call this RUST application from another C++ application via CreateProcess function.
But something strange happened, I think the lifetime of passing parameters in C++ affects on Rust program.
My rust program receives the arguments in C++ Debug mode successfully but it could not received same arguments in Release mode of C++.
I think std::env of Rust should work isolated from parent process, am I right?

Related issue #44650

rustc --version --verbose:

rustc 1.54.0 (a178d0322 2021-07-26)
binary: rustc
commit-hash: a178d0322ce20e33eac124758e837cbd80a6f633
commit-date: 2021-07-26
host: x86_64-pc-windows-msvc
release: 1.54.0
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-processArea: `std::process` and `std::env`C-bugCategory: This is a bug.S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions