)]}'
{
  "commit": "3d36a6396fbfacd7b1941527d84ff6c0f40ff121",
  "tree": "aa371f5f02f60757a6fbb99d9f6f9f73c1231ad4",
  "parents": [
    "abe47e91d8c4b40429bc5834f8a91c25b10172ca"
  ],
  "author": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Sep 12 10:05:18 2022 +0200"
  },
  "committer": {
    "name": "Tom de Vries",
    "email": "tdevries@suse.de",
    "time": "Mon Sep 12 10:05:18 2022 +0200"
  },
  "message": "[gdb] Fix abort in selftest run_on_main_thread with ^C\n\nWhen running selftest run_on_main_thread and pressing ^C, we can run into:\n...\nRunning selftest run_on_main_thread.\nterminate called without an active exception\n\nFatal signal: Aborted\n...\n\nThe selftest function looks like this:\n...\nstatic void\nrun_tests ()\n{\n  std::thread thread;\n\n  done \u003d false;\n\n  {\n    gdb::block_signals blocker;\n\n    thread \u003d std::thread (set_done);\n  }\n\n  while (!done \u0026\u0026 gdb_do_one_event () \u003e\u003d 0)\n    ;\n\n  /* Actually the test will just hang, but we want to test\n     something.  */\n  SELF_CHECK (done);\n\n  thread.join ();\n}\n...\n\nThe error message we see is due to the destructor of thread being called while\nthread is joinable.\n\nThis is supposed to be taken care of by thread.join (), but the ^C prevents\nthat one from being called, while the destructor is still called.\n\nFix this by ensuring thread.join () is called (if indeed required) before the\ndestructor using SCOPE_EXIT.\n\nTested on x86_64-linux.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d29549\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7e1a30d7e80782cea717df44f4e51b5b102e21de",
      "old_mode": 33188,
      "old_path": "gdb/unittests/main-thread-selftests.c",
      "new_id": "8ab0c445d420a375d3726e8fa94f75ca136374ba",
      "new_mode": 33188,
      "new_path": "gdb/unittests/main-thread-selftests.c"
    }
  ]
}
