commit | 04d050669c95218230d9fb45385479df43fc1a0d | [log] [tgz] |
---|---|---|
author | Arun P. Mohanan <arun.p.m@linux.intel.com> | Fri Oct 29 20:30:26 2021 +0530 |
committer | gokulsanker <gokul.sanker.v.g@intel.com> | Thu Dec 02 01:30:00 2021 +0530 |
tree | 51aaa8765d68749e2a364ede5f21150e91b23190 | |
parent | daf6f56870c6386ecb1c43b0b9aaa4cc78e4d424 [diff] |
cpuSensor:Check object validity in async callback Sometimes the cpusensor crash was observed. The coredump was pointing to segmentation fault while executing callback function inside setupRead(). Similar issue was observed in adcsensor. Reference to the fix: 1afda6bbb6db0e266795af3229b962c32775b928 The timer cancel() in destructor cannot cancel the expired callback handlers. In such cases if the callback handler is executed, the object is deleted already. Use weak_ptr to check if the object is still valid before using these member variables/functions. The buffer used by async_read_util must guarantee that they remain valid until the handler is called. Tested: Stress tested by restarting the service. Service restart will force re-creating the CPUSensor objects. `count=0; \ while true; \ do systemctl restart xyz.openbmc_project.cpusensor.service; \ count=$((count + 1)); \ echo $count; \ sleep 40; \ done ` Signed-off-by: gokulsanker <gokul.sanker.v.g@intel.com> Signed-off-by: Arun P. Mohanan <arun.p.m@linux.intel.com> Change-Id: I7410feb0e17c5f6d555cd042f5e5b327de1910c5
dbus-sensors is a collection of sensor applications that provide the xyz.openbmc_project.Sensor collection of interfaces. They read sensor values from hwmon, d-bus, or direct driver access to provide readings. Some advance non-sensor features such as fan presence, pwm control, and automatic cpu detection (x86) are also supported.
runtime re-configurable from d-bus (entity-manager or the like)
isolated: each sensor type is isolated into its own daemon, so a bug in one sensor is unlikely to affect another, and single sensor modifications are possible
async single-threaded: uses sdbusplus/asio bindings
multiple data inputs: hwmon, d-bus, direct driver access