Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory overflow when compiling #76276

Open
tronta opened this issue Sep 3, 2020 · 2 comments
Open

Memory overflow when compiling #76276

tronta opened this issue Sep 3, 2020 · 2 comments
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tronta
Copy link
Contributor

tronta commented Sep 3, 2020

When compiling this code the compiler starts using more and more memory trill it gets terminated by signal: 15, SIGTERM: termination signal
That's the best minimal code I could come up with...

Code

use actix_web::{web, App, HttpServer, Responder};
use mongodb::Client;

async fn get(
    client: web::Data<Client>,
) -> impl Responder {
        let _ = client
            .clone()
            .database("123")
            .collection("456")
            .find(None, None)
            .await;
    String::new()
}

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    let client = Client::with_uri_str(&"path").await.unwrap();

    // Start http server
    HttpServer::new(move || {
        //   let auth = HttpAuthentication::bearer(validator);

        App::new()
            .data(client.clone())
            .route("/", web::get().to(get))})
    .bind("127.0.0.1:8000")?
    .run()
    .await
}

reduced.zip

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (7e6d6e5f5 2020-08-16)
binary: rustc
commit-hash: 7e6d6e5f535321c2223f044caba16f97b825009c
commit-date: 2020-08-16
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 10.0

rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-unknown-linux-gnu
release: 1.46.0
LLVM version: 10.0

Error output

No special output.
Backtrace

no backtrace

@tronta tronta added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 3, 2020
@jonas-schievink jonas-schievink added I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Sep 3, 2020
@Skepfyr
Copy link
Contributor

Skepfyr commented Sep 5, 2020

This sounds a lot like #75808 and #75992

@audioXD
Copy link

audioXD commented Sep 27, 2020

I also have this problem.
Temp fix by downgrading to 1.45.0 using:

  • rustup install 1.45.0
  • rustup override set 1.45.0 (NOTE: run in project directory)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants