)]}'
{
  "commit": "d2eca84d73a66cf93acbf14522efc835e4446f57",
  "tree": "653c576fe7eca6c6af197bbbf114a4adf18e2101",
  "parents": [
    "7d21600b31fe959b758ed475a2211d6805047df9"
  ],
  "author": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Tue Nov 14 11:47:15 2023 +0000"
  },
  "committer": {
    "name": "Pedro Alves",
    "email": "pedro@palves.net",
    "time": "Wed Nov 15 18:03:54 2023 +0000"
  },
  "message": "Fix gdb.threads/threads-after-exec.exp race\n\nSimon noticed that gdb.threads/threads-after-exec.exp was racy.  You\ncan consistenly reproduce it (at git hash\n319b460545dc79280e2904dcc280057cf71fb753), with:\n\n  $ taskset -c 0 make check TESTS\u003d\"gdb.threads/threads-after-exec.exp\"\n\ngdb.log shows:\n\n  (...)\n  Thread 3 \"threads-after-e\" hit Catchpoint 2 (exec\u0027d .../gdb.threads/threads-after-exec/threads-after-exec), 0x00007ffff7fe3290\n   in _start () from /lib64/ld-linux-x86-64.so.2\n  (gdb) PASS: gdb.threads/threads-after-exec.exp: continue until exec\n  info threads\n    Id   Target Id                         Frame\n  * 3    process 1443269 \"threads-after-e\" 0x00007ffff7fe3290 in _start () from /lib64/ld-linux-x86-64.so.2\n  (gdb) FAIL: gdb.threads/threads-after-exec.exp: info threads\n  (...)\n  maint info linux-lwps\n  LWP Ptid          Thread ID\n  1443269.1443269.0 1.3\n  (gdb) FAIL: gdb.threads/threads-after-exec.exp: maint info linux-lwps\n\nThe FAILs happen because the .exp file expects that after the exec,\nthe only thread has GDB thread number 1, but it has instead 3.\n\nThis is yet another case of zombie leader detection making things a\nbit fuzzy.\n\nIn the passing case, we have:\n\n continue\n Continuing.\n [New Thread 0x7ffff7bff640 (LWP 603183)]\n [Thread 0x7ffff7bff640 (LWP 603183) exited]\n process 603180 is executing new program: .../gdb.threads/threads-after-exec/threads-after-exec\n\nWhile in the failing case, we have (note remarks on the rhs):\n\n continue\n Continuing.\n [New Thread 0x7ffff7bff640 (LWP 600205)]\n [Thread 0x7ffff7f95740 (LWP 600202) exited]   \u003c\u003c\u003c gdb deletes leader thread, thread 1.\n [New LWP 600202]                              \u003c\u003c\u003c gdb adds it back -- this is now thread 3.\n [Thread 0x7ffff7bff640 (LWP 600205) exited]\n process 600202 is executing new program: .../threads-after-exec/threads-after-exec\n\nThe testcase only has two threads, yet GDB presented the exec for\nthread 3.  This is GDB deleting the leader (the backend detected it\nwas zombie, due to the exec), and then adding the leader back when it\nsaw the exec event.\n\nI\u0027ve recorded some thoughts about this in PR gdb/31069.\n\nFor now, this commit just makes the testcase cope with the non-one\nthread number, as the number is not important for what this test is\nexercising.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d31069\nChange-Id: Id80b5c73f09c9e0005efeb494cca5d066ac3bbae\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cd8adf900d93be4e73282f5765ce21691637f974",
      "old_mode": 33188,
      "old_path": "gdb/testsuite/gdb.threads/threads-after-exec.exp",
      "new_id": "8d5a518f7b6485221ff79afa3e826143c8979a60",
      "new_mode": 33188,
      "new_path": "gdb/testsuite/gdb.threads/threads-after-exec.exp"
    }
  ]
}
