Skip to content

Regression in global_allocator when using prefer-dynamic on 1.71.0 and above #114518

Open
@alexkornitzer

Description

@alexkornitzer

Since 1.71.0 a regression has been added into the compiler causing segmentation faults in applications compiled using prefer-dynamic, this issue is not present in 1.70.0. It appears that the system allocator is still being used in some cases causing segmentation faults.

Code

https://github.com/alexkornitzer/dylib-errors/tree/error/jemalloc

use jemallocator::Jemalloc;

#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;

fn main() {
    let a = std::thread::spawn(move || {});
    a.join().unwrap();
    println!("didn''t crash");
}

Version it worked on

It most recently worked on: 1.70.0

Version with regression

1.71.0

Have run git bisect and the regression was introduced with the following commit: a2b1646

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Cprefer-dynamicCodegen option: Prefer dynamic linking to static linking.A-allocatorsArea: Custom and system allocatorsA-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions