)]}'
{
  "commit": "ecb4b2bbe88d55e778d78f62d6521b0ade8035bc",
  "tree": "eec51773768153809c30166cc13a88200883cb4e",
  "parents": [
    "7735dc2266d33b59c9630dd88cc52455436f1c63"
  ],
  "author": {
    "name": "Vishnunithyasoundhar S",
    "email": "vishnunithyasoundhar.s@intel.com",
    "time": "Wed Jul 22 10:29:21 2026 +0530"
  },
  "committer": {
    "name": "Deepak Kodihalli",
    "email": "deepak.kodihalli.83@gmail.com",
    "time": "Thu Jul 30 06:18:55 2026 +0000"
  },
  "message": "platform-mc: fix dangling exec::async_scope in doSensorPolling\n\nstopPolling() erased the doSensorPollingTaskHandles entry while a\ncoroutine was still suspended on the scope. A response arriving after\nthe erase would resume the coroutine on freed memory, causing SIGSEGV.\n\nIntroduce PollHandle, a heap-allocated struct holding the scope and\ncompletion flag. The coroutine takes a shared_ptr\u003cPollHandle\u003e as an\nexplicit parameter so the scope outlives the map entry until\nfinal_suspend is done.\n\nAlso replace [this, tid] captures with explicit parameters. Captures\nare accessed through the closure object, which is a temporary;\nparameters are guaranteed to live in the coroutine frame.\n\nTested: Build an image for nvl32-obmc machine with the following patches\ncherry-picked:\n\n```\n1. pldm platform-mc fix dangling exec::async_scope in doSensorPolling:\n   https://gerrit.openbmc.org/c/openbmc/pldm/+/92581\n2. Align with upstream u-boot dts tree:\n   https://gerrit.openbmc.org/c/openbmc/openbmc/+/89932\n3. mctpd configuration:\n   https://gerrit.openbmc.org/c/openbmc/openbmc/+/87390\n4. Enable nvidia-gpu sensor:\n   https://gerrit.openbmc.org/c/openbmc/openbmc/+/89933\n```\n\nBoth images build pldm with AddressSanitizer (EXTRA_OEMESON +\u003d\n\"-Db_sanitize\u003daddress\") and run pldmd with\ndetect_stack_use_after_return\u003d1, so the defect is observable\nindependently of whether the reclaimed stack slot happens to be\noverwritten. Output below is trimmed where marked \"...\".\n\n```\n$ systemctl show pldmd -p Environment --value\nLD_LIBRARY_PATH\u003d/run/asan\nASAN_OPTIONS\u003ddetect_stack_use_after_return\u003d1:symbolize\u003d0:log_path\u003d/tmp/asan\n\n\u003d\u003d\u003d without 92581 \u003d\u003d\u003d\n\n$ systemctl show pldmd -p ActiveState -p Result -p NRestarts\nActiveState\u003dfailed\nResult\u003dexit-code\nNRestarts\u003d2\n\n$ systemctl status pldmd | grep -E \u0027Duration|Process\u0027\n   Duration: 2.889s\n    Process: 3000 ExecStart\u003d/run/asan/pldmd (code\u003dexited, status\u003d1/FAILURE)\n\n$ cat /tmp/asan.3000\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\u003d\u003d3000\u003d\u003dERROR: AddressSanitizer: stack-use-after-return on address 0x74f116c4 at pc 0x00944fa8 bp 0x7edb8a04 sp 0x7edb89f8\nREAD of size 4 at 0x74f116c4 thread T0\n    #0 0x00944fa4  (/run/asan/pldmd+0x47cfa4)\n    ...\nAddress 0x74f116c4 is located in stack of thread T0 at offset 1732 in frame\n    #0 0x009465e8  (/run/asan/pldmd+0x47e5e8)\n\n  This frame has 101 object(s):\n    ...\n    [1728, 1740) \u0027\u003cunknown\u003e\u0027 \u003c\u003d\u003d Memory access at offset 1732 is inside this variable\n    ...\n\u003d\u003d3000\u003d\u003dABORTING\n\n$ arm-openbmc-linux-gnueabi-addr2line -f -C -e pldmd.debug 0x47cfa4\npldm::platform_mc::SensorManager::doSensorPolling(unsigned char)::{lambda()#1}::operator()(...) [clone .actor]\n\n$ arm-openbmc-linux-gnueabi-addr2line -f -C -e pldmd.debug 0x47e5e8\npldm::platform_mc::SensorManager::doSensorPolling(unsigned char)\n\n\u003d\u003d\u003d with 92581 \u003d\u003d\u003d\n\n$ systemctl show pldmd -p ActiveState -p Result -p NRestarts\nActiveState\u003dactive\nResult\u003dsuccess\nNRestarts\u003d0\n\n$ ls /tmp/asan.* 2\u003e/dev/null | wc -l\n0\n\n$ systemctl show pldmd -p ExecMainStartTimestamp --value\nWed 2026-07-29 17:42:57 UTC\n$ date -u \u0027+%Y-%m-%d %H:%M:%S UTC\u0027\n2026-07-30 02:33:16 UTC\n\n$ grep VmRSS /proc/$(pidof pldmd)/status\nVmRSS:     68524 kB\n\n$ for s in Terminus_14_Sensor_300 Terminus_18_Sensor_300 \\\n  Terminus_19_Sensor_300; do busctl get-property \\\n  xyz.openbmc_project.PLDM \\\n  /xyz/openbmc_project/sensors/temperature/$s \\\n  xyz.openbmc_project.Sensor.Value Value; done\nd 47\nd 46\nd 48\n```\n\nChange-Id: Ia4b50beeadf1e9367e7737e7037a52edebc802fc\nSigned-off-by: Vishnunithyasoundhar S \u003cvishnunithyasoundhar.s@intel.com\u003e\nSigned-off-by: JY Voon \u003cjvoon@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c408e92fe52036de605313b4c5b2c994eb2fb3d5",
      "old_mode": 33188,
      "old_path": "platform-mc/sensor_manager.cpp",
      "new_id": "b0e8ff14aa7b82a22fc04f5c0bda24919bc61b4d",
      "new_mode": 33188,
      "new_path": "platform-mc/sensor_manager.cpp"
    },
    {
      "type": "modify",
      "old_id": "149707255dd0de373a90d97213223e10730eebad",
      "old_mode": 33188,
      "old_path": "platform-mc/sensor_manager.hpp",
      "new_id": "1d9e221c1e7782e166fc3659042e10d03a2aab74",
      "new_mode": 33188,
      "new_path": "platform-mc/sensor_manager.hpp"
    }
  ]
}
