)]}'
{
  "log": [
    {
      "commit": "8a18af52d9b9344497758ed04907a314a083b204",
      "tree": "c971e6b0ebab503ab7896dacabe8cb892e3c1376",
      "parents": [
        "f97dcc15e86dc557517a9b767bc1f6d22ad66594"
      ],
      "author": {
        "name": "Evgeny Eltsin",
        "email": "eaeltsin@google.com",
        "time": "Wed Sep 25 16:55:47 2019 +0200"
      },
      "committer": {
        "name": "Evgeny Eltsin",
        "email": "eaeltsin@google.com",
        "time": "Wed Sep 25 16:55:47 2019 +0200"
      },
      "message": "Make more pthread functions weak for native bridge\n\nThese are using __pthread_internal_*.\n\nTest: run bionic-unit-tests on cuttlefish\nChange-Id: Idbb2503f03bd9f1f2a20fced34b734f573c1c0ad\n"
    },
    {
      "commit": "5bb113cba279f93fb840954463e897b9e28a8660",
      "tree": "bb0ef349f69afba98ee358d5b21a77aeab59076b",
      "parents": [
        "58dd1cbd7f2a0b8a779f2f43c45447cdccc09c3e"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Fri Feb 01 16:31:10 2019 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Fri Feb 01 16:31:10 2019 -0800"
      },
      "message": "Pass caller names to __pthread_internal_find for better errors.\n\nOn http://b/122082295 we had this abort:\n\n  12-27 15:29:31.237 10222 10814 10848 F libc    : invalid pthread_t 0xb1907960 passed to libc\n\nThis wasn\u0027t super helpful. We can do better. Now you get something like\nthis instead:\n\n  03-27 02:34:58.754 25329 25329 W libc    : invalid pthread_t (0) passed to pthread_join\n\nTest: adb shell crasher\nBug: http://b/123255692\nChange-Id: I1d545665a233308480cc3747ec3120e2b6de0453\n"
    },
    {
      "commit": "11859d467c035081f8acafeaf0184b670cd41c48",
      "tree": "36afb3b9c9bbff69d83945e7ab08b7687908f74c",
      "parents": [
        "132768084e24119c337e56fd110b97a23e5593c2"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 13 17:59:29 2017 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 13 17:59:29 2017 -0800"
      },
      "message": "Be more strict about using invalid `pthread_t`s.\n\nAnother release, another attempt to remove the global thread list.\n\nBut this time, let\u0027s admit that it\u0027s not going away. We can switch to using\na read/write lock for the global thread list, and to aborting rather than\nquietly returning ESRCH if we\u0027re given an invalid pthread_t.\n\nThis change affects pthread_detach, pthread_getcpuclockid,\npthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:\ninstead of returning ESRCH when passed an invalid pthread_t, if you\u0027re\ntargeting O or above, they\u0027ll abort with the message \"attempt to use\ninvalid pthread_t\".\n\nNote that this doesn\u0027t change behavior as much as you might think: the old\nlookup only held the global thread list lock for the duration of the lookup,\nso there was still a race between that and the dereference in the caller,\ngiven that callers actually need the tid to pass to some syscall or other,\nand sometimes update fields in the pthread_internal_t struct too.\n\n(This patch replaces such users with calls to pthread_gettid_np, which\nat least makes the TOCTOU window smaller.)\n\nWe can\u0027t check thread-\u003etid against 0 to see whether a pthread_t is still\nvalid because a dead thread gets its thread struct unmapped along with its\nstack, so the dereference isn\u0027t safe.\n\nTaking the affected functions one by one:\n\n    * pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam\n      should be fine. Unsafe calls to those seem highly unlikely.\n\n    * Unsafe pthread_detach callers probably want to switch to\n      pthread_attr_setdetachstate instead, or using\n      pthread_detach(pthread_self()) from the new thread\u0027s start routine\n      rather than doing the detach in the parent.\n\n    * pthread_join calls should be safe anyway, because a joinable thread\n      won\u0027t actually exit and unmap until it\u0027s joined. If you\u0027re joining an\n      unjoinable thread, the fix is to stop marking it detached. If you\u0027re\n      joining an already-joined thread, you need to rethink your design.\n\n    * Unsafe pthread_kill calls aren\u0027t portably fixable. (And are obviously\n      inherently non-portable as-is.) The best alternative on Android is to\n      use pthread_gettid_np at some point that you know the thread to be\n      alive, and then call kill/tgkill directly.\n\n      That\u0027s still not completely safe because if you\u0027re too late, the tid\n      may have been reused, but then your code is inherently unsafe anyway.\n\nBug: http://b/19636317\nTest: ran tests\nChange-Id: I0372c4428e8a7f1c3af5c9334f5d9c25f2c73f21\n"
    },
    {
      "commit": "bcb152903a26269e2c8ada3b27c787ae875f8812",
      "tree": "7bd88d5a8cde6ac54c1af51a11f5932988ce9215",
      "parents": [
        "f5a4992b7186c01b98cb9400b2b5b490805a87bb"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Feb 07 21:05:30 2017 +0000"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Feb 07 21:05:30 2017 +0000"
      },
      "message": "Revert \"Stop checking the global thread list in several trivial cases.\"\n\nThis reverts commit f5a4992b7186c01b98cb9400b2b5b490805a87bb.\n\nBreaks OMX_ImgEnc in cameraserver (http://b/35088254).\n\nChange-Id: I6dcf12706a184b0b8b72451584567a42dfa1bb4f\n"
    },
    {
      "commit": "f5a4992b7186c01b98cb9400b2b5b490805a87bb",
      "tree": "5e0da95bd6edc7fb861bf0130fcfab4997a9141a",
      "parents": [
        "4a47d2c436e93caff08fb112f39bb24145950279"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 06 14:09:53 2017 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 06 14:09:53 2017 -0800"
      },
      "message": "Stop checking the global thread list in several trivial cases.\n\nSince removing the global thread is hard, let\u0027s take the different\ngroups of functions individually.\n\nThe existing code was racy anyway, because the thread might still be\non the list but have exited (leaving tid \u003d\u003d 0).\n\nBug: http://b/19636317\nTest: ran tests\nChange-Id: Icc0986ff124d5f9b8a653edf718c549d1563973b\n"
    },
    {
      "commit": "7484c21c4c352a2200d94939fabc10d1bd3f0723",
      "tree": "fe089ec40970a76f11107534632b1fc5789660ed",
      "parents": [
        "b0e8c565a622b5519e03d4416b0b5b1a5f20d7f5"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Feb 02 02:41:38 2017 +0000"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Feb 02 02:41:38 2017 +0000"
      },
      "message": "Revert \"Remove the global thread list.\"\n\nThis reverts commit b0e8c565a622b5519e03d4416b0b5b1a5f20d7f5.\n\nBreaks swiftshader (http:/b/34883464).\n\nChange-Id: I7b21193ba8a78f07d7ac65e41d0fe8516940a83b\n"
    },
    {
      "commit": "b0e8c565a622b5519e03d4416b0b5b1a5f20d7f5",
      "tree": "8362f2754276b72e79a652885be7379127ca6e07",
      "parents": [
        "fb07c36bc061db4ca5d8348ff6bc1e60b6c53191"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Jan 04 14:12:54 2017 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Sat Jan 07 14:16:46 2017 -0800"
      },
      "message": "Remove the global thread list.\n\nAnother release, another attempt to fix this bug.\n\nThis change affects pthread_detach, pthread_getcpuclockid,\npthread_getschedparam/pthread_setschedparam, pthread_join, and pthread_kill:\ninstead of returning ESRCH when passed an invalid pthread_t, they\u0027ll now SEGV.\n\nNote that this doesn\u0027t change behavior as much as you might think: the old\nlookup only held the global thread list lock for the duration of the lookup,\nso there was still a race between that and the dereference in the caller,\ngiven that callers actually need the tid to pass to some syscall or other,\nand sometimes update fields in the pthread_internal_t struct too.\n\nWe can\u0027t check thread-\u003etid against 0 to see whether a pthread_t is still\nvalid because a dead thread gets its thread struct unmapped along with its\nstack, so the dereference isn\u0027t safe.\n\nTaking the affected functions one by one:\n\n* pthread_getcpuclockid and pthread_getschedparam/pthread_setschedparam\n  should be fine. Unsafe calls to those seem highly unlikely.\n\n* Unsafe pthread_detach callers probably want to switch to\n  pthread_attr_setdetachstate instead, or using pthread_detach(pthread_self())\n  from the new thread\u0027s start routine rather than doing the detach in the\n  parent.\n\n* pthread_join calls should be safe anyway, because a joinable thread won\u0027t\n  actually exit and unmap until it\u0027s joined. If you\u0027re joining an\n  unjoinable thread, the fix is to stop marking it detached. If you\u0027re\n  joining an already-joined thread, you need to rethink your design.\n\n* Unsafe pthread_kill calls aren\u0027t portably fixable. (And are obviously\n  inherently non-portable as-is.) The best alternative on Android is to\n  use pthread_gettid_np at some point that you know the thread to be alive,\n  and then call kill/tgkill directly. That\u0027s still not completely safe\n  because if you\u0027re too late, the tid may have been reused, but then your\n  code is inherently unsafe anyway.\n\nIf we find too much code is still broken, we can come back and disable\nthe global thread list lookups for anything targeting \u003e\u003d O and then have\nanother go at really removing this in P...\n\nBug: http://b/19636317\nTest: N6P boots, bionic tests pass\nChange-Id: Ia92641212f509344b99ee2a9bfab5383147fcba6\n"
    },
    {
      "commit": "725b2a96a70c6570a1fb84562fe46348414752cd",
      "tree": "c6e4772eff6ea9ebb881ca579f14e6c4f87fc05d",
      "parents": [
        "68a2f12304e960f2045f3819c48311e7bf4d3126"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Mar 23 11:20:47 2016 -0700"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Mar 23 17:40:25 2016 -0700"
      },
      "message": "Add pthread_getname_np.\n\nAlso guard both these GNU extensions with _GNU_SOURCE.\n\nAlso improve the tests to test each case on both the current thread and\nanother thread, since the code paths are totally different.\n\nBug: http://b/27810459\nChange-Id: I72b05bca5c5b6ca8ba4585b8edfb716a1c252f92\n"
    },
    {
      "commit": "673b15e4ee2c6d99b150aedddc0f389e29f98e1b",
      "tree": "edc101b54c689960bdf1262e6378b21082d3e277",
      "parents": [
        "4149dc944bbe3c5f1c14fc998106975e68bdd6bf"
      ],
      "author": {
        "name": "Yabin Cui",
        "email": "yabinc@google.com",
        "time": "Thu Mar 19 14:19:19 2015 -0700"
      },
      "committer": {
        "name": "Yabin Cui",
        "email": "yabinc@google.com",
        "time": "Mon Mar 23 19:03:49 2015 -0700"
      },
      "message": "Let g_thread_list_lock only protect g_thread_list.\n\nAs glibc/netbsd don\u0027t protect access to thread struct members by a global\nlock, we don\u0027t want to do it either. This change reduces the\nresponsibility of g_thread_list_lock to only protect g_thread_list.\n\nBug: 19636317\nChange-Id: I897890710653dac165d8fa4452c7ecf74abdbf2b\n"
    },
    {
      "commit": "05fc1d7050d5451aea08dc5f504d2670287b2d43",
      "tree": "fa1d81b61b303ee8ed94c511cc08b8f40ed6624b",
      "parents": [
        "43606bc1ce974e4ba42d7d2c3682ad5182e6fc96"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Jan 28 18:02:33 2015 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Jan 28 19:23:11 2015 -0800"
      },
      "message": "Add missing includes.\n\nChange-Id: Ibf549266a19a67eb9158d341a69dddfb654be669\n"
    },
    {
      "commit": "68d98d832b7935ed5be23836c481a14f00b19ef1",
      "tree": "8055b8a2ba805a99544318feca3d7d894fe93955",
      "parents": [
        "92a585c91a83e63949431c617de936742b080150"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Nov 12 21:03:26 2014 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Wed Nov 12 21:03:26 2014 -0800"
      },
      "message": "Assume glibc \u003e\u003d 2.15.\n\nThis catches one trivial difference between us and glibc --- the error\nreturned by pthread_setname_np for an invalid pthread_t.\n\nChange-Id: If4c21e22107c6488333d11184f8005f8669096c2\n"
    },
    {
      "commit": "f73183f1a34df22b62a3d0bbf82e18d5797c9cde",
      "tree": "1bc3c9a47180aaeb2f734e835034a3f6b9ac9d00",
      "parents": [
        "7b87d441b0f2aa3ad5021ab6bd879a995a1bc2ce"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Aug 26 16:20:59 2014 -0700"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Aug 26 16:20:59 2014 -0700"
      },
      "message": "More cases where libc should use O_CLOEXEC.\n\nChange-Id: Idfa111aeebc5deca2399dae919e8b72eb54c23c0\n"
    },
    {
      "commit": "39b644a0e270df453c53d6060cd364391bb1c512",
      "tree": "fc937b2b00e2efe603ac0bd48fc0a1c832b46456",
      "parents": [
        "a0bf9bdea24164db96ec1d5dfa2cd327942671b6"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Mar 04 10:55:39 2014 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Mar 04 10:55:39 2014 -0800"
      },
      "message": "Remove dead NULL checks from pthread code.\n\nGCC is removing these checks anyway because it knows the arguments\nmust be non-null, so leaving this code around is just confusing.\n\nWe know from experience that people were shipping code with locking\nbugs because they weren\u0027t checking for error returns. Failing hard\nlike glibc does seems the better choice. (And it\u0027s what the checked\nin code was already doing; this patch doesn\u0027t change that. It just\nmakes it more obvious that that\u0027s what\u0027s going on.)\n\nChange-Id: I167c6d7c0a296822baf0cb9b43b97821eba7ab35\n"
    },
    {
      "commit": "a41ba2f0bfc4fce1ce8f06a9c289102c440c929d",
      "tree": "f1881b3f5abe1695225de18c0a63227ce8f7ef79",
      "parents": [
        "26c815c489197259e3692d4a1e35463989f7c7a3"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Mar 21 20:02:35 2013 -0700"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Mar 21 20:02:35 2013 -0700"
      },
      "message": "Fix pthread_setname_np\u0027s behavior on invalid pthread_ts.\n\nChange-Id: I0a154beaab4d164ac812f2564d12e4d79b80a8e8\n"
    },
    {
      "commit": "40eabe24e4e3ae8ebe437f1f4e43cf39cbba2e9e",
      "tree": "19eef7fcbba616a52bd37f4c83ece3e918b25445",
      "parents": [
        "3e3b239d2be0c5a92e91385f4f10b8f7da8d2837"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Thu Feb 14 18:59:37 2013 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Fri Feb 15 12:08:59 2013 -0800"
      },
      "message": "Fix the pthread_setname_np test.\n\nFix the pthread_setname_np test to take into account that emulator kernels are\nso old that they don\u0027t support setting the name of other threads.\n\nThe CLONE_DETACHED thread is obsolete since 2.5 kernels.\n\nRename kernel_id to tid.\n\nFix the signature of __pthread_clone.\n\nClean up the clone and pthread_setname_np implementations slightly.\n\nChange-Id: I16c2ff8845b67530544bbda9aa6618058603066d\n"
    },
    {
      "commit": "3e898476c7230b60a0f76968e64ff25f475b48c0",
      "tree": "0f876aeb565b7e7ac627a6305a355c40173912f2",
      "parents": [
        "fcaf4e9f9b735e053469c7ecbf63584e10fd67a7"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Feb 12 16:40:24 2013 +0000"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Feb 12 15:27:18 2013 -0800"
      },
      "message": "Revert \"Revert \"More pthreads cleanup.\"\"\n\nThis reverts commit 6f94de3ca49e4ea147b1c59e5818fa175846518f\n\n(Doesn\u0027t try to increase the number of TLS slots; that leads to\nan inability to boot. Adds more tests.)\n\nChange-Id: Ia7d25ba3995219ed6e686463dbba80c95cc831ca\n"
    },
    {
      "commit": "6f94de3ca49e4ea147b1c59e5818fa175846518f",
      "tree": "9a2c45004114f53c4cf1f9468a58fe54c58320fa",
      "parents": [
        "2a1bb4e64677b9abbc17173c79768ed494565047"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Tue Feb 12 06:06:22 2013 +0000"
      },
      "committer": {
        "name": "Gerrit Code Review",
        "email": "noreply-gerritcodereview@google.com",
        "time": "Tue Feb 12 06:06:22 2013 +0000"
      },
      "message": "Revert \"More pthreads cleanup.\"\n\nThis reverts commit 2a1bb4e64677b9abbc17173c79768ed494565047\n\nChange-Id: Ia443d0748015c8e9fc3121e40e68258616767b51\n"
    },
    {
      "commit": "2a1bb4e64677b9abbc17173c79768ed494565047",
      "tree": "3e843fd4277f2bdc502511bd5e4ee539887c14f1",
      "parents": [
        "2d3e72336e76180fb00822386da4f14203d117ce"
      ],
      "author": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 11 12:34:03 2013 -0800"
      },
      "committer": {
        "name": "Elliott Hughes",
        "email": "enh@google.com",
        "time": "Mon Feb 11 14:56:39 2013 -0800"
      },
      "message": "More pthreads cleanup.\n\nPOSIX says pthread_create returns EAGAIN, not ENOMEM.\n\nAlso pull pthread_attr_t functions into their own file.\n\nAlso pull pthread_setname_np into its own file.\n\nAlso remove unnecessary #includes from pthread_key.cpp.\n\nAlso account for those pthread keys used internally by bionic,\nso they don\u0027t count against the number of keys available to user\ncode. (They do with glibc, but glibc\u0027s limit is the much more\ngenerous 1024.)\n\nAlso factor out the common errno-restoring idiom to reduce gotos.\n\nBug: 6702535\nChange-Id: I555e66efffcf2c1b5a2873569e91489156efca42\n"
    }
  ]
}
