OpenSC / libp11

PKCS#11 wrapper library
GNU Lesser General Public License v2.1
310 stars 187 forks source link

Apps hang when pkcs11 engine is defined in openssl.cnf #294

Closed mouse07410 closed 2 years ago

mouse07410 commented 5 years ago

It is weird. MacOS 10.14.6, Xcode-10.3, OpenSSL-1.1.1c (Macports-installed), current master of libp11.

Symptoms: when PKCS#11 engine is defined, git hangs upon HTTPS retrieval. If I comment the engine out in openssl.cnf, or tell git to not load openssl.cnf - it works fine:

$ openssl version -d
OPENSSLDIR: "/opt/local/etc/openssl"
$ openssl version
OpenSSL 1.1.1c  28 May 2019
$ openssl engine -t pkcs11
(pkcs11) pkcs11 engine
     [ available ]
$ echo $OPENSSL_CONF
/opt/local/etc/openssl/openssl.cnf
$ git pull
^C   [hangs until killed]
$ OPENSSL_CONF=/dev/null git pull
Already up to date.
$ git pull
^C [hangs until killed]
$

Here's the openssl.cnf file with the middle cut off (to save space and make reading easier):

# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#

# Note that you can include other files from the main configuration
# file using the .include directive.
#.include filename

openssl_conf = openssl_init

# This definition stops the following lines choking if HOME isn't
# defined.
HOME            = .

# Extra OBJECT IDENTIFIER info:
#oid_file       = $ENV::HOME/.oid
oid_section     = new_oids
. . . . .
[openssl_init]

engines = engine_section

[engine_section]
pkcs11 = pkcs11_section
gost   = gost_section

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /opt/local/lib/engines-1.1/libpkcs11.so
MODULE_PATH  = /Library/OpenSC/lib/opensc-pkcs11.so
init = 0

[gost_section]
engine_id = gost
dynamic_path = /opt/local/lib/engines-1.1/gost.dylib
default_algorithms = ALL
CRYPT_PARAMS = id-Gost28147-89-CryptoPro-A-ParamSet
PBE_PARAMS = "gost12_512"

Note: commenting out "gost" engine had no effect. Commenting out "pkcs11" engine completely resolved this problem, but caused a different problem with an app that uses OpenSSL and libp11 to access smartcards.

Here's the hanging process snap, in case it can help figuring what's wrong:

Sampling process 31833 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling git-remote-https (pid 31833) every 1 millisecond
Process:         git-remote-https [31833]
Path:            /opt/local/libexec/*/git-remote-https
Load Address:    0x103bb3000
Identifier:      git-remote-https
Version:         0
Code Type:       X86-64
Parent Process:  git [31832]

Date/Time:       2019-07-23 18:28:11.777 -0400
Launch Time:     2019-07-23 18:27:35.376 -0400
OS Version:      Mac OS X 10.14.6 (18G84)
Report Version:  7
Analysis Tool:   /usr/bin/sample

Physical footprint:         1640K
Physical footprint (peak):  1648K
----

Call graph:
    2889 Thread_367826   DispatchQueue_1: com.apple.main-thread  (serial)
      2889 start  (in libdyld.dylib) + 1  [0x7fff707a53d5]
        2889 main  (in git-remote-https) + 131  [0x103bbd983]
          2889 cmd_main  (in git-remote-https) + 2241  [0x103bb4bc1]
            2889 discover_refs  (in git-remote-https) + 762  [0x103bb635a]
              2889 http_request_reauth  (in git-remote-https) + 34  [0x103bb9dd2]
                2889 http_request  (in git-remote-https) + 1225  [0x103bbc109]
                  2889 run_one_slot  (in git-remote-https) + 147  [0x103bb9c33]
                    2889 run_active_slot  (in git-remote-https) + 69  [0x103bb9875]
                      2889 step_active_slots  (in git-remote-https) + 31  [0x103bb977f]
                        2889 curl_multi_perform  (in libcurl.4.dylib) + 133  [0x103dbcfb1]
                          2889 multi_runsingle  (in libcurl.4.dylib) + 889  [0x103dbd430]
                            2889 Curl_http_connect  (in libcurl.4.dylib) + 365  [0x103da2742]
                              2889 https_connecting  (in libcurl.4.dylib) + 23  [0x103da2793]
                                2889 Curl_ssl_connect_nonblocking  (in libcurl.4.dylib) + 105  [0x103de24f0]
                                  2889 ossl_connect_common  (in libcurl.4.dylib) + 1829  [0x103dddfbe]
                                    2874 Curl_ossl_seed  (in libcurl.4.dylib) + 174  [0x103ddd75b]
                                    + 2873 Curl_wait_ms  (in libcurl.4.dylib) + 98  [0x103dc0c87]
                                    + ! 2873 __select  (in libsystem_kernel.dylib) + 10  [0x7fff708e161a]
                                    + 1 Curl_wait_ms  (in libcurl.4.dylib) + 36  [0x103dc0c49]
                                    +   1 Curl_now  (in libcurl.4.dylib) + 23  [0x103d9b90f]
                                    +     1 clock_gettime  (in libsystem_c.dylib) + 184  [0x7fff707f01b2]
                                    +       1 _mach_boottime_usec  (in libsystem_c.dylib) + 51  [0x7fff707f00cf]
                                    +         1 gettimeofday  (in libsystem_c.dylib) + 45  [0x7fff707fedcd]
                                    +           1 __commpage_gettimeofday_internal  (in libsystem_kernel.dylib) + 36  [0x7fff708db23c]
                                    +             1 mach_absolute_time  (in libsystem_kernel.dylib) + 26  [0x7fff708dac23]
                                    10 Curl_ossl_seed  (in libcurl.4.dylib) + 186,326  [0x103ddd767,0x103ddd7f3]
                                    3 Curl_ossl_seed  (in libcurl.4.dylib) + 215  [0x103ddd784]
                                    + 3 Curl_now  (in libcurl.4.dylib) + 23  [0x103d9b90f]
                                    +   3 clock_gettime  (in libsystem_c.dylib) + 184  [0x7fff707f01b2]
                                    +     2 _mach_boottime_usec  (in libsystem_c.dylib) + 22  [0x7fff707f00b2]
                                    +     ! 2 mach_boottime_usec  (in libsystem_kernel.dylib) + 0  [0x7fff708f27c8]
                                    +     1 DYLD-STUB$$mach_boottime_usec  (in libsystem_c.dylib) + 0  [0x7fff7086f59a]
                                    1 Curl_ossl_seed  (in libcurl.4.dylib) + 253  [0x103ddd7aa]
                                    + 1 Curl_now  (in libcurl.4.dylib) + 23  [0x103d9b90f]
                                    +   1 clock_gettime  (in libsystem_c.dylib) + 184  [0x7fff707f01b2]
                                    +     1 DYLD-STUB$$mach_boottime_usec  (in libsystem_c.dylib) + 0  [0x7fff7086f59a]
                                    1 Curl_ossl_seed  (in libcurl.4.dylib) + 339  [0x103ddd800]
                                      1 RAND_add  (in libcrypto.1.1.dylib) + 27  [0x10417e40f]
                                        1 RAND_get_rand_method  (in libcrypto.1.1.dylib) + 54  [0x10417e223]
                                          1 CRYPTO_THREAD_write_lock  (in libcrypto.1.1.dylib) + 9  [0x1041a9614]
                                            1 pthread_rwlock_wrlock  (in libsystem_pthread.dylib) + 0  [0x7fff70998e02]

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        __select  (in libsystem_kernel.dylib)        2873
        Curl_ossl_seed  (in libcurl.4.dylib)        10

Binary Images:
       0x103bb3000 -        0x103d20ff7 +git-remote-https (0) <8A09FC94-FA6E-33E1-9805-A3ABD1D9A327> /opt/local/libexec/*/git-remote-https
       0x103d98000 -        0x103dedff7 +libcurl.4.dylib (0) <55E295D3-2B43-3206-8B4C-A19C2E9C6173> /opt/local/lib/libcurl.4.dylib
       0x103e00000 -        0x103e19ff3 +libexpat.1.dylib (0) <F2AFF239-BA6D-303B-A582-35D2DE219A08> /opt/local/lib/libexpat.1.dylib
       0x103e21000 -        0x103e9aff7 +libpcre2-8.0.dylib (0) <A15BE11F-A0DA-30D9-9167-2F78B422AAB0> /opt/local/lib/libpcre2-8.0.dylib
       0x103ea5000 -        0x103eb5ffb +libz.1.dylib (0) <36B1ED83-DE21-3D70-875B-55C2E2DA1D8E> /opt/local/lib/libz.1.dylib
       0x103ebf000 -        0x103fb3ff3 +libiconv.2.dylib (0) <4C522CA5-5A0C-3028-96B5-824E03D7ABE7> /opt/local/lib/libiconv.2.dylib
       0x103fc4000 -        0x103fccff7 +libintl.8.dylib (0) <9FE2A5C0-399B-3E88-A1B0-45932549E276> /opt/local/lib/libintl.8.dylib
       0x103fd5000 -        0x103ff1ffb +libidn2.0.dylib (0) <59C3B8F6-155F-39BE-9E95-01AAA0268023> /opt/local/lib/libidn2.0.dylib
       0x103ff5000 -        0x104004ffb +libpsl.5.dylib (0) <BEDFAD7A-5533-34B2-BD74-B24844D10062> /opt/local/lib/libpsl.5.dylib
       0x104008000 -        0x104057ffb +libssl.1.1.dylib (0) <9DB54188-D6FE-3C25-8680-2B6A00A4C3F3> /opt/local/lib/libssl.1.1.dylib
       0x104085000 -        0x10421485f +libcrypto.1.1.dylib (0) <E1FEA4A3-EA04-330F-A1A7-D6DAD91F4E75> /opt/local/lib/libcrypto.1.1.dylib
       0x1042ab000 -        0x10440fff7 +libunistring.2.dylib (0) <44BE87F3-0068-3DC8-B886-178B748F1944> /opt/local/lib/libunistring.2.dylib
       0x104452000 -        0x10445eff3 +libpkcs11.so (0) <750BDB96-43CE-3BD1-8CC2-2F3822D8C9D2> /opt/local/lib/*/libpkcs11.so
       0x104466000 -        0x1044aeff3 +gost.dylib (0) <7DECD3AE-F748-35B4-9679-4AE7D7192A7C> /opt/local/lib/*/gost.dylib
       0x108743000 -        0x1087ad6ef  dyld (655.1.1) <D3E77331-ACE5-349D-A7CC-433D626D4A5B> /usr/lib/dyld
    0x7fff40bf8000 -     0x7fff40bf8fff  com.apple.Accelerate (1.11 - Accelerate 1.11) <762942CB-CFC9-3A0C-9645-A56523A06426> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
    0x7fff40c10000 -     0x7fff412a9fef  com.apple.vImage (8.1 - ???) <53FA3611-894E-3158-A654-FBD2F70998FE> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
    0x7fff412aa000 -     0x7fff41523ff3  libBLAS.dylib (1243.200.4) <417CA0FC-B6CB-3FB3-ACBC-8914E3F62D20> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
    0x7fff41524000 -     0x7fff41596ffb  libBNNS.dylib (38.250.1) <538D12A2-9B9D-3E22-9896-F90F6E69C06E> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
    0x7fff41597000 -     0x7fff41940ff3  libLAPACK.dylib (1243.200.4) <92175DF4-863A-3780-909A-A3E5C410F2E9> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
    0x7fff41941000 -     0x7fff41956feb  libLinearAlgebra.dylib (1243.200.4) <CB671EE6-DEA1-391C-9B2B-AA09A46B4D7A> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
    0x7fff41957000 -     0x7fff4195cff3  libQuadrature.dylib (3.200.2) <1BAE7E22-2862-379F-B334-A3756067730F> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
    0x7fff4195d000 -     0x7fff419d9ff3  libSparse.dylib (79.200.5) <E78B33D3-672A-3C53-B512-D3DDB2E9AC8D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
    0x7fff419da000 -     0x7fff419edfe3  libSparseBLAS.dylib (1243.200.4) <E9243341-DB77-37C1-97C5-3DFA00DD70FA> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
    0x7fff419ee000 -     0x7fff41bd5ff7  libvDSP.dylib (671.250.4) <7B110627-A9C1-3FB7-A077-0C7741BA25D8> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
    0x7fff41bd6000 -     0x7fff41c89ff7  libvMisc.dylib (671.250.4) <D5BA4812-BFFC-3CD0-B382-905CD8555DA6> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
    0x7fff41c8a000 -     0x7fff41c8afff  com.apple.Accelerate.vecLib (3.11 - vecLib 3.11) <74288115-EF61-30B6-843F-0593B31D4929> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
    0x7fff42c33000 -     0x7fff42c33fff  com.apple.ApplicationServices (50.1 - 50.1) <84097DEB-E2FC-3901-8DD7-A670EA2274E0> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
    0x7fff42c34000 -     0x7fff42c9ffff  com.apple.ApplicationServices.ATS (377 - 453.11.2.2) <A258DA73-114B-3102-A056-4AAAD3CEB9DD> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
    0x7fff42d38000 -     0x7fff42e4ffff  libFontParser.dylib (228.6.2.3) <3602D55B-3B9E-3B3A-A814-08C1244A8AE4> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
    0x7fff42e50000 -     0x7fff42e92fff  libFontRegistry.dylib (228.12.2.3) <2A56347B-2809-3407-A8B4-2AB88E484062> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
    0x7fff42f83000 -     0x7fff42f87ff3  com.apple.ColorSyncLegacy (4.13.0 - 1) <C0D9E23C-ABA0-39DE-A4EB-5A41C5499056> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy
    0x7fff43022000 -     0x7fff43074ff7  com.apple.HIServices (1.22 - 628) <2BE461FF-80B9-30D3-A574-AED5724B1C1B> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
    0x7fff43075000 -     0x7fff43084fff  com.apple.LangAnalysis (1.7.0 - 1.7.0) <F5617A2A-FEA6-3832-B5BA-C2111B98786F> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
    0x7fff43085000 -     0x7fff430ceff7  com.apple.print.framework.PrintCore (14.2 - 503.8) <57C2FE32-0E74-3079-B626-C2D52F2D2717> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
    0x7fff430cf000 -     0x7fff43108ff7  com.apple.QD (3.12 - 407.2) <28C7D39F-59C9-3314-BECC-67045487229C> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
    0x7fff43109000 -     0x7fff43115fff  com.apple.speech.synthesis.framework (8.1.3 - 8.1.3) <5E7B9BD4-122B-3012-A044-3259C97E7509> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
    0x7fff43116000 -     0x7fff4338dff7  com.apple.audio.toolbox.AudioToolbox (1.14 - 1.14) <04F482F1-E1C1-3955-8A6C-8AA152AA06F3> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
    0x7fff436e8000 -     0x7fff43a89fff  com.apple.CFNetwork (978.0.7 - 978.0.7) <B2133D0D-1399-3F17-80F0-313E3A241C89> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
    0x7fff43fae000 -     0x7fff440fdff7  com.apple.ColorSync (4.13.0 - 3345.6) <31648BB6-7239-3D0E-81B1-BCF51FEF557F> /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync
    0x7fff44289000 -     0x7fff4430ffff  com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <1E8E64E6-0E58-375A-97F7-07CB4EE181AC> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
    0x7fff4439e000 -     0x7fff44723fef  com.apple.CoreData (120 - 866.6) <132CB39B-8D58-30FA-B8AD-49BFFF34B293> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
    0x7fff44724000 -     0x7fff44814ff7  com.apple.CoreDisplay (101.3 - 110.18) <0EB2A997-FCAD-3D17-B140-9829961E5327> /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
    0x7fff44815000 -     0x7fff44c59fe7  com.apple.CoreFoundation (6.9 - 1575.17) <EE7948FC-FDA8-3F95-A1E0-69FAED5D81AA> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff44c5b000 -     0x7fff452eafff  com.apple.CoreGraphics (2.0 - 1265.9) <BC95B558-EF77-3A57-A0BC-11606C778991> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
    0x7fff452ec000 -     0x7fff4560cfff  com.apple.CoreImage (14.4.0 - 750.0.140) <11026E39-D2FF-3CF6-8ACE-7BA293F9853E> /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
    0x7fff45a6a000 -     0x7fff45a6afff  com.apple.CoreServices (946 - 946) <455AB7C9-ECB1-3B5C-8D07-AC68810A90B1> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    0x7fff45a6b000 -     0x7fff45ae7ff7  com.apple.AE (773 - 773) <55AE7C9E-27C3-30E9-A047-3B92A6FD53B4> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
    0x7fff45ae8000 -     0x7fff45dbffff  com.apple.CoreServices.CarbonCore (1178.33 - 1178.33) <CB87F0C7-2CD6-3983-8E32-B6A2EC925352> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
    0x7fff45dc0000 -     0x7fff45e08ff7  com.apple.DictionaryServices (1.2 - 284.16.4) <746EB200-DC51-30AE-9CBC-608A7B4CC8DA> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
    0x7fff45e09000 -     0x7fff45e11ffb  com.apple.CoreServices.FSEvents (1239.200.12 - 1239.200.12) <8406D379-8D33-3611-861B-7ABD26DB50D2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
    0x7fff45e12000 -     0x7fff45fc3ff7  com.apple.LaunchServices (946 - 946) <A0C91634-9410-38E8-BC11-7A5A369E6BA5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
    0x7fff45fc4000 -     0x7fff46062ff7  com.apple.Metadata (10.7.0 - 1191.57) <BFFAED00-2560-318A-BB8F-4E7E5123EC61> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
    0x7fff46063000 -     0x7fff460adff7  com.apple.CoreServices.OSServices (946 - 946) <20C4EEF8-D5AC-39A0-9B4A-78F88E3EFBCC> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
    0x7fff460ae000 -     0x7fff46115ff7  com.apple.SearchKit (1.4.0 - 1.4.0) <DA08AA6F-A6F1-36C0-87F4-E26294E51A3A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
    0x7fff46116000 -     0x7fff46137ff3  com.apple.coreservices.SharedFileList (71.28 - 71.28) <487A8464-729E-305A-B5D1-E3FE8EB9CFC5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
    0x7fff46442000 -     0x7fff465a4ff3  com.apple.CoreText (352.0 - 584.26.3.2) <59919B0C-CBD5-3877-8D6F-D6048F1E5F42> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
    0x7fff465a5000 -     0x7fff465e5ff3  com.apple.CoreVideo (1.8 - 281.4) <10CF8E52-07E3-382B-8091-2CEEEFFA69B4> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
    0x7fff468cc000 -     0x7fff468d1ffb  com.apple.DiskArbitration (2.7 - 2.7) <F481F2C0-884E-3265-8111-ABBEC93F0920> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
    0x7fff46a97000 -     0x7fff46e44fff  com.apple.Foundation (6.9 - 1575.17) <20150BA3-74D6-3991-AD22-52735FAD0E24> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    0x7fff46eb3000 -     0x7fff46ee2ffb  com.apple.GSS (4.0 - 2.0) <E2B90D08-3857-3155-9FCC-07D778988EC9> /System/Library/Frameworks/GSS.framework/Versions/A/GSS
    0x7fff4714f000 -     0x7fff471defff  com.apple.framework.IOKit (2.0.2 - 1483.260.4) <8A90F547-86EF-3DFB-92FE-0E2C0376DD84> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    0x7fff471e0000 -     0x7fff471efffb  com.apple.IOSurface (255.6.1 - 255.6.1) <85F85EBB-EA59-3A8B-B3EB-7C20F3CC77AE> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
    0x7fff47243000 -     0x7fff473cefef  com.apple.ImageIO.framework (3.3.0 - 1850.2) <75E46A31-D87D-35CE-86A4-96A50971FDB2> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
    0x7fff473cf000 -     0x7fff473d3ffb  libGIF.dylib (1850.2) <4774EBDF-583B-3DDD-A0E1-9F427CB6A074> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
    0x7fff473d4000 -     0x7fff474b0fef  libJP2.dylib (1850.2) <697BB77F-A682-339F-8659-35432962432D> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
    0x7fff474b1000 -     0x7fff474d6feb  libJPEG.dylib (1850.2) <171A8AC4-AADA-376F-9F2C-B9C978DB1007> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
    0x7fff47799000 -     0x7fff477bffeb  libPng.dylib (1850.2) <FBCEE909-F573-3AD6-A45F-AF32612BF8A2> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
    0x7fff477c0000 -     0x7fff477c2ffb  libRadiance.dylib (1850.2) <56907025-D5CE-3A9E-ACCB-A376C2599853> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
    0x7fff477c3000 -     0x7fff47810fe7  libTIFF.dylib (1850.2) <F59557C9-C761-3E6F-85D1-0FBFFD53ED5C> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
    0x7fff48983000 -     0x7fff4899cfff  com.apple.Kerberos (3.0 - 1) <DB1E0679-37E1-3B93-9789-32F63D660C3B> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
    0x7fff493b8000 -     0x7fff49460ff7  com.apple.Metal (162.2 - 162.2) <FFF7DFF3-7C4E-32C6-A0B5-C356079D3B7C> /System/Library/Frameworks/Metal.framework/Versions/A/Metal
    0x7fff4947c000 -     0x7fff4949bff7  com.apple.MetalPerformanceShaders.MPSCore (1.0 - 1) <44CE8362-E972-3697-AD6F-15BC863BAEB8> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Versions/A/MPSCore
    0x7fff4949c000 -     0x7fff49518fe7  com.apple.MetalPerformanceShaders.MPSImage (1.0 - 1) <EE8440DA-66DF-3923-ABBC-E0543211C069> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSImage.framework/Versions/A/MPSImage
    0x7fff49519000 -     0x7fff49540fff  com.apple.MetalPerformanceShaders.MPSMatrix (1.0 - 1) <E64450DF-2B96-331E-B7F4-666E00571C70> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix
    0x7fff49541000 -     0x7fff4966cff7  com.apple.MetalPerformanceShaders.MPSNeuralNetwork (1.0 - 1) <F2CF26B6-73F1-3644-8FE9-CDB9B2C4501F> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork
    0x7fff4966d000 -     0x7fff49687fff  com.apple.MetalPerformanceShaders.MPSRayIntersector (1.0 - 1) <B33A35C3-0393-366B-ACFB-F4BB6A5F7B4A> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSRayIntersector.framework/Versions/A/MPSRayIntersector
    0x7fff49688000 -     0x7fff49689ff7  com.apple.MetalPerformanceShaders.MetalPerformanceShaders (1.0 - 1) <69F14BCF-C5C5-3BF8-9C31-8F87D2D6130A> /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders
    0x7fff4a480000 -     0x7fff4a48cff7  com.apple.NetFS (6.0 - 4.0) <E917806F-0607-3292-B2D6-A15404D61B99> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
    0x7fff4cf2a000 -     0x7fff4cf81ff7  com.apple.opencl (2.15.3 - 2.15.3) <056BAD8A-23BC-3F74-9E2C-3AC81E7DEA5A> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
    0x7fff4cf82000 -     0x7fff4cf9dff7  com.apple.CFOpenDirectory (10.14 - 207.200.4) <F03D84EB-49B2-3A00-9127-B9A269824026> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
    0x7fff4cf9e000 -     0x7fff4cfa9ffb  com.apple.OpenDirectory (10.14 - 207.200.4) <A8020CEE-5B78-3581-A735-EA2833683F31> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
    0x7fff4d8f9000 -     0x7fff4d8fbfff  libCVMSPluginSupport.dylib (17.7.3) <8E051EA7-55B6-3DF1-9821-72C391DE953B> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib
    0x7fff4d8fc000 -     0x7fff4d901ff3  libCoreFSCache.dylib (166.2) <222C2A4F-7E32-30F6-8459-2FAB98073A3D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib
    0x7fff4d902000 -     0x7fff4d906fff  libCoreVMClient.dylib (166.2) <6789ECD4-91DD-32EF-A1FD-F27D2344CD8B> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
    0x7fff4d907000 -     0x7fff4d90fff7  libGFXShared.dylib (17.7.3) <8C50BF27-B525-3B23-B86C-F444ADF97851> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
    0x7fff4d910000 -     0x7fff4d91bfff  libGL.dylib (17.7.3) <2AC457EA-1BD3-3C8E-AFAB-7EA6234EB749> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
    0x7fff4d91c000 -     0x7fff4d956fef  libGLImage.dylib (17.7.3) <AA027AFA-C115-3861-89B2-0AE946838952> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
    0x7fff4daca000 -     0x7fff4db08fff  libGLU.dylib (17.7.3) <CB3B0579-D9A2-3CA5-8942-0C8344FAD054> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
    0x7fff4e4a5000 -     0x7fff4e4b4ffb  com.apple.opengl (17.7.3 - 17.7.3) <94B5CF34-5BD6-3652-9A8C-E9C56E0A9FB4> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
    0x7fff4f2b7000 -     0x7fff4f50eff7  com.apple.QuartzCore (1.11 - 701.14) <33E846BE-1794-3186-9BF2-6ADF62C782A3> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
    0x7fff4fd43000 -     0x7fff50043fff  com.apple.security (7.0 - 58286.270.3.0.1) <DF7677A7-9765-3B6A-9D1C-3589145E4B65> /System/Library/Frameworks/Security.framework/Versions/A/Security
    0x7fff50044000 -     0x7fff500d0fff  com.apple.securityfoundation (6.0 - 55185.260.1) <1EE899E6-222A-3526-B505-B0D0B6FA042A> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
    0x7fff50102000 -     0x7fff50106fff  com.apple.xpc.ServiceManagement (1.0 - 1) <FCF7BABA-DDDD-3770-8DAC-7069850203C2> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
    0x7fff5049f000 -     0x7fff5050cfff  com.apple.SystemConfiguration (1.17 - 1.17) <30C8327F-3EFF-3520-9C50-016F8B6B954F> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
    0x7fff53748000 -     0x7fff537edfeb  com.apple.APFS (1.0 - 1) <2D22485D-552D-3CB6-9FE1-38547597918F> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
    0x7fff54201000 -     0x7fff54202ff7  com.apple.AggregateDictionary (1.0 - 1) <A6AF8AC4-1F25-37C4-9157-A02E9C200926> /System/Library/PrivateFrameworks/AggregateDictionary.framework/Versions/A/AggregateDictionary
    0x7fff54957000 -     0x7fff54966fc7  com.apple.AppleFSCompression (96.200.3 - 1.0) <3CF60CE8-976E-3CB8-959D-DD0948C1C2DE> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
    0x7fff54aae000 -     0x7fff54af7ff3  com.apple.AppleJPEG (1.0 - 1) <4C1F426B-7D77-3980-9633-7DBD8C666B9A> /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG
    0x7fff54d4b000 -     0x7fff54d6dfff  com.apple.applesauce (1.0 - ???) <F49107C7-3C51-3024-8EF1-C57643BE4F3B> /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce
    0x7fff54ecc000 -     0x7fff54ee0ffb  com.apple.AssertionServices (1.0 - 1) <456E507A-4561-3628-9FBE-173ACE7429D8> /System/Library/PrivateFrameworks/AssertionServices.framework/Versions/A/AssertionServices
    0x7fff5555d000 -     0x7fff55565fff  com.apple.coreservices.BackgroundTaskManagement (1.0 - 57.1) <2A396FC0-7B79-3088-9A82-FB93C1181A57> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
    0x7fff555fc000 -     0x7fff55669ff3  com.apple.BaseBoard (360.28 - 360.28) <68FA8044-F3CD-3BC6-9DAB-27DACF52BFC0> /System/Library/PrivateFrameworks/BaseBoard.framework/Versions/A/BaseBoard
    0x7fff572d4000 -     0x7fff572ddffb  com.apple.CommonAuth (4.0 - 2.0) <93335CB6-ABEB-3EC7-A040-8A667F40D5F3> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
    0x7fff57fb6000 -     0x7fff57fc7ff7  com.apple.CoreEmoji (1.0 - 69.19.9) <228457B3-E191-356E-9A5B-3C0438D05FBA> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
    0x7fff58571000 -     0x7fff585d7ff7  com.apple.CoreNLP (1.0 - 130.15.22) <27877820-17D0-3B02-8557-4014E876CCC7> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
    0x7fff59349000 -     0x7fff5934dff7  com.apple.DSExternalDisplay (3.1 - 380) <787B9748-B120-3453-B8FE-61D9E363A9E0> /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay
    0x7fff5a54f000 -     0x7fff5a96afff  com.apple.vision.FaceCore (3.3.4 - 3.3.4) <A576E2DA-BF6F-3B18-8FEB-324E5C5FA9BD> /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
    0x7fff5f8bf000 -     0x7fff5f8c4fff  com.apple.GPUWrangler (3.50.12 - 3.50.12) <6C820ED9-F306-3978-B5B8-432AD97BBDAF> /System/Library/PrivateFrameworks/GPUWrangler.framework/Versions/A/GPUWrangler
    0x7fff606d0000 -     0x7fff606dffff  com.apple.GraphVisualizer (1.0 - 5) <48D020B7-5938-3FAE-B468-E291AEE2C06F> /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer
    0x7fff60845000 -     0x7fff608b9ffb  com.apple.Heimdal (4.0 - 2.0) <D97FCF19-EAD6-3E2F-BE88-F817E45CAE96> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
    0x7fff61bbd000 -     0x7fff61bc4ffb  com.apple.IOAccelerator (404.14 - 404.14) <11A50171-C8AE-3BBC-9FB9-2A3313FFBD31> /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator
    0x7fff61bc8000 -     0x7fff61be0fff  com.apple.IOPresentment (1.0 - 42.6) <6DFD9A6E-BF95-3A27-89E7-ACAA9E30D90A> /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment
    0x7fff62275000 -     0x7fff62350ff7  com.apple.LanguageModeling (1.0 - 159.15.15) <3DE3CE61-542B-37B7-883E-4B9717CAC65F> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
    0x7fff62351000 -     0x7fff6238dff7  com.apple.Lexicon-framework (1.0 - 33.15.10) <4B5E843E-2809-3E70-9560-9254E2656419> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
    0x7fff62394000 -     0x7fff62399fff  com.apple.LinguisticData (1.0 - 238.25) <F529B961-098C-3E4C-A3E9-9DA9BFA1B3F0> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
    0x7fff6308e000 -     0x7fff630b6ff7  com.apple.spotlight.metadata.utilities (1.0 - 1191.57) <38BB1FB7-3336-384C-B71F-4D0D402EB606> /System/Library/PrivateFrameworks/MetadataUtilities.framework/Versions/A/MetadataUtilities
    0x7fff630b7000 -     0x7fff63144ff7  com.apple.gpusw.MetalTools (1.0 - 1) <CBE2176A-8048-3A9C-AFE4-13973D44C704> /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools
    0x7fff63393000 -     0x7fff633bdffb  com.apple.MultitouchSupport.framework (2450.1 - 2450.1) <42A23EC9-64A7-31C7-BF33-DF4412ED8A3F> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
    0x7fff635f9000 -     0x7fff63603fff  com.apple.NetAuth (6.2 - 6.2) <0D01BBE5-0269-310D-B148-D19DAE143DEB> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
    0x7fff63e64000 -     0x7fff63eb5ff3  com.apple.OTSVG (1.0 - ???) <5BF1A9EB-2694-3267-9514-A4EB3BEF4081> /System/Library/PrivateFrameworks/OTSVG.framework/Versions/A/OTSVG
    0x7fff699b0000 -     0x7fff69c5ffff  com.apple.SkyLight (1.600.0 - 340.54) <90EB1C2E-B264-3EC4-AF7F-CDE7E7585746> /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight
    0x7fff6b0d2000 -     0x7fff6b0deffb  com.apple.TCC (1.0 - 1) <73CF6FA9-44CE-30C9-887F-235940976585> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
    0x7fff6cfb1000 -     0x7fff6cfb3ffb  com.apple.loginsupport (1.0 - 1) <3F8D6334-BCD6-36C1-BA20-CC8503A84375> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
    0x7fff6d27d000 -     0x7fff6d2b1fff  libCRFSuite.dylib (41.15.4) <406DAC06-0C77-3F90-878B-4D38F11F0256> /usr/lib/libCRFSuite.dylib
    0x7fff6d2b4000 -     0x7fff6d2beff7  libChineseTokenizer.dylib (28.15.3) <9B7F6109-3A5D-3641-9A7E-31D2239D73EE> /usr/lib/libChineseTokenizer.dylib
    0x7fff6d34c000 -     0x7fff6d34dffb  libDiagnosticMessagesClient.dylib (107) <A14D0819-0970-34CD-8680-80E4D7FE8C2C> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff6d384000 -     0x7fff6d5dbff3  libFosl_dynamic.dylib (18.3.4) <1B5DD4E2-8AE0-315E-829E-D5BFCD264EA8> /usr/lib/libFosl_dynamic.dylib
    0x7fff6d62c000 -     0x7fff6d64bfff  libMobileGestalt.dylib (645.270.1) <99A06C8A-97D6-383D-862C-F453BABB48A4> /usr/lib/libMobileGestalt.dylib
    0x7fff6d64c000 -     0x7fff6d64cfff  libOpenScriptingUtil.dylib (179.1) <4D603146-EDA5-3A74-9FF8-4F75D8BB9BC6> /usr/lib/libOpenScriptingUtil.dylib
    0x7fff6d78c000 -     0x7fff6d78dffb  libSystem.B.dylib (1252.250.1) <E6C586CE-EEFA-3B4B-9316-AC4322AF0E75> /usr/lib/libSystem.B.dylib
    0x7fff6d809000 -     0x7fff6d80afff  libThaiTokenizer.dylib (2.15.1) <ADB37DC3-7D9B-3E73-A72A-BCC3433C937A> /usr/lib/libThaiTokenizer.dylib
    0x7fff6d81c000 -     0x7fff6d832ffb  libapple_nghttp2.dylib (1.24.1) <6F04250A-6686-3FDC-9A8D-290C64B06502> /usr/lib/libapple_nghttp2.dylib
    0x7fff6d833000 -     0x7fff6d85cffb  libarchive.2.dylib (54.250.1) <47289946-8504-3966-9127-6CE39993DC2C> /usr/lib/libarchive.2.dylib
    0x7fff6d8e0000 -     0x7fff6d8e0ff3  libauto.dylib (187) <3E3780E1-96F3-3A22-91C5-92F9A5805518> /usr/lib/libauto.dylib
    0x7fff6d9b0000 -     0x7fff6d9c0ffb  libbsm.0.dylib (39.200.18) <CF381E0B-025B-364F-A83D-2527E03F1AA3> /usr/lib/libbsm.0.dylib
    0x7fff6d9c1000 -     0x7fff6d9cefff  libbz2.1.0.dylib (38.200.3) <272953A1-8D36-329B-BDDB-E887B347710F> /usr/lib/libbz2.1.0.dylib
    0x7fff6d9cf000 -     0x7fff6da22ff7  libc++.1.dylib (400.9.4) <9A60A190-6C34-339F-BB3D-AACE942009A4> /usr/lib/libc++.1.dylib
    0x7fff6da23000 -     0x7fff6da38ff7  libc++abi.dylib (400.17) <38C09CED-9090-3719-90F3-04A2749F5428> /usr/lib/libc++abi.dylib
    0x7fff6da39000 -     0x7fff6da39ff3  libcharset.1.dylib (51.200.6) <2A27E064-314C-359C-93FC-8A9B06206174> /usr/lib/libcharset.1.dylib
    0x7fff6da3a000 -     0x7fff6da4affb  libcmph.dylib (6.15.1) <9C52B2FE-179F-32AC-B87E-2AFC49ABF817> /usr/lib/libcmph.dylib
    0x7fff6da4b000 -     0x7fff6da63ffb  libcompression.dylib (52.250.2) <7F4BB18C-1FB4-3825-8D8B-6E6B168774C6> /usr/lib/libcompression.dylib
    0x7fff6dcd8000 -     0x7fff6dceefff  libcoretls.dylib (155.220.1) <4C64BE3E-41E3-3020-8BB7-07E90C0C861C> /usr/lib/libcoretls.dylib
    0x7fff6dcef000 -     0x7fff6dcf0ff3  libcoretls_cfhelpers.dylib (155.220.1) <0959B3E9-6643-3589-8BB3-21D52CDF0EF1> /usr/lib/libcoretls_cfhelpers.dylib
    0x7fff6e19c000 -     0x7fff6e1f2ff3  libcups.2.dylib (462.12) <095619DC-9233-3937-9E50-5F10D917A40D> /usr/lib/libcups.2.dylib
    0x7fff6e326000 -     0x7fff6e326fff  libenergytrace.dylib (17.200.1) <80BB567A-FD18-3497-BF97-353F57D98CDD> /usr/lib/libenergytrace.dylib
    0x7fff6e358000 -     0x7fff6e35dff7  libgermantok.dylib (17.15.2) <E5F0F794-FF27-3D64-AE52-C78C6A84DD67> /usr/lib/libgermantok.dylib
    0x7fff6e35e000 -     0x7fff6e363ff7  libheimdal-asn1.dylib (520.270.1) <73F60D6F-76F8-35EF-9C86-9A81225EE4BE> /usr/lib/libheimdal-asn1.dylib
    0x7fff6e38e000 -     0x7fff6e47efff  libiconv.2.dylib (51.200.6) <2047C9B7-3F74-3A95-810D-2ED8F0475A99> /usr/lib/libiconv.2.dylib
    0x7fff6e47f000 -     0x7fff6e6e0ffb  libicucore.A.dylib (62141.0.1) <A0D63918-76E9-3C1B-B255-46F4C1DA7FE8> /usr/lib/libicucore.A.dylib
    0x7fff6e72d000 -     0x7fff6e72efff  liblangid.dylib (128.15.1) <22D05C4F-769B-3075-ABCF-44A0EBACE028> /usr/lib/liblangid.dylib
    0x7fff6e72f000 -     0x7fff6e747ff3  liblzma.5.dylib (10.200.3) <E1F4FD60-1CE4-37B9-AD95-29D348AF1AC0> /usr/lib/liblzma.5.dylib
    0x7fff6e75f000 -     0x7fff6e803ff7  libmecab.1.0.0.dylib (779.24.1) <A8D0379B-85FA-3B3D-89ED-5CF2C3826AB2> /usr/lib/libmecab.1.0.0.dylib
    0x7fff6e804000 -     0x7fff6ea08fff  libmecabra.dylib (779.24.1) <D71F71E0-30E2-3DB3-B636-7DE13D51FB4B> /usr/lib/libmecabra.dylib
    0x7fff6ebe0000 -     0x7fff6ef31ff7  libnetwork.dylib (1229.250.15) <72C7E9E3-B2BE-3300-BE1B-64606222022C> /usr/lib/libnetwork.dylib
    0x7fff6efc3000 -     0x7fff6f748fdf  libobjc.A.dylib (756.2) <7C312627-43CB-3234-9324-4DEA92D59F50> /usr/lib/libobjc.A.dylib
    0x7fff6f75a000 -     0x7fff6f75effb  libpam.2.dylib (22.200.1) <586CF87F-349C-393D-AEEB-FB75F94A5EB7> /usr/lib/libpam.2.dylib
    0x7fff6f761000 -     0x7fff6f796fff  libpcap.A.dylib (79.250.1) <C0893641-7DFF-3A33-BDAE-190FF54837E8> /usr/lib/libpcap.A.dylib
    0x7fff6f8af000 -     0x7fff6f8c7ffb  libresolv.9.dylib (65.200.2) <893142A5-F153-3437-A22D-407EE542B5C5> /usr/lib/libresolv.9.dylib
    0x7fff6f91a000 -     0x7fff6faf7fff  libsqlite3.dylib (274.26) <6404BA3B-BCA4-301F-B2FE-8776105A2AA3> /usr/lib/libsqlite3.dylib
    0x7fff6fd10000 -     0x7fff6fd13ff7  libutil.dylib (51.200.4) <CE9B18C9-66ED-32D4-9D29-01F8FCB467B0> /usr/lib/libutil.dylib
    0x7fff6fd14000 -     0x7fff6fd21fff  libxar.1.dylib (417.1) <39CCF46B-C81A-34B1-92A1-58C4E5DA846E> /usr/lib/libxar.1.dylib
    0x7fff6fd26000 -     0x7fff6fe08ff3  libxml2.2.dylib (32.10) <AA4E1B1F-0FDE-3274-9FA5-75446298D1AC> /usr/lib/libxml2.2.dylib
    0x7fff6fe09000 -     0x7fff6fe31ff3  libxslt.1.dylib (16.5) <E330D3A2-E32B-378A-973E-A8D245C0F712> /usr/lib/libxslt.1.dylib
    0x7fff6fe32000 -     0x7fff6fe44ff7  libz.1.dylib (70.200.4) <B048FC1F-058F-3A08-A1FE-81D5308CB3E6> /usr/lib/libz.1.dylib
    0x7fff70628000 -     0x7fff7062cff3  libcache.dylib (81) <1987D1E1-DB11-3291-B12A-EBD55848E02D> /usr/lib/system/libcache.dylib
    0x7fff7062d000 -     0x7fff70637ff3  libcommonCrypto.dylib (60118.250.2) <1765BB6E-6784-3653-B16B-CB839721DC9A> /usr/lib/system/libcommonCrypto.dylib
    0x7fff70638000 -     0x7fff7063fff7  libcompiler_rt.dylib (63.4) <5212BA7B-B7EA-37B4-AF6E-AC4F507EDFB8> /usr/lib/system/libcompiler_rt.dylib
    0x7fff70640000 -     0x7fff70649ff7  libcopyfile.dylib (146.250.1) <98CD00CD-9B91-3B5C-A9DB-842638050FA8> /usr/lib/system/libcopyfile.dylib
    0x7fff7064a000 -     0x7fff706cefc3  libcorecrypto.dylib (602.260.2) <01464D24-570C-3B83-9D18-467769E0FCDD> /usr/lib/system/libcorecrypto.dylib
    0x7fff70755000 -     0x7fff7078eff7  libdispatch.dylib (1008.270.1) <97273678-E94C-3C8C-89F6-2E2020F4B43B> /usr/lib/system/libdispatch.dylib
    0x7fff7078f000 -     0x7fff707bbff7  libdyld.dylib (655.1.1) <002418CC-AD11-3D10-865B-015591D24E6C> /usr/lib/system/libdyld.dylib
    0x7fff707bc000 -     0x7fff707bcffb  libkeymgr.dylib (30) <0D0F9CA2-8D5A-3273-8723-59987B5827F2> /usr/lib/system/libkeymgr.dylib
    0x7fff707bd000 -     0x7fff707c9ff3  libkxld.dylib (4903.270.47) <E9E37910-D3C3-3433-B071-674EFF6C0B9A> /usr/lib/system/libkxld.dylib
    0x7fff707ca000 -     0x7fff707caff7  liblaunch.dylib (1336.261.2) <2B07E27E-D404-3E98-9D28-BCA641E5C479> /usr/lib/system/liblaunch.dylib
    0x7fff707cb000 -     0x7fff707d0fff  libmacho.dylib (927.0.3) <A377D608-77AB-3F6E-90F0-B4F251A5C12F> /usr/lib/system/libmacho.dylib
    0x7fff707d1000 -     0x7fff707d3ffb  libquarantine.dylib (86.220.1) <6D0BC770-7348-3608-9254-F7FFBD347634> /usr/lib/system/libquarantine.dylib
    0x7fff707d4000 -     0x7fff707d5ff7  libremovefile.dylib (45.200.2) <9FBEB2FF-EEBE-31BC-BCFC-C71F8D0E99B6> /usr/lib/system/libremovefile.dylib
    0x7fff707d6000 -     0x7fff707edff3  libsystem_asl.dylib (356.200.4) <A62A7249-38B8-33FA-9875-F1852590796C> /usr/lib/system/libsystem_asl.dylib
    0x7fff707ee000 -     0x7fff707eeff7  libsystem_blocks.dylib (73) <A453E8EE-860D-3CED-B5DC-BE54E9DB4348> /usr/lib/system/libsystem_blocks.dylib
    0x7fff707ef000 -     0x7fff70876fff  libsystem_c.dylib (1272.250.1) <7EDACF78-2FA3-35B8-B051-D70475A35117> /usr/lib/system/libsystem_c.dylib
    0x7fff70877000 -     0x7fff7087affb  libsystem_configuration.dylib (963.270.3) <2B4A836D-68A4-33E6-8D48-CD4486B03387> /usr/lib/system/libsystem_configuration.dylib
    0x7fff7087b000 -     0x7fff7087eff7  libsystem_coreservices.dylib (66) <719F75A4-74C5-3BA6-A09E-0C5A3E5889D7> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff7087f000 -     0x7fff70885fff  libsystem_darwin.dylib (1272.250.1) <EC9B39A5-9592-3577-8997-7DC721D20D8C> /usr/lib/system/libsystem_darwin.dylib
    0x7fff70886000 -     0x7fff7088cff7  libsystem_dnssd.dylib (878.270.2) <E9A5ACCF-E35F-3909-AF0A-2A37CD217276> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff7088d000 -     0x7fff708d8ffb  libsystem_info.dylib (517.200.9) <D09D5AE0-2FDC-3A6D-93EC-729F931B1457> /usr/lib/system/libsystem_info.dylib
    0x7fff708d9000 -     0x7fff70901ff7  libsystem_kernel.dylib (4903.270.47) <4195838C-EFEF-3CC9-B459-75032AF7EA1A> /usr/lib/system/libsystem_kernel.dylib
    0x7fff70902000 -     0x7fff7094dff7  libsystem_m.dylib (3158.200.7) <F19B6DB7-014F-3820-831F-389CCDA06EF6> /usr/lib/system/libsystem_m.dylib
    0x7fff7094e000 -     0x7fff70978fff  libsystem_malloc.dylib (166.270.1) <011F3AD0-8E6A-3A89-AE64-6E5F6840F30A> /usr/lib/system/libsystem_malloc.dylib
    0x7fff70979000 -     0x7fff70983ff7  libsystem_networkextension.dylib (767.250.2) <FF06F13A-AEFE-3A27-A073-910EF78AEA36> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff70984000 -     0x7fff7098bfff  libsystem_notify.dylib (172.200.21) <145B5CFC-CF73-33CE-BD3D-E8DDE268FFDE> /usr/lib/system/libsystem_notify.dylib
    0x7fff7098c000 -     0x7fff70995fef  libsystem_platform.dylib (177.270.1) <9D1FE5E4-EB7D-3B3F-A8D1-A96D9CF1348C> /usr/lib/system/libsystem_platform.dylib
    0x7fff70996000 -     0x7fff709a0ff7  libsystem_pthread.dylib (330.250.2) <2D5C08FF-484F-3D59-9132-CE1DCB3F76D7> /usr/lib/system/libsystem_pthread.dylib
    0x7fff709a1000 -     0x7fff709a4ff7  libsystem_sandbox.dylib (851.270.1) <9494594B-5199-3186-82AB-5FF8BED6EE16> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff709a5000 -     0x7fff709a7ff3  libsystem_secinit.dylib (30.260.2) <EF1EA47B-7B22-35E8-BD9B-F7003DCB96AE> /usr/lib/system/libsystem_secinit.dylib
    0x7fff709a8000 -     0x7fff709afff3  libsystem_symptoms.dylib (820.267.1) <03F1C2DD-0F5A-3D9D-88F6-B26C0F94EB52> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff709b0000 -     0x7fff709c5fff  libsystem_trace.dylib (906.260.1) <FC761C3B-5434-3A52-912D-F1B15FAA8EB2> /usr/lib/system/libsystem_trace.dylib
    0x7fff709c7000 -     0x7fff709ccffb  libunwind.dylib (35.4) <24A97A67-F017-3CFC-B0D0-6BD0224B1336> /usr/lib/system/libunwind.dylib
    0x7fff709cd000 -     0x7fff709fcfff  libxpc.dylib (1336.261.2) <7DEE2300-6D8E-3C00-9C63-E3E80D56B0C4> /usr/lib/system/libxpc.dylib
Sample analysis of process 31833 written to file /dev/stdout
dengert commented 5 years ago

Is this a mismatch of OpenSSL versions. Do these both used the same libcrypto?

/opt/local/lib/engines-1.1/libpkcs11.so /Library/OpenSC/lib/opensc-pkcs11.so

ldd (or MacOS equivalent) would show if they are using same libraries.

mouse07410 commented 5 years ago
$ otool -L /opt/local/lib/engines-1.1/libpkcs11.dylib 
/opt/local/lib/engines-1.1/libpkcs11.dylib:
    /opt/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /Library/OpenSC/lib/opensc-pkcs11.so
/Library/OpenSC/lib/opensc-pkcs11.so:
    /Library/OpenSC/lib/libopensc.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ 

/Library/OpenSC/lib/opensc-pkcs11.so is statically linked with a different version of OpenSSL (1.0.2-stable).

pkcs11.dylib is linked against OpenSSL-1.1.1c, which is installed system-wide - and all the apps, particularly those installed by Macports, are linked against this version (shared libs) as well. Only Apple-provided apps are linked against LibreSSL that Apple provides.

Update

I just re-built OpenSC against OpenSSL-1.1.1-stable. Same hang-up by apps (git), of course. Commenting out just the line pkcs11 = pkcs11_engine in openssl.cnf resolves this problem - so it's definitely something with loading of the PKCS#11 engine. The only question is - what, and where.

mouse07410 commented 5 years ago

Ping...?

dengert commented 5 years ago

I was expecting you to look at the output of otool to see what needs to be fixed. It looks like you have there may be some issues between 1.0.2 and 1.1.1 which are not handled in the linker, or the libs are passing structures that do not match.

mouse07410 commented 5 years ago

I was expecting you to look at the output of otool to see what needs to be fixed

I don't think there's anything in my config that needs fixing. The problem seems to be with the pkcs11 engine:

$ openssl version
OpenSSL 1.1.1d  10 Sep 2019
$ type openssl
openssl is hashed (/opt/local/bin/openssl)
$ otool -L /opt/local/bin/openssl
/opt/local/bin/openssl:
    /opt/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /opt/local/lib/libssl.1.1.dylib 
/opt/local/lib/libssl.1.1.dylib:
    /opt/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /opt/local/lib/libcrypto.1.1.dylib 
/opt/local/lib/libcrypto.1.1.dylib:
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /opt/local/lib/engines-1.1/pkcs11.dylib 
/opt/local/lib/engines-1.1/pkcs11.dylib:
    /opt/local/lib/libssl.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /Library/OpenSC/lib/opensc-pkcs11.dylib 
/Library/OpenSC/lib/opensc-pkcs11.dylib:
    /Library/OpenSC/lib/libopensc.6.dylib (compatibility version 7.0.0, current version 7.0.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.250.1)
$ otool -L /opt/local/lib/engines-1.1/gost.1.1.dylib 
/opt/local/lib/engines-1.1/gost.1.1.dylib:
    @rpath/gost.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /opt/local/lib/libcrypto.1.1.dylib (compatibility version 1.1.0, current version 1.1.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.0.0)
$ 
$ tail -35 /opt/local/etc/openssl/openssl.cnf
engines = engine_section

[engine_section]
#pkcs11 = pkcs11_section
#softhsm = softhsm_section
gost = gost_section

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /opt/local/lib/engines-1.1/pkcs11.dylib
MODULE_PATH = /Library/OpenSC/lib/opensc-pkcs11.dylib
init = 0

#[softhsm_section]
#engine_id =softhsm2
#dynamic_path = /opt/local/lib/engines-1.1/libpkcs11.dylib
#MODULE_PATH = /opt/local/lib.dylibfthsm/libsofthsm2.dylib
#init = 0

[gost_section]
engine_id = gost
dynamic_path = /opt/local/lib/engines-1.1/gost.dylib
default_algorithms = ALL
CRYPT_PARAMS = id_Gost28147-89-CryptoPro-A-ParamSet
PBE_PARAMS = "gost12_512"
init = 0

####################################################################

...may be some issues between 1.0.2 and 1.1.1...

I no longer have 1.0.2 on my machine(s). Everything is 1.1.1, and there's 3.0 in a special directory that's not in any PATH.

dengert commented 5 years ago

But you said: "/Library/OpenSC/lib/opensc-pkcs11.so is statically linked with a different version of OpenSSL (1.0.2-stable)."

mouse07410 commented 5 years ago

you said: "/Library/OpenSC/lib/opensc-pkcs11.so is statically linked with a different version of OpenSSL (1.0.2-stable)"

Yes it was. It isn't any more. I've moved to the whole system to 1.1.1.

pboguslawski commented 5 years ago

Hello,

Similar problem in updated Debian 10; if /etc/ssl/openssl.cnf contains

[default_conf]
ssl_conf = ssl_sect
engines = engine_section

[engine_section]
pkcs11 = pkcs11_section

[pkcs11_section]
engine_id = pkcs11
dynamic_path = /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
MODULE_PATH = /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
init = 0

then trying to run "puppet agent --test" (which uses TLS for communication to puppetmaster server) throws error

Error: Could not retrieve catalog from remote server: SSL_read: module initialization error

and sometimes also:

free(): double free detected in tcache 2

or

double free or corruption (!prev)

Commenting out line

engines = engine_section

or line

dynamic_path = /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so

in /etc/ssl/openssl.cnf resolves problem with "puppet agent --test" - no problems with connection.

Versions used:

root@d10:/etc/ssl# dpkg -s opensc-pkcs11 | grep Version
Version: 0.19.0-1

root@d10:/etc/ssl# dpkg -s libengine-pkcs11-openssl | grep Version
Version: 0.4.9-4

root@d10:/etc/ssl# dpkg -s openssl | grep Version
Version: 1.1.1d-0+deb10u1

root@d10:/etc/ssl# ldd /usr/lib/x86_64-linux-gnu/engines-1.1/pkcs11.so
        linux-vdso.so.1 (0x00007ffcb10ff000)
        libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fb9bf4c7000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb9bf4c2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb9bf301000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb9bf2e0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb9bf7cb000)

root@d10:/etc/ssl# ldd /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
        linux-vdso.so.1 (0x00007ffd5abf3000)
        libopensc.so.6 => /lib/x86_64-linux-gnu/libopensc.so.6 (0x00007f9e634d8000)
        libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f9e631f2000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9e631ed000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9e631cc000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9e6300b000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9e62ded000)
        libgio-2.0.so.0 => /lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f9e62c2d000)
        libgobject-2.0.so.0 => /lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f9e62bd8000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f9e62ab9000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9e636f0000)
        libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f9e62ab3000)
        libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f9e62a54000)
        libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f9e6282c000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f9e62810000)
        libffi.so.6 => /lib/x86_64-linux-gnu/libffi.so.6 (0x00007f9e62806000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f9e62792000)
        libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f9e6273d000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f9e62733000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f9e62728000)

Regars, Paweł

lkraav commented 4 years ago

I'm getting the same double free tcache 2 crash on Linux, openssl-1.1.1d + libp11-0.4.10

$ [-] openssl-req-esteid-slot1 -x509 -new -days 3650 -sha256 -out CA-2020-v1.crt
engine "pkcs11" set.                     
Error configuring OpenSSL modules
139938993235776:error:26078067:engine routines:engine_list_add:conflicting engine id:crypto/engine/eng_list.c:63:
139938993235776:error:2606906E:engine routines:ENGINE_add:internal list error:crypto/engine/eng_list.c:223:
139938993235776:error:260B6067:engine routines:dynamic_load:conflicting engine id:crypto/engine/eng_dyn.c:502:
139938993235776:error:260BC066:engine routines:int_engine_configure:engine configuration error:crypto/engine/eng_cnf.c:141:section=pkcs11_section, name=dynamic_path, value=/usr/lib64/engines-1
.1/pkcs11.so
139938993235776:error:0E07606D:configuration file routines:module_run:module initialization error:crypto/conf/conf_mod.c:177:module=engines, value=engine_section, retcode=-1      
free(): double free detected in tcache 2  
Aborted (core dumped)

EDIT things improved after I migrated from using -config parameter -> OPENSSL_CONFIG= env variable.

mtrojnar commented 4 years ago

Can you still reproduce it with the current master?

pboguslawski commented 3 years ago

Problem described in https://github.com/OpenSC/libp11/issues/294#issuecomment-539051670 does not exist in Debian 11 with

root@d11:~# dpkg -s opensc-pkcs11 | grep Version
Version: 0.21.0-1

root@d11:~# dpkg -s libengine-pkcs11-openssl | grep Version
Version: 0.4.11-1

root@d11:~# dpkg -s openssl | grep Version
Version: 1.1.1k-1+deb11u1