Closed VictorKoenders closed 5 years ago
I'm not sure what other information to collect, so if something is missing feel free to ask
I don't think this is an issue in r2d2 itself, since it's entirely safe code. It might not even be a problem in the connection library wrapping libpq. Allocator corruption errors like these can be hard to track down since the action that corrupted the heap could have taken place far away from when you discovered the corruption.
I'd probably try to use tools to identify the corruption when it happens. One option is running the binary in Valgrind. Another could be to build the Rust code (and ideally the C code it links against) with address sanitizer.
I don't think it's an issue in r2d2 either, but I didn't know where else to post this issue.
For this specific case it worked to just put a Mutex around a PgConnection and that fixed the issue (just in time for the demo in 30 min!).
I'll try to reproduce it this weekend and see if I can find what exactly is going on.
Update: switching from debian 8 to ubuntu 14 fixes the issue. I guess it was something in the libpq-dev on debian
I'm using r2d2 in a (closed source) project for a customer, and it seems to try to incorrectly free a pointer.
stdout is:
*** Error in `/home/vincent/coolerbot/release/bot': free(): invalid pointer: 0x00007f1e2c076c60 ***
Debian 3.16.59-1 rustc 1.32.0 r2d2 .8.3 pg-sys 0.4.6 diesel 1.4.1
postgres:
r2d2 pool is created with:
gdb backtrace: