Skip to content

【1.45.2】 More error information is provided when the bottom-layer commands of the operating system fail to be invoked. #82388

Closed
@silence-coding

Description

@silence-coding

There is too little confidence in this mistake, why not return to errno. The mmap interface provides the errno, such as the ENOMEM and SIGSEGV interfaces.

/rust/src/libstd/sys/unix/stack_overflow.rs:150
panic!("failed to allocate an alternative stack")

Activity

added
A-diagnosticsArea: Messages for errors, warnings, and lints
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Feb 22, 2021
silence-coding

silence-coding commented on Feb 22, 2021

@silence-coding
Author

image

tesuji

tesuji commented on Feb 22, 2021

@tesuji
Contributor

Please try again your code latest nightly Rust version. Also could you paste the ICE backtrace?

@rustbot label E-needs-mcve I-ICE

added
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Feb 22, 2021
12101111

12101111 commented on Feb 22, 2021

@12101111
Contributor

@tesuji This is not a ICE
This issue propose printing errno on this panic:

unsafe fn get_stackp() -> *mut libc::c_void {
let stackp = mmap(
ptr::null_mut(),
SIGSTKSZ + page_size(),
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANON,
-1,
0,
);
if stackp == MAP_FAILED {
panic!("failed to allocate an alternative stack");
}

thomcc

thomcc commented on Feb 22, 2021

@thomcc
Member

Probably we want this then:

@rustbot label: -I-ICE, -T-compiler, +T-libs

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
and removed
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Feb 22, 2021
added
C-enhancementCategory: An issue proposing an enhancement or a PR with one.
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows
and removed
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
on Feb 22, 2021
added 2 commits that reference this issue on Mar 17, 2021

Rollup merge of rust-lang#83223 - JohnTitor:display-err-from-mmap, r=…

af9ed1d

Rollup merge of rust-lang#83223 - JohnTitor:display-err-from-mmap, r=…

0340045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @thomcc@jonas-schievink@12101111@tesuji@silence-coding

      Issue actions

        【1.45.2】 More error information is provided when the bottom-layer commands of the operating system fail to be invoked. · Issue #82388 · rust-lang/rust