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

segfault cargo-pgx #603

Closed
Guillaume444444 opened this issue Jun 28, 2022 · 8 comments
Closed

segfault cargo-pgx #603

Guillaume444444 opened this issue Jun 28, 2022 · 8 comments
Assignees

Comments

@Guillaume444444
Copy link

Hi,
I am trying to use pgx in order build an extension in rust. I am facing a core dumped while executing following command:

cargo pgx run pg12

I've also tried with pg14, it does the same.
I've made no modification at all on the hello world project generated by "cargo pgx new".
The stack is here: stack.74049.txt
Best regards,
Guillaume

@Hoverbear
Copy link
Contributor

What OS is this? What kernel version? (uname -a please)

@Hoverbear Hoverbear self-assigned this Jun 28, 2022
@Guillaume444444
Copy link
Author

linux rh7 3.10.0-1160.66.1.el7.x86_64

@Hoverbear
Copy link
Contributor

I assume that's like CentOS 7 and uses a super old GCC, you'll need to use GCC 7 or later. On CentOS you can do this:

yum install centos-release-scl
yum install devtoolset-7
scl enable devtoolset-7 bash

Maybe Red hat has similar.

@Guillaume444444
Copy link
Author

Yes, RH7 has same packages. I've already installed them and it crashes. The stack file does not help?

@Hoverbear
Copy link
Contributor

Hm, okay, looking at the stack:

[New LWP 74049]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/export/home/workingArea/gb01595/data/.cargo/bin/cargo-pgx pgx run pg13'.
Program terminated with signal 11, Segmentation fault.
#0  0x00005597e69acc16 in _$LT$hashbrown..raw..RawTable$LT$T$C$A$GT$$u20$as$u20$core..clone..Clone$GT$::clone::h73e571edcaf514ee ()

Thread 1 (Thread 0x7fdca4ca9c40 (LWP 74049)):
#0  0x00005597e69acc16 in _$LT$hashbrown..raw..RawTable$LT$T$C$A$GT$$u20$as$u20$core..clone..Clone$GT$::clone::h73e571edcaf514ee ()
#1  0x00005597e698d6bc in cargo_pgx::command::schema::generate_schema::ha31fb7f580368ceb ()
#2  0x00005597e695a08b in cargo_pgx::command::install::copy_sql_files::h016e40c289f78579 ()
#3  0x00005597e696527d in cargo_pgx::command::install::install_extension::hf0eb2ce2cdbe202e ()
#4  0x00005597e69c65dd in cargo_pgx::command::run::run::hb3e20086eb8111cd ()
#5  0x00005597e69c5cd5 in _$LT$cargo_pgx..command..run..Run$u20$as$u20$cargo_pgx..CommandExecute$GT$::execute::hb077d2c844be0b6c ()
#6  0x00005597e69b14d6 in _$LT$cargo_pgx..command..pgx..Pgx$u20$as$u20$cargo_pgx..CommandExecute$GT$::execute::h34a7e54dca68d84e ()
#7  0x00005597e69f8199 in cargo_pgx::main::h0ddc843fc76726d7 ()
#8  0x00005597e6936f53 in std::sys_common::backtrace::__rust_begin_short_backtrace::h37e8ec389473a5ee ()
#9  0x00005597e6968c0d in std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h7c70f351d1a5160b ()
#10 0x00005597e6e4a45e in call_once<(), (dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:259
#11 do_call<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panicking.rs:492
#12 try<i32, &(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe)> () at library/std/src/panicking.rs:456
#13 catch_unwind<&(dyn core::ops::function::Fn<(), Output=i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe), i32> () at library/std/src/panic.rs:137
#14 {closure#2} () at library/std/src/rt.rs:128
#15 do_call<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panicking.rs:492
#16 try<isize, std::rt::lang_start_internal::{closure_env#2}> () at library/std/src/panicking.rs:456
#17 catch_unwind<std::rt::lang_start_internal::{closure_env#2}, isize> () at library/std/src/panic.rs:137
#18 std::rt::lang_start_internal::h9c06694362b5b80c () at library/std/src/rt.rs:128
#19 0x00005597e6a03582 in main () at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/slice/mod.rs:620

This tells me you're segfaulting when it's generating the schema and looks nearly identical to #572, which should be fixed in #573, however we haven't cut that into a stable release yet. If you feel brave you can try 0.5.0-beta.0 (you need to directly specify this version in everything, as it's a beta. Eg cargo install cargo-pgx --version 0.5.0-beta.0.

@Hoverbear
Copy link
Contributor

Since this is a duplicate of #572 , I'm closing it.

@Guillaume444444
Copy link
Author

It works in version 0.5.0-beta.0.
Thank you.

@Hoverbear
Copy link
Contributor

Glad it's working! We should have a stable release out soon. I'm kinda waiting for #592 to land. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants