Skip to content

Abort from malloc on arm-unknown-linux-gnueabihf #72894

@jyn514

Description

@jyn514

I tried this code:

joshua@arm:~/libc $ rustc build.rs --crate-type bin -C opt-level=1
malloc(): invalid size (unsorted)
Aborted (core dumped)

I expected to see this happen: The crate compiles successfully.

Instead, this happened: rustc aborts.

This is build.rs for the libc crate on master: https://github.com/rust-lang/libc/blob/f10ee11f7043cb38fff02d9085b26009f2fc66aa/build.rs. The error goes away if I don't pass -C opt-level=1. It happens on a few different crates, maybe rustc is trying to allocate too much memory?

Meta

rustc --version --verbose:

rustc 1.43.1 (8d69840ab 2020-05-04)
binary: rustc
commit-hash: 8d69840ab92ea7f4d323420088dd8c9775f180cd
commit-date: 2020-05-04
host: arm-unknown-linux-gnueabihf
release: 1.43.1
LLVM version: 9.0

I can reproduce this issue at least as far back as 1.34.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.O-ArmTarget: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 stateT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Closable perchance

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions