)]}'
{
  "commit": "c0392e7e494c7e1fa7122df3cb5c1a30760ac5b4",
  "tree": "444df3202abcf05da541fed7eddf85ab8ed571ca",
  "parents": [
    "69ea62fe95a14a04d6b2ba145aaf78e36f42e2eb"
  ],
  "author": {
    "name": "Damien Neil",
    "email": "dneil@google.com",
    "time": "Mon Mar 17 13:48:50 2025 -0700"
  },
  "committer": {
    "name": "Gopher Robot",
    "email": "gobot@golang.org",
    "time": "Fri Mar 21 09:32:55 2025 -0700"
  },
  "message": "runtime: fix interactions between synctest, race detector, and timers\n\nWhen an AfterFunc executes in a synctest bubble, there is a series of\nhappens-before relationships:\n\n  1. The AfterFunc is created.\n  2. The AfterFunc goroutine executes.\n  3. The AfterFunc goroutine returns.\n  4. A subsequent synctest.Wait call returns.\n\nWe were failing to correctly establish the happens-before relationship\nbetween the AfterFunc goroutine and the AfterFunc itself being created.\nWhen an AfterFunc executes, the G running the timer temporarily switches\nto the timer heap\u0027s racectx. It then calls time.goFunc, which starts a\nnew goroutine to execute the timer. time.goFunc relies on the new goroutine\ninheriting the racectx of the G running the timer.\n\nNormal, non-synctest timers, execute with m.curg \u003d\u003d nil, which causes\nnew goroutines to inherit the g0 racectx. We were running synctest\ntimers with m.curg set (to the G executing synctest.Run), so the new\nAfterFunc goroutine was created using m.curg\u0027s racectx. This resulted\nin us not properly establishing the happens-before relationship between\nAfterFunc being called and the AfterFunc goroutine starting.\n\nFix this by setting m.curg to nil while executing timers.\n\nAs one additional fix, when waking a blocked bubble, wake the root\ngoroutine rather than a goroutine blocked in Wait if there is a\ntimer that can fire.\n\nFixes #72750\n\nChange-Id: I2b2d6b0f17f64649409adc93c2603f720494af89\nReviewed-on: https://go-review.googlesource.com/c/go/+/658595\nAuto-Submit: Damien Neil \u003cdneil@google.com\u003e\nLUCI-TryBot-Result: Go LUCI \u003cgolang-scoped@luci-project-accounts.iam.gserviceaccount.com\u003e\nReviewed-by: Michael Pratt \u003cmpratt@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "62acb42359acff5ada64ee3596fdbaf3cb024605",
      "old_mode": 33188,
      "old_path": "src/internal/synctest/synctest_test.go",
      "new_id": "010679b070f87a3167df8d6e0d689cc89d926213",
      "new_mode": 33188,
      "new_path": "src/internal/synctest/synctest_test.go"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "dfbd5682cae3f0fcc662d2f6b8c5e75936c336a8",
      "new_mode": 33188,
      "new_path": "src/runtime/race/testdata/synctest_test.go"
    },
    {
      "type": "modify",
      "old_id": "65bb15dfbb04554e5393b93b9d1051a2bb34508d",
      "old_mode": 33188,
      "old_path": "src/runtime/synctest.go",
      "new_id": "f2ac6ab5c755e1ff0f4c798adce6f12d1ce986ad",
      "new_mode": 33188,
      "new_path": "src/runtime/synctest.go"
    },
    {
      "type": "modify",
      "old_id": "3ece161cf47e5a6a880d068348a6dcb9a5dbc8b0",
      "old_mode": 33188,
      "old_path": "src/runtime/time.go",
      "new_id": "d27503e4df83febf36ea5fb5ee78eb9d8bc7db9f",
      "new_mode": 33188,
      "new_path": "src/runtime/time.go"
    }
  ]
}
