Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

segfault during pkg_shutdown when using openssl legacy providers and pkg+https scheme #2191

Open
rcmcdonald91 opened this issue Oct 18, 2023 · 0 comments · May be fixed by #2192
Open

segfault during pkg_shutdown when using openssl legacy providers and pkg+https scheme #2191

rcmcdonald91 opened this issue Oct 18, 2023 · 0 comments · May be fixed by #2192

Comments

@rcmcdonald91
Copy link
Contributor

rcmcdonald91 commented Oct 18, 2023

edit: looks like an issue with openssl openssl/openssl#17312

edit2: this is actually an issue with curl curl/curl#12153

Enabling legacy providers in /etc/ssl/openssl.cnf and using pkg+https url scheme causes pkg to segfault during pkg_shutdown.

modify /etc/ssl/openssl.cnf to include:

   openssl_conf = openssl_init
   
   [openssl_init]
   providers = provider_sect
   
   [provider_sect]
   default = default_sect
   legacy = legacy_sect
   
   [default_sect]
   activate = 1
   
   [legacy_sect]
   activate = 1

and change the url scheme to use pkg+https in /etc/pkg/FreeBSD.conf

Core was generated by `pkg update'.
Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0  0x0000000828b9fc8a in ?? () from /lib/libthr.so.3
(gdb) bt
#0  0x0000000828b9fc8a in ?? () from /lib/libthr.so.3
#1  0x0000000823a24779 in CRYPTO_THREAD_read_lock () from /lib/libcrypto.so.30
#2  0x0000000823a1323c in ?? () from /lib/libcrypto.so.30
#3  0x0000000823a23376 in ?? () from /lib/libcrypto.so.30
#4  0x0000000823a12ed2 in OSSL_LIB_CTX_free () from /lib/libcrypto.so.30
#5  0x000000082b917646 in ?? () from /usr/lib/ossl-modules/legacy.so
#6  0x0000000823a2106d in ?? () from /lib/libcrypto.so.30
#7  0x0000000823b5c191 in EVP_CIPHER_free () from /lib/libcrypto.so.30
#8  0x0000000822a0f49a in SSL_CTX_free () from /usr/lib/libssl.so.30
#9  0x000000000051e66b in ossl_close (cf=0x2047a441f8a0, data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/vtls/openssl.c:1927
#10 0x000000000051a0e0 in cf_close (cf=0x2047a441f8a0, data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/vtls/vtls.c:1424
#11 0x00000000005186a8 in ssl_cf_close (cf=0x2047a441f8a0, data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/vtls/vtls.c:1496
#12 0x00000000004c1e93 in cf_setup_close (cf=0x2047a441f930, data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/connect.c:1299
#13 0x00000000004b7e7a in cf_hc_close (cf=0x2047a441f660, data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/cf-https-connect.c:435
#14 0x00000000004bdfcc in Curl_conn_close (data=0x2047a44a7000, index=0)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/cfilters.c:164
#15 0x0000000000508ab9 in conn_shutdown (data=0x2047a44a7000)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/url.c:697
#16 0x0000000000508a20 in Curl_disconnect (data=0x2047a44a7000, conn=0x2047a443d800, 
    dead_connection=false)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/url.c:809
#17 0x00000000004c0520 in Curl_conncache_close_all_connections (connc=0x2047a44292d0)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/conncache.c:533
#18 0x00000000004eafc2 in curl_multi_cleanup (multi=0x2047a44291c0)
    at /wrkdirs/usr/ports/ports-mgmt/pkg/work/pkg-1.20.8/external/curl/lib/multi.c:2826
#19 0x00000000005a7de8 in curl_cleanup (repo=0x2047a444e000) at fetch_libcurl.c:520
#20 0x000000000055e1b4 in pkg_repo_free (r=0x2047a444e000) at pkg_config.c:1490
#21 0x000000000055e08f in pkg_shutdown () at pkg_config.c:1506
#22 0x0000000829b4be6b in __cxa_finalize () from /lib/libc.so.7
#23 0x0000000829b4c391 in exit () from /lib/libc.so.7
#24 0x0000000829a7e761 in __libc_start1 () from /lib/libc.so.7
#25 0x00000000002d3320 in _start () at /usr/src/lib/csu/amd64/crt1_s.S:83
@rcmcdonald91 rcmcdonald91 changed the title segfault during pkg_shutdown when using legacy openssl providers and pkg+https scheme segfault during pkg_shutdown when using openssl legacy providers and pkg+https scheme Oct 19, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant