Skip to content

Tokio | Actix compatability - Rust 1.7+ | default_features = true #96

Closed
@chriskyndrid

Description

@chriskyndrid

Using mimalloc with a rust version >= 1.7 in combination with Tokio and/or Actix will cause a:

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x80 but is 0x333ae056ae0', /home/admin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.29.0/src/runtime/task/core.rs:240:32

error to be thrown. This only happens in combination with rust version 1.7+ and Cargo.toml set as:

[dependencies.mimalloc]
version = "0.1"

Changing Cargo.toml to

[dependencies.mimalloc]
version = "0.1"
default-features = false

Is a functional workaround though obviously looses the beneficial security features. I have not setup a separate test project, so I cannot saw with 100% assurance some other component within my environment isn't impacting this, but a simple:

async fn main() -> SystemSyncResult<()> {
    use actix_web::App;
    use actix_web::HttpServer;

    let app = HttpServer::new(move || {
        App::new()
            .configure(api_config_all_v1)
    })
    .bind("127.0.01:8080")?;

    app.run().await?;

    log::info!("Shutdown complete");

    Ok(())
}

Should be sufficient to reproduce the issue. Disabling mimalloc or altering the default-features flag to false should resolve the problem.

I'm not sure what changed with the compiler in version 1.7, and/or in combination with libraries mentioned, that caused the problem to occur.

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