rust
rust copied to clipboard
cargo build crash
Code
use env_file_reader::read_file;
use ormlite::model::*;
fn main() {
let env_variables = read_file(".env");
let mut db_conn = ormlite::postgres::PgConnection(&env_variables["DATABASE_URL"]).await.unwrap();
println!("Hello, world!");
}
Meta
rustc --version --verbose
:
<version>
Error output
3149: 0x7ffd3813393d - <unknown>
3150: 0x7ffd38093f27 - <unknown>
3151: 0x7ffd38101a15 - <unknown>
3152: 0x7ffd36edddb2 - <unknown>
3153: 0x7ffd3816e9f8 - <unknown>
3154: 0x7ffd38be60a9 - <unknown>
3155: 0x7ffd38be5c96 - <unknown>
3156: 0x7ffdffa6715b - ChangeTimerQueueTimer
3157: 0x7ffe02297c54 - RtlUserFiberStart
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.76.0 (07dca489a 2024-02-04) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
thread panicked while processing panic. aborting.
error: could not compile `rfidcontroller` (bin "rfidcontroller")
Backtrace
<backtrace>
`Caused by:
process didn't exit successfully: `rustc --crate-name rfidcontroller --edition=2021 src\main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=211 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=0af02bceaec6d635 --out-dir C:\Users\bstro\source\repos\rfidcontroller\target\debug\deps -C incremental=C:\Users\bstro\source\repos\rfidcontroller\target\debug\incremental -L dependency=C:\Users\bstro\source\repos\rfidcontroller\target\debug\deps --extern chrono=C:\Users\bstro\source\repos\rfidcontroller\target\debug\deps\libchrono-6298c5256a83f489.rlib --extern env_file_reader=C:\Users\bstro\source\repos\rfidcontroller\target\debug\deps\libenv_file_reader-697916ab711f75b4.rlib --extern ormlite=C:\Users\bstro\source\repos\rfidcontroller\target\debug\deps\libormlite-ba21f06120e8471e.rlib -L native=C:\Users\bstro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.4\lib -L native=C:\Users\bstro\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.48.5\lib -L native=C:\Users\bstro\source\repos\rfidcontroller\target\debug\build\ring-b41cbf2e56a7315d\out` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
Thank you for the report. Are you able to reproduce the issue after cargo clean
? Can you post the full error output, especially the start of the panic message? Additionally, have you tested that the issue persists on the latest nightly version?
I could not reproduce the issue on:
Rustc Version: 1.78.0-nightly (4a0cc881d 2024-03-11)
Binary: rustc
Commit Hash: 4a0cc881dcc4d800f10672747f61a94377ff6662
Commit Date: 2024-03-11
Host: x86_64-unknown-linux-gnu
Release: 1.78.0-nightly
LLVM Version: 18.1.0
Since Cargo.toml wasn't provided I assumed:
[dependencies]
env-file-reader = "0.3.0"
ormlite = { version = "0.18.0", features = ["postgres"] }
I also tried compiling it with and without .env
file, althought I don't think it matters in this context because it just errors out on compile time with following errors:
error[E0423]: expected function, tuple struct or tuple variant, found struct `ormlite::postgres::PgConnection`
error[E0728]: `await` is only allowed inside `async` functions and blocks
error[E0608]: cannot index into a value of type `Result<HashMap<std::string::String, std::string::String>, std::io::Error>`
Thank you for the report. Are you able to reproduce the issue after
cargo clean
? Can you post the full error output, especially the start of the panic message? Additionally, have you tested that the issue persists on the latest nightly version?
yes i was able to reproduce after cargo clean during compile it will eat up all RAM on my laptop(16gb) i also tested it on a desktop with 64GB of RAM and the same thing happend