aboutsummaryrefslogtreecommitdiff
path: root/src/lib/gssapi/krb5/k5sealv3.c
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2024-08-29 15:25:54 -0400
committerGreg Hudson <ghudson@mit.edu>2024-09-11 16:18:39 -0400
commit1bfcf572241a4ec0e44e609e5c6b7c0b11b08eea (patch)
tree05b0fd8a6f7e81442d8323c26d24524f86c4e4ca /src/lib/gssapi/krb5/k5sealv3.c
parentb9b654e5b469140d5603f27af5bf83ee9a826349 (diff)
downloadkrb5-master.zip
krb5-master.tar.gz
krb5-master.tar.bz2
Block library unloading to avoid finalizer racesHEADmaster
Library finalizers can run due to the library being unloaded or the process exiting. If the library is being unloaded, global memory resources must be released to avoid memory leaks. But if the process is exiting, releasing memory resources can lead to race conditions if another thread invokes functions from the library during or after finalizer execution. Most commonly this manifests as an assertion error about trying to lock a destroyed mutex. We can block unloading of our library on ELF platforms by passing "-z nodelete" to the linker. Add a shell variable "lib_unload_prevented" to the shlib.conf outputs, set it on platforms where we can block unloading, and suppress finalizers when it is set. On Windows we can detect if the process is exiting by checking for a non-null lpvReserved argument in DllMain(). Do not execute finalizers when the process is executing. ticket: 9139 (new)
Diffstat (limited to 'src/lib/gssapi/krb5/k5sealv3.c')
0 files changed, 0 insertions, 0 deletions