pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

panic on `cargo pgx install` symbol not found in flat namespace

Open olirice opened this issue 2 years ago • 1 comments

Sorry in advance for the lack of context beyond the trace, I'm not sure what to include. I'd be happy to provide any output that would help debug


cargo pgx install started consistently panic-ing with

    Finished dev [unoptimized + debuginfo] target(s) in 0.09s

installing extension
     Copying control file to /opt/homebrew/share/postgresql/extension/rs_graphql.control
     Copying shared library to /opt/homebrew/lib/postgresql/rs_graphql.so
 Discovering SQL entities
  Discovered 3 SQL entities: 0 schemas (0 unique), 1 functions, 0 types, 0 enums, 2 sqls, 0 ords, 0 hashes, 0 aggregates
The application panicked (crashed).
Message:  Couldn't libload /Users/oliverrice/Documents/rs_graphql/target/debug/librs_graphql.dylib: DlOpen { desc: "dlopen(/Users/oliverrice/Documents/rs_graphql/target/debug/librs_graphql.dylib, 0x0001): symbol not found in flat namespace \'__ZN5alloc5alloc8box_free17h09308ab863cbf011E\'" }
Location: /Users/oliverrice/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgx-0.4.5/src/command/schema.rs:372

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SPANTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

   0: cargo_pgx::command::schema::generate_schema with pg_version=14.14 release=false test=false path=/opt/homebrew/share/postgresql/extension/rs_graphql--0.4.0.sql features=[]
      at /Users/oliverrice/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgx-0.4.5/src/command/schema.rs:132
       130 │ }
       131 │ 
       132 > #[tracing::instrument(level = "error", skip_all, fields(
       133 │     pg_version = %pg_config.version()?,
       134 │     release = is_release,
   1: cargo_pgx::command::install::install_extension with pg_version=14.14 release=false test=false features=[]
      at /Users/oliverrice/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgx-0.4.5/src/command/install.rs:84
        82 │ }
        83 │ 
        84 > #[tracing::instrument(skip_all, fields(
        85 │     pg_version = %pg_config.version()?,
        86 │     release = is_release,
   2: cargo_pgx::command::install::execute
      at /Users/oliverrice/.cargo/registry/src/github.com-1ecc6299db9ec823/cargo-pgx-0.4.5/src/command/install.rs:51
        49 │ 
        50 │ impl CommandExecute for Install {
        51 >     #[tracing::instrument(level = "error", skip(self))]
        52 │     fn execute(self) -> eyre::Result<()> {
        53 │         let metadata = crate::metadata::metadata(&self.features, self.manifest_path.as_ref())

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 10 frames hidden ⋮                              
  11: core::result::Result<T,E>::expect::hc0cffb6ea55b83f2
      at <unknown source file>:<unknown line>
  12: cargo_pgx::command::schema::generate_schema::heacbd250b0e026ca
      at <unknown source file>:<unknown line>
  13: cargo_pgx::command::install::copy_sql_files::h07ca051ceae7c56e
      at <unknown source file>:<unknown line>
  14: <cargo_pgx::command::install::Install as cargo_pgx::CommandExecute>::execute::h16b18458f9150808
      at <unknown source file>:<unknown line>
  15: <cargo_pgx::command::pgx::Pgx as cargo_pgx::CommandExecute>::execute::h4eb073a9d3158437
      at <unknown source file>:<unknown line>
  16: cargo_pgx::main::h2a52a1060259b366
      at <unknown source file>:<unknown line>
  17: std::sys_common::backtrace::__rust_begin_short_backtrace::h15b171e1352528ba
      at <unknown source file>:<unknown line>
  18: std::rt::lang_start::{{closure}}::h4538d3059549a35b
      at <unknown source file>:<unknown line>
  19: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h3b331d3fbbcc71c7
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280
  20: std::panicking::try::do_call::hff616b6be7bbc015
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  21: std::panicking::try::h298ba2ba2d72fd07
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  22: std::panic::catch_unwind::h82d7a0ad94159423
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  23: std::rt::lang_start_internal::{{closure}}::h801a38d4a43d99be
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  24: std::panicking::try::do_call::h8ecac938bf293f4a
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  25: std::panicking::try::he8bacc15da046b2c
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  26: std::panic::catch_unwind::hfbee3bd78d2873c3
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  27: std::rt::lang_start_internal::hbbfe6e663b24763e
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  28: _main<unknown>
      at <unknown source file>:<unknown line>

but cargo pgx install --release succeeds without issue.

System:

  • cargo-pgx 0.4.5
  • rust 1.62.1
  • macOS 12.4 (M1)

Note:

  • I also opened https://github.com/tcdi/pgx/issues/610 so they might be related or symptoms of the same problem

olirice avatar Aug 12 '22 18:08 olirice

May have been solved by https://github.com/tcdi/pgx/pull/687

workingjubilee avatar Sep 17 '22 05:09 workingjubilee

Please try

pgx = "0.5.3"

in your Cargo.toml and confirm if this is fixed or still broken? You probably will also need to cargo install --locked cargo-pgx. Thank you!

workingjubilee avatar Oct 20 '22 02:10 workingjubilee

the error would show up intermittently but all seems to be working now, thanks!

I'll close this for now and re-open if it reappears

olirice avatar Oct 21 '22 19:10 olirice

I saw this the other day, but it went away and I haven't seen it since.

The error message implies it would be fixed by (or more easily identified after) #731.

thomcc avatar Oct 21 '22 20:10 thomcc