Closed alwinc closed 11 months ago
Thanks for filling this bug report. As of now that reads pretty hard to reproduce, therefore I would like to ask if you can provide a reproducing example as docker image? Otherwise I fear that we cannot do much here
Yes I'll try and put together an image. Any suspicions as to what the cause might be at a high level? I notice it creates a Cstring and when it gets to the offending line 24, I get a segfault... *shrugs
As this kind of setup works for a lot of workload (including for example crates.io) I do not have any suspicions what might be wrong there (or if that's even an issue in diesel).
I had another look at your dependency list and noticed this line:
openssl = { version = "0.10.42", features = ["vendored"] }
This might be problematic, as diesel depends on libpq, which is linked dynamically. Libpq depends on openssl. If you now link a different openssl version statically that might result in such segfaults.
@weiznich Found something - It seems that upgrading Config to version 0.13.3 caused this error https://crates.io/crates/config/0.13.3. Not sure how - but I downgraded that crate to 0.10.1 refactored to use different config file format and it works fine.
Strange that this error pops up on Diesel end.
Can you try if the error goes away when you disable the "vendored" flag for openssl?
Can you try if the error goes away when you disable the "vendored" flag for openssl?
Yes did give that a go - as well as removed the entire dependency after realizing it was not required explicitly and it still causes SIGSEGV.
Hmm, that's interesting. It still would be interesting to have some minimal example of that crash.
Closed as we don't have a reproducing example for this issue.
I had another look at your dependency list and noticed this line:
openssl = { version = "0.10.42", features = ["vendored"] }
This might be problematic, as diesel depends on libpq, which is linked dynamically. Libpq depends on openssl. If you now link a different openssl version statically that might result in such segfaults.
It works when I remove the "vendored" features Or display the mem leak
Setup
Linux Ubuntu 20.04.6 LTS 64Bit
Versions
Feature Flags
Problem Description
When attempting to connect to postgres with connection pooling via r2d2 there appears to be a SIGSEGV fault
Diving further in it appears to crash at a segment of unsafe code src->pg->connection->raw line 24
I get returned
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
What are you trying to accomplish?
Establish a connection pool to postgres db via r2d2 on latest version of diesel and rust
What is the expected output?
Not a SIGSEGV
What is the actual output?
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
Are you seeing any additional errors?
Panics at this point
Steps to reproduce
Unsure if there are cargo conflicts causing this issue? Copy a copy of Cargo.toml
The full function
Checklist