fat binary gem for Linux - #551
Conversation
f69a294 to
97fe9b0
Compare
49e89b9 to
fb30680
Compare
2b7e4fe to
daec80f
Compare
2877b2c to
f558d96
Compare
|
This PR currently fails with a segfault on my local machine when connecting by a TLS encrypted connection like so: $ valgrind ruby -rpg -e "PG.connect host:'localhost'"
==513704== Invalid write of size 8
==513704== at 0x2285E800: pgtls_close (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2285799F: pqsecure_close (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2283E7B2: pqDropConnection (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x228423E0: PQconnectPoll (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2277A7EE: ??? (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x4AC5FB7: rb_nogvl (thread.c:1530)
==513704== by 0x2277AD2D: gvl_PQconnectPoll (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x227833F5: ??? (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x4B18FC3: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3490)
==513704== by 0x4B1A3AA: vm_call_symbol (vm_insnhelper.c:3953)
==513704== by 0x4AFD436: vm_sendish (vm_insnhelper.c:5581)
==513704== by 0x4AFD436: vm_exec_core (insns.def:834)
==513704== by 0x4AF9CDC: rb_vm_exec (vm.c:2486)
==513704== Address 0x222d9f60 is 1,008 bytes inside a block of size 1,192 free'd
==513704== at 0x484810F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==513704== by 0x22A86323: CRYPTO_free (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x22A121B8: sock_free (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x22A05F2F: BIO_free (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x22A0791F: BIO_free_all (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2295A79D: ossl_ssl_connection_free (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2295A249: SSL_free (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2285E7FB: pgtls_close (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2285799F: pqsecure_close (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2283E7B2: pqDropConnection (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x228423E0: PQconnectPoll (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2277A7EE: ??? (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== Block was alloc'd at
==513704== at 0x4845828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==513704== by 0x228443E6: makeEmptyPGconn (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2283EE00: PQconnectStart (in /home/lars/comcard/ruby-pg/ports/x86_64-linux-gnu/lib/libpq.so.5.16)
==513704== by 0x2277A7CB: ??? (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x4AC5FB7: rb_nogvl (thread.c:1530)
==513704== by 0x2277ACD5: gvl_PQconnectStart (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x22780B76: ??? (in /home/lars/.rvm/gems/ruby-3.3.0/gems/pg-1.5.4-x86_64-linux-gnu/lib/3.3/pg_ext.so)
==513704== by 0x4B18FC3: vm_call_cfunc_with_frame_ (vm_insnhelper.c:3490)
==513704== by 0x4AFD436: vm_sendish (vm_insnhelper.c:5581)
==513704== by 0x4AFD436: vm_exec_core (insns.def:834)
==513704== by 0x4AF9CDC: rb_vm_exec (vm.c:2486)
==513704== by 0x4968A52: rb_ec_exec_node (eval.c:287)
==513704== by 0x4968A52: ruby_run_node (???:328)
==513704== by 0x109204: rb_main (main.c:39)
==513704== by 0x109204: main (main.c:58)
==513704== |
0f5bbe6 to
c77de0c
Compare
a5f44a9 to
7e422cc
Compare
26ba368 to
6a3e7aa
Compare
6a3e7aa to
e6ef67e
Compare
- Rename rake task 'gem:windows' to 'gem:native' - Add `rake gem:native:x86_64-linux` - Replace own PostgreSQL and OpenSSL build tasks by MiniPortile This is a more standard way and allows easier extensions. - Add krb5 library for Linux target to support GSSAPI/Kerberos - Change loading of pg_ext Try lib/pg_ext in addition to lib/3.2/pg_ext to support `rake spec` in the build directory - Fat binary linux gem: Try different UnixSocket paths of different distros. - CI: Adjust binary tests for new cross build target - Change patch directory to ports/patches/<package>/<version>/*.patch - ostruct gem is no longer necessary - Fix remaining "windows" references reg. fat binary gems
Fiddle will probably be removed from ruby stdlibs, so using a alternative approach seems necessary.
4b50d68 to
fe4962e
Compare
fe4962e to
54460a7
Compare
|
The OpenSSL issue above is resolved by #598. CI on Fedora and Alpine Linux is running and succeeds now. The implementation is like so:
The Providing a binary package adds the responsibility to update the gem in case of security updates to krb5, openssl or libpq. This was already the case for the Windows binary gems, but the new platform makes it more significant. There is one use case the binary gem doesn't support: Retrieval of connection options from LDAP. To support this So after more than one year I think this is ready to be merged. To make sure, the new platform and the source gem is fetched by bundler, it can be added like so to the Gemfile.lock and using a recent bundler version should do the trick. Or if this doesn't work for some reason, forcing the usage of the source gem in the Gemfile: Or installing the source gem manually: |
With the binary linux gem it's no longer necessary to install PostgreSQL client library or header files (like package
libpq-dev).Solves #480