NixOS 23.11: thermald not working(?)

I recently switched from channel 23.05 to 23.11, and came across this error when rebuilding my system:

warning: the following units failed: thermald.service

× thermald.service - Thermal Daemon Service
     Loaded: loaded (/etc/systemd/system/thermald.service; enabled; preset: enabled)
     Active: failed (Result: core-dump) since Fri 2023-12-01 10:55:28 PST; 135ms ago
   Duration: 177ms
    Process: 5487 ExecStart=/nix/store/zdi21y0nah7lnxbvpnjbwq5z070fb4wh-thermald-2.5.4/sbin/thermald --no-daemon --dbus-enable --adaptive (code=dumped, signal=ABRT)
   Main PID: 5487 (code=dumped, signal=ABRT)
         IP: 0B in, 0B out
        CPU: 36ms

Dec 01 10:55:28 nixos systemd[1]: Started Thermal Daemon Service.
Dec 01 10:55:28 nixos thermald[5487]: [1701456928][MSG]22 CPUID levels; family:model:stepping 0x6:4e:3 (6:78:3)
Dec 01 10:55:28 nixos thermald[5487]: [1701456928][MSG]22 CPUID levels; family:model:stepping 0x6:4e:3 (6:78:3)
Dec 01 10:55:28 nixos thermald[5487]: [1701456928][MSG]sensor id 11 : No temp sysfs for reading raw temp
Dec 01 10:55:28 nixos thermald[5487]: [1701456928][MSG]sensor id 11 : No temp sysfs for reading raw temp
Dec 01 10:55:28 nixos thermald[5487]: [1701456928][MSG]sensor id 11 : No temp sysfs for reading raw temp
Dec 01 10:55:28 nixos thermald[5487]: *** stack smashing detected ***: terminated
Dec 01 10:55:28 nixos systemd[1]: thermald.service: Main process exited, code=dumped, status=6/ABRT
Dec 01 10:55:28 nixos systemd[1]: thermald.service: Failed with result 'core-dump'.
warning: error(s) occurred while switching to the new configuration

The only config I have for thermald is:
services.thermald.enable = true;
Removing this obviously fixes the issue, but then I’m not able to use thermald to help regulate laptop temperatures.

And to clarify, my device is a laptop/tablet PC.
I’m running on the latest kernel: 6.6.3. I’ve tried reverting back to 6.5.x, but that didn’t change anything either.

Any thoughts?

Seems to happen on ubuntu too "no temp sysfs"; "stack smashing detected" on 2.5.4 on Ubuntu · Issue #425 · intel/thermal_daemon · GitHub

Seems that this unmerged PR might resolve the problem. If you want to try, you could do something like (not tested):

services.thermald.package = pkgs.thermald.overrideAttrs (old: {
  patches = (old.patches or [] ) ++ [(builtins.fetchurl "https://patch-diff.githubusercontent.com/raw/intel/thermal_daemon/pull/422.patch")];
});
2 Likes

I can confirm that it worked with this patch. This is something that has been bugging me for a while. Thank you for the digging.

Edit:
And now I see it was merged 6 hours ago, so I guess it is just a matter of time before this is fixed without the manual labor…