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

segmentation fault - various diesel cli commands #2357

Closed
ankushagarwal opened this issue Apr 10, 2020 · 2 comments
Closed

segmentation fault - various diesel cli commands #2357

ankushagarwal opened this issue Apr 10, 2020 · 2 comments

Comments

@ankushagarwal
Copy link

Setup

diesel_cli installed using cargo install diesel_cli --no-default-features --features postgres

Versions

  • Rust: : 1.42.0
  • Diesel: : 1.4.0
  • Database: : Postgres 12
  • Operating System : macOS Catalina 10.15.3 (19D76)

Feature Flags

  • diesel: : cargo install diesel_cli --no-default-features --features postgres

Problem Description

I keep running into segmentation fault when running diesel commands. The exit code is 139.
It seems to happen in multiple diesel commands : diesel migration run, diesel database reset.

It happens arbitrarily ~30-40% of the time. Example: here it succeeds in 3rd attempt.

% diesel database reset
[1]    29679 segmentation fault  diesel database reset

% diesel database reset                                                                                                                                                
[1]    29735 segmentation fault  diesel database reset

% diesel database reset                                                                                                                                             
Dropping database: kush
Creating database: kush
Running migration 2020-04-10-030155_initial_setup

What are you trying to accomplish?

Manage migrations using diesel_cli

Steps to reproduce

Followed steps in http://diesel.rs/guides/getting-started/ and saw the above errors

@weiznich
Copy link
Member

weiznich commented Apr 10, 2020

I do not have access to any macos machine. That's not reproducible on linux or our CI so we need more information about how to reproduce this. Please include

  • The exact version of libpq and openssl you used
  • A debugger stack trace for one of the crashs

That said it could be that this is similar to #813, which would indicate some problem with the libpq version you used.

@ankushagarwal
Copy link
Author

Thanks @weiznich. I did some digging into which libpq library was being using by running DYLD_PRINT_LIBRARIES=yes diesel setup
This showed that I was using an outdated version of libpq on my mac.

I then explicitly linked against the latest version installed by homebrew by running DYLD_LIBRARY_PATH=/usr/local/opt/libpq/lib:/usr/local/opt/openssl@1.1/lib diesel - this uses the libpq and openssl libraries installed by homebrew.

This seemed to have fixed my problem.

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