)]}'
{
  "commit": "c796e0215209e68d77dfc23150441a64404a99a5",
  "tree": "0482f0706d1d037dd19cabdcccf5a39ac726d0ac",
  "parents": [
    "bb9ad09e8ec91d1c3e9c571b4b5ba98980b5fa93"
  ],
  "author": {
    "name": "Matt Caswell",
    "email": "matt@openssl.org",
    "time": "Tue Jun 07 13:24:01 2016 +0100"
  },
  "committer": {
    "name": "Matt Caswell",
    "email": "matt@openssl.org",
    "time": "Tue Jun 07 13:41:22 2016 +0100"
  },
  "message": "Document the issue with threads and dlopen()\n\nIf using threads and OpenSSL is loaded via dlopen(), and subsequently\nclosed again via dlclose() *before* the threads are destroyed, then\nOpenSSL will not free up the per thread resources. We need to document\nthis restriction, and provide some guidance on what to do about it.\n\nI did some testing and discovered/verified a few of things (at least\nthis is the behaviour on Linux):\n\n- Using OpenSSL via dlopen in a mutli-threaded app does leak memory if\nthreads are destroyed after dlcose() is called.\n- In a single threaded environment, or if threads are destroyed prior to\ndlclose() being called, then no memory is leaked\n- Using the RTLD_NODELETE flag to dlopen solves the above problem\n- Interestingly the OpenSSL atexit() handler gets called when dlclose()\nis called rather than at application exit (I was worred that it might crash\nif there was an atexit() handler for a function that has been unloaded)\n- RTLD_NODELETE is a non-standard flag - but it does seem to be fairly\nwidely supported. As far as I could determine (via google), at least Linux,\nSolaris, OpenBSD, FreeBSD, HP-UX all seem to support it.\n\nI also tested on Windows (using LoadLibrary instead of dlopen and\nFreeLibrary instead of dlclose) and experienced similar behaviour, except\nthat (AFAIK) there is no equivalent of RTLD_NODELETE on Windows.\n\nGitHub Issue #653\n\nReviewed-by: Richard Levitte \u003clevitte@openssl.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8caa36148c6c8a8591905aef0a854da410f332cb",
      "old_mode": 33188,
      "old_path": "doc/crypto/OPENSSL_init_crypto.pod",
      "new_id": "a35325b3f256349515b3183d57034d2df89660c1",
      "new_mode": 33188,
      "new_path": "doc/crypto/OPENSSL_init_crypto.pod"
    }
  ]
}
