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

undefined symbol: sqlite3_unlock_notify - sqlx-macros rustc panic #119858

Closed
kpcyrd opened this issue Jan 11, 2024 · 6 comments
Closed

undefined symbol: sqlite3_unlock_notify - sqlx-macros rustc panic #119858

kpcyrd opened this issue Jan 11, 2024 · 6 comments
Labels
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.

Comments

@kpcyrd
Copy link

kpcyrd commented Jan 11, 2024

Code

I'm building this release: https://github.com/evilsocket/legba/releases/tag/v0.7.1

I'm likely providing an unexpected build environment (like something missing), but the compiler output asked me to file a github issue.

Meta

rustc --version --verbose:

rustc 1.75.0 (82e1608df 2023-12-21) (Arch Linux rust 1:1.75.0-1)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-unknown-linux-gnu
release: 1.75.0
LLVM version: 16.0.6

pacman -Si rust:

Repository      : extra
Name            : rust
Version         : 1:1.75.0-1
Description     : Systems programming language focused on safety, speed and concurrency
Architecture    : x86_64
URL             : https://www.rust-lang.org/
Licenses        : Apache  MIT
Groups          : None
Provides        : cargo  rustfmt
Depends On      : curl  gcc  gcc-libs  libssh2  llvm-libs
Optional Deps   : gdb: rust-gdb script
                  lldb: rust-lldb script
Conflicts With  : cargo  rust-docs<1:1.56.1-3  rustfmt
Replaces        : cargo  cargo-tree  rust-docs<1:1.56.1-3  rustfmt
Download Size   : 85.09 MiB
Installed Size  : 448.91 MiB
Packager        : Jan Alexander Steffens (heftig) <heftig@archlinux.org>
Build Date      : Mon Jan 1 00:38:01 2024
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Error output

error: /build/legba/src/legba-0.7.1/target/release/deps/libsqlx_macros-f07822758d67bddc.so: undefined symbol: sqlite3_unlock_notify
  --> /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-0.7.2/src/lib.rs:50:1
   |
50 | pub extern crate sqlx_macros;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved imports `self::encode::Encode`, `self::decode::Decode`, `super::Decode`, `super::Encode`, `super::FromRow`, `super::Type`
   --> /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-0.7.2/src/lib.rs:116:9
    |
116 | pub use self::encode::Encode;
    |         ^^^^^^^^^^^^^^^^^^^^
...
127 | pub use self::decode::Decode;
    |         ^^^^^^^^^^^^^^^^^^^^
...
141 |     pub use super::Decode;
    |             ^^^^^^^^^^^^^
142 |     pub use super::Encode;
    |             ^^^^^^^^^^^^^
143 |     pub use super::Executor;
144 |     pub use super::FromRow;
    |             ^^^^^^^^^^^^^^
...
148 |     pub use super::Type;
    |             ^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67:
internal error: entered unreachable code
stack backtrace:
   0:     0x7f56776bb3bc - std::backtrace_rs::backtrace::libunwind::trace::he0644f4189ae2429
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f56776bb3bc - std::backtrace_rs::backtrace::trace_unsynchronized::h9d17fc782d3b981a
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f56776bb3bc - std::sys_common::backtrace::_print_fmt::hb438557330fe04dd
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f56776bb3bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfbaa40019107bf73
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f567770c760 - core::fmt::rt::Argument::fmt::hb051b4144eaf7ba9
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/fmt/rt.rs:142:9
   5:     0x7f567770c760 - core::fmt::write::h09ae4ee704823005
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f56776af8bd - std::io::Write::write_fmt::h2f754c40a62d69e7
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/io/mod.rs:1762:15
   7:     0x7f56776bb1a5 - std::sys_common::backtrace::_print::h5aa33cefb716154f
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f56776bb1a5 - std::sys_common::backtrace::print::hba7db713d2ca6e46
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f56776bdf63 - std::panicking::default_hook::{{closure}}::hdecc168c96eda73a
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:272:22
  10:     0x7f56776bdc9a - std::panicking::default_hook::h094baec9e5d8cab2
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:292:9
  11:     0x7f56739bdf17 - <alloc[2ebc539667cfb7d0]::boxed::Box<rustc_driver_impl[99d10e0077520a4f]::install_ice_hook::{closure#0}> as core[1d99b162ade4f8d2]::ops::function::Fn<(&dyn for<'a, 'b> core[1d99b162ade4f8d2]::ops::function::Fn<(&'a core[1d99b162ade4f8d2]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[1d99b162ade4f8d2]::marker::Send + core[1d99b162ade4f8d2]::marker::Sync, &core[1d99b162ade4f8d2]::panic::panic_info::PanicInfo)>>::call
  12:     0x7f56776be6cd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h70e8c3aee457385c
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2021:9
  13:     0x7f56776be6cd - std::panicking::rust_panic_with_hook::h1d7664437b07c6b2
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:783:13
  14:     0x7f56776be409 - std::panicking::begin_panic_handler::{{closure}}::hcf3241a5a930cf68
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:649:13
  15:     0x7f56776bb876 - std::sys_common::backtrace::__rust_end_short_backtrace::h5bffafd462cab801
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f56776be1c2 - rust_begin_unwind
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:645:5
  17:     0x7f5677680785 - core::panicking::panic_fmt::h45860aff82e9ff99
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/panicking.rs:72:14
  18:     0x7f5677680823 - core::panicking::panic::h95d50b1afaf659d4
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/panicking.rs:127:5
  19:     0x7f567481713c - <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_rustdoc_path
  20:     0x7f56747c6e53 - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_and_cache_rustdoc_path
  21:     0x7f56747c7457 - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_doc_links
  22:     0x7f56747a751a - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_item
  23:     0x7f5674798c8a - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor as rustc_ast[c2fbdb20a65a2b40]::visit::Visitor>::visit_item
  24:     0x7f567480259a - <rustc_resolve[a4ae571806749b57]::Resolver>::late_resolve_crate
  25:     0x7f56748dd25b - <rustc_session[338748068244bd67]::session::Session>::time::<(), <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_crate::{closure#0}>
  26:     0x7f5674813b99 - <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_crate
  27:     0x7f5673af53f7 - rustc_interface[7100196beedd77ad]::passes::resolver_for_lowering
  28:     0x7f5674edbdaa - rustc_query_impl[d5f623712c5d47c3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7d569b8bcc5fa48]::query::erase::Erased<[u8; 8usize]>>
  29:     0x7f56750c63c8 - <rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::dynamic_query::{closure#2} as core[1d99b162ade4f8d2]::ops::function::FnOnce<(rustc_middle[7d569b8bcc5fa48]::ty::context::TyCtxt, ())>>::call_once
  30:     0x7f567510a392 - rustc_query_system[b4e4f242c7828ea]::query::plumbing::try_execute_query::<rustc_query_impl[d5f623712c5d47c3]::DynamicConfig<rustc_query_system[b4e4f242c7828ea]::query::caches::SingleCache<rustc_middle[7d569b8bcc5fa48]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d5f623712c5d47c3]::plumbing::QueryCtxt, false>
  31:     0x7f5674f6c02d - rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f5673949b19 - <rustc_middle[7d569b8bcc5fa48]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}::{closure#2}::{closure#4}, &rustc_data_structures[1e6501969dd79e50]::steal::Steal<(rustc_middle[7d569b8bcc5fa48]::ty::ResolverAstLowering, alloc[2ebc539667cfb7d0]::rc::Rc<rustc_ast[c2fbdb20a65a2b40]::ast::Crate>)>>
  33:     0x7f56739998dd - rustc_span[f1281179a8b441ea]::set_source_map::<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  34:     0x7f567397b068 - <scoped_tls[aad25e7167e4bf88]::ScopedKey<rustc_span[f1281179a8b441ea]::SessionGlobals>>::set::<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>
  35:     0x7f567399aa21 - rustc_span[f1281179a8b441ea]::create_session_globals_then::<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}>
  36:     0x7f56739bacd0 - std[a6029aee51c3cccb]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7100196beedd77ad]::util::run_in_thread_with_globals<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>
  37:     0x7f56739840cb - <<std[a6029aee51c3cccb]::thread::Builder>::spawn_unchecked_<rustc_interface[7100196beedd77ad]::util::run_in_thread_with_globals<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#1} as core[1d99b162ade4f8d2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f56776c84a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h875d340387e60f4c
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2007:9
  39:     0x7f56776c84a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2c9a0509e87a013
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2007:9
  40:     0x7f56776c84a5 - std::sys::unix::thread::Thread::new::thread_start::he50b920a2ab2d159
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f56730aa9eb - <unknown>
  42:     0x7f567312e7cc - <unknown>
  43:                0x0 - <unknown>

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.75.0 (82e1608df 2023-12-21) (Arch Linux rust 1:1.75.0-1) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C strip=symbols -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
For more information about this error, try `rustc --explain E0432`.
error: could not compile `sqlx` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Backtrace

   Compiling sqlx v0.7.2
error: /build/legba/src/legba-0.7.1/target/release/deps/libsqlx_macros-f07822758d67bddc.so: undefined symbol: sqlite3_unlock_notify
  --> /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-0.7.2/src/lib.rs:50:1
   |
50 | pub extern crate sqlx_macros;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved imports `self::encode::Encode`, `self::decode::Decode`, `super::Decode`, `super::Encode`, `super::FromRow`, `super::Type`
   --> /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sqlx-0.7.2/src/lib.rs:116:9
    |
116 | pub use self::encode::Encode;
    |         ^^^^^^^^^^^^^^^^^^^^
...
127 | pub use self::decode::Decode;
    |         ^^^^^^^^^^^^^^^^^^^^
...
141 |     pub use super::Decode;
    |             ^^^^^^^^^^^^^
142 |     pub use super::Encode;
    |             ^^^^^^^^^^^^^
143 |     pub use super::Executor;
144 |     pub use super::FromRow;
    |             ^^^^^^^^^^^^^^
...
148 |     pub use super::Type;
    |             ^^^^^^^^^^^

thread 'rustc' panicked at compiler/rustc_resolve/src/lib.rs:2006:67:
internal error: entered unreachable code
stack backtrace:
   0:     0x7f2c3c7503bc - std::backtrace_rs::backtrace::libunwind::trace::he0644f4189ae2429
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f2c3c7503bc - std::backtrace_rs::backtrace::trace_unsynchronized::h9d17fc782d3b981a
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f2c3c7503bc - std::sys_common::backtrace::_print_fmt::hb438557330fe04dd
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7f2c3c7503bc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hfbaa40019107bf73
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f2c3c7a1760 - core::fmt::rt::Argument::fmt::hb051b4144eaf7ba9
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/fmt/rt.rs:142:9
   5:     0x7f2c3c7a1760 - core::fmt::write::h09ae4ee704823005
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f2c3c7448bd - std::io::Write::write_fmt::h2f754c40a62d69e7
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/io/mod.rs:1762:15
   7:     0x7f2c3c7501a5 - std::sys_common::backtrace::_print::h5aa33cefb716154f
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f2c3c7501a5 - std::sys_common::backtrace::print::hba7db713d2ca6e46
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f2c3c752f63 - std::panicking::default_hook::{{closure}}::hdecc168c96eda73a
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:272:22
  10:     0x7f2c3c752c9a - std::panicking::default_hook::h094baec9e5d8cab2
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:292:9
  11:     0x7f2c3cfbdf17 - <alloc[2ebc539667cfb7d0]::boxed::Box<rustc_driver_impl[99d10e0077520a4f]::install_ice_hook::{closure#0}> as core[1d99b162ade4f8d2]::ops::function::Fn<(&dyn for<'a, 'b> core[1d99b162ade4f8d2]::ops::function::Fn<(&'a core[1d99b162ade4f8d2]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[1d99b162ade4f8d2]::marker::Send + core[1d99b162ade4f8d2]::marker::Sync, &core[1d99b162ade4f8d2]::panic::panic_info::PanicInfo)>>::call
  12:     0x7f2c3c7536cd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h70e8c3aee457385c
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2021:9
  13:     0x7f2c3c7536cd - std::panicking::rust_panic_with_hook::h1d7664437b07c6b2
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:783:13
  14:     0x7f2c3c753409 - std::panicking::begin_panic_handler::{{closure}}::hcf3241a5a930cf68
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:649:13
  15:     0x7f2c3c750876 - std::sys_common::backtrace::__rust_end_short_backtrace::h5bffafd462cab801
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7f2c3c7531c2 - rust_begin_unwind
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/panicking.rs:645:5
  17:     0x7f2c3c715785 - core::panicking::panic_fmt::h45860aff82e9ff99
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/panicking.rs:72:14
  18:     0x7f2c3c715823 - core::panicking::panic::h95d50b1afaf659d4
                               at /build/rust/src/rustc-1.75.0-src/library/core/src/panicking.rs:127:5
  19:     0x7f2c3de1713c - <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_rustdoc_path
  20:     0x7f2c3ddc6e53 - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_and_cache_rustdoc_path
  21:     0x7f2c3ddc7457 - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_doc_links
  22:     0x7f2c3dda751a - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor>::resolve_item
  23:     0x7f2c3dd98c8a - <rustc_resolve[a4ae571806749b57]::late::LateResolutionVisitor as rustc_ast[c2fbdb20a65a2b40]::visit::Visitor>::visit_item
  24:     0x7f2c3de0259a - <rustc_resolve[a4ae571806749b57]::Resolver>::late_resolve_crate
  25:     0x7f2c3dedd25b - <rustc_session[338748068244bd67]::session::Session>::time::<(), <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_crate::{closure#0}>
  26:     0x7f2c3de13b99 - <rustc_resolve[a4ae571806749b57]::Resolver>::resolve_crate
  27:     0x7f2c3d0f53f7 - rustc_interface[7100196beedd77ad]::passes::resolver_for_lowering
  28:     0x7f2c3e4dbdaa - rustc_query_impl[d5f623712c5d47c3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[7d569b8bcc5fa48]::query::erase::Erased<[u8; 8usize]>>
  29:     0x7f2c3e6c63c8 - <rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::dynamic_query::{closure#2} as core[1d99b162ade4f8d2]::ops::function::FnOnce<(rustc_middle[7d569b8bcc5fa48]::ty::context::TyCtxt, ())>>::call_once
  30:     0x7f2c3e70a392 - rustc_query_system[b4e4f242c7828ea]::query::plumbing::try_execute_query::<rustc_query_impl[d5f623712c5d47c3]::DynamicConfig<rustc_query_system[b4e4f242c7828ea]::query::caches::SingleCache<rustc_middle[7d569b8bcc5fa48]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[d5f623712c5d47c3]::plumbing::QueryCtxt, false>
  31:     0x7f2c3e56c02d - rustc_query_impl[d5f623712c5d47c3]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  32:     0x7f2c3cf49b19 - <rustc_middle[7d569b8bcc5fa48]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}::{closure#2}::{closure#4}, &rustc_data_structures[1e6501969dd79e50]::steal::Steal<(rustc_middle[7d569b8bcc5fa48]::ty::ResolverAstLowering, alloc[2ebc539667cfb7d0]::rc::Rc<rustc_ast[c2fbdb20a65a2b40]::ast::Crate>)>>
  33:     0x7f2c3cf998dd - rustc_span[f1281179a8b441ea]::set_source_map::<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  34:     0x7f2c3cf7b068 - <scoped_tls[aad25e7167e4bf88]::ScopedKey<rustc_span[f1281179a8b441ea]::SessionGlobals>>::set::<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>
  35:     0x7f2c3cf9aa21 - rustc_span[f1281179a8b441ea]::create_session_globals_then::<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}>
  36:     0x7f2c3cfbacd0 - std[a6029aee51c3cccb]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[7100196beedd77ad]::util::run_in_thread_with_globals<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>
  37:     0x7f2c3cf840cb - <<std[a6029aee51c3cccb]::thread::Builder>::spawn_unchecked_<rustc_interface[7100196beedd77ad]::util::run_in_thread_with_globals<rustc_interface[7100196beedd77ad]::interface::run_compiler<core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>, rustc_driver_impl[99d10e0077520a4f]::run_compiler::{closure#1}>::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1d99b162ade4f8d2]::result::Result<(), rustc_span[f1281179a8b441ea]::ErrorGuaranteed>>::{closure#1} as core[1d99b162ade4f8d2]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7f2c3c75d4a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h875d340387e60f4c
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2007:9
  39:     0x7f2c3c75d4a5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2c9a0509e87a013
                               at /build/rust/src/rustc-1.75.0-src/library/alloc/src/boxed.rs:2007:9
  40:     0x7f2c3c75d4a5 - std::sys::unix::thread::Thread::new::thread_start::he50b920a2ab2d159
                               at /build/rust/src/rustc-1.75.0-src/library/std/src/sys/unix/thread.rs:108:17
  41:     0x7f2c3c5849eb - <unknown>
  42:     0x7f2c3c6087cc - <unknown>
  43:                0x0 - <unknown>

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.75.0 (82e1608df 2023-12-21) (Arch Linux rust 1:1.75.0-1) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 -C strip=symbols -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack
For more information about this error, try `rustc --explain E0432`.
error: could not compile `sqlx` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...

@kpcyrd kpcyrd 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 Jan 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 11, 2024
@kpcyrd kpcyrd changed the title undefined symbol: sqlite3_unlock_notify - sqlx rustc panic undefined symbol: sqlite3_unlock_notify - sqlx-macros rustc panic Jan 11, 2024
@matthiaskrgr
Copy link
Member

stacktrace looks similar to #117920

@kpcyrd
Copy link
Author

kpcyrd commented Jan 11, 2024

It seems related to the CFLAGS environment variable:

-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/kube-linter/src=/usr/src/debug/kube-linter -flto=auto

Specifically this part for LTO:

-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto

@Noratrieb
Copy link
Member

Can you test whether this is fixed on the latest nightly? The panic location matched Matthias' issue exactly, so I'm inclined to believe that this issue is fixed already.

@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 11, 2024
@RAOF
Copy link

RAOF commented Jan 17, 2024

This is fixed on both beta and nightly. The code still doesn't compile, but rustc doesn't ICE.

@Noratrieb
Copy link
Member

Closing the issue then, as the ICE is fixed.

@kpcyrd
Copy link
Author

kpcyrd commented Jan 18, 2024

Cool, thanks everybody! :)

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. 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.
Projects
None yet
Development

No branches or pull requests

5 participants