)]}'
{
  "commit": "20bf7711bce2188c1af985a87df23c4653c2cc7a",
  "tree": "1694e1225dc42af7cd6b46d07e6323bd7bcd4a33",
  "parents": [
    "bacc61fd3e6fd61a59fb59bcc657be17a381520d"
  ],
  "author": {
    "name": "Tom Tromey",
    "email": "tom@tromey.com",
    "time": "Sat Mar 23 15:19:20 2024 -0600"
  },
  "committer": {
    "name": "Tom Tromey",
    "email": "tom@tromey.com",
    "time": "Tue Apr 16 14:02:15 2024 -0600"
  },
  "message": "Avoid cache race in bfd_check_format_matches\n\nRunning the gdb test suite with the thread sanitizer enabled shows a\nrace when bfd_check_format_matches and bfd_cache_close_all are called\nsimultaneously on different threads.\n\nThis patch fixes this race by having bfd_check_format_matches\ntemporarily remove the BFD from the file descriptor cache -- leaving\nit open while format-checking proceeds.\n\nIn this setup, the BFD client is responsible for closing the BFD again\non the \"checking\" thread, should that be desired.  gdb does this by\ncalling bfd_cache_close in the relevant worker thread.\n\nAn earlier version of this patch omitted the \"possibly_cached\" helper\nfunction.  However, this ran into crashes in the binutils test suite\ninvolving the archive-checking abort in bfd_cache_lookup_worker.  I do\nnot understand the purpose of this check, so I\u0027ve simply had the new\nfunction work around it.  I couldn\u0027t find any comments explaining this\nsituation, either.  I suspect that there may still be races related to\nthis case, but I don\u0027t think I have access to the platforms where gdb\ndeals with archives.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d31264\n\n\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "109de767a398ef25f75c37c864dadff7e58bf743",
      "old_mode": 33188,
      "old_path": "bfd/bfd-in2.h",
      "new_id": "e3b5a8b8522f3103343ff77a08a73218b0aab6f4",
      "new_mode": 33188,
      "new_path": "bfd/bfd-in2.h"
    },
    {
      "type": "modify",
      "old_id": "ace2f67954f5a1df372fa80b5bdb946c97d73aca",
      "old_mode": 33188,
      "old_path": "bfd/bfd.c",
      "new_id": "ae79c6490b5f1909c6b9e62f0f131f91b3ef0d65",
      "new_mode": 33188,
      "new_path": "bfd/bfd.c"
    },
    {
      "type": "modify",
      "old_id": "0f994c742397f38b6c95855565c507150217045a",
      "old_mode": 33188,
      "old_path": "bfd/cache.c",
      "new_id": "5c825433b62adfc28c8b2e48e1698550fc2b9466",
      "new_mode": 33188,
      "new_path": "bfd/cache.c"
    },
    {
      "type": "modify",
      "old_id": "2a700bab5575a8ddd72c14302a54cab133c977df",
      "old_mode": 33188,
      "old_path": "bfd/format.c",
      "new_id": "443fc6dbde02650b223d56babf635b68c9406d5e",
      "new_mode": 33188,
      "new_path": "bfd/format.c"
    },
    {
      "type": "modify",
      "old_id": "d1062620d65ec4cec148458633aee904284d3221",
      "old_mode": 33188,
      "old_path": "bfd/libbfd.h",
      "new_id": "5e8ed9eeefe2eca26c944d8e6957c766f4599264",
      "new_mode": 33188,
      "new_path": "bfd/libbfd.h"
    }
  ]
}
