vmatare / thinkfan

The minimalist fan control program
GNU General Public License v3.0
541 stars 62 forks source link

thinkfan terminated by SIGABRT #139

Closed karthink closed 2 years ago

karthink commented 3 years ago
$ sudo thinkfan -n
/usr/include/c++/11.1.0/bits/stl_vector.h:1063: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::const_reference = const int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__n < this->size()' failed.
fish: Job 1, 'sudo thinkfan -n' terminated by signal SIGABRT (Abort)
$ cat /etc/modprobe.d/thinkfan.conf
options thinkpad_acpi fan_control=1

Installed from the Arch AUR (builds from source).

Config file (/etc/thinkfan.yaml)

sensors:
  - tpacpi: /proc/acpi/ibm/thermal
    indices: [1]

fans:
  - tpacpi: /proc/acpi/ibm/fan

levels:
  - [0, 0, 58]
  - ["level auto", 56, 80]
  - ["level disengaged", 78, 255]

Thinkpad: T14 Gen 1 AMD

haaase commented 3 years ago

I can confirm this issue. I'm experiencing the same error on the following setup: Thinkpad T14 Gen 2 Intel, Arch Linux (5.12.13 kernel), thinkfan v1.2.2.

Interestingly, I could fix the issue by removing the indices line. It also works when using a hwmon based config instead of tpacpi, i.e., both of the configuration options below work on my machine:

sensors:
  - hwmon: /sys/class/hwmon
    name: coretemp
    indices: [1,2,3,4,5]

  - tpacpi: /proc/acpi/ibm/thermal
    # indices: [1,2,3]
karthink commented 3 years ago

That's useful to know. I'll try this and report if it works for me too.

Julian @.***> writes:

I can confirm this issue. I'm experiencing the same error on the following setup: Thinkpad T14 Gen 2 Intel, Arch Linux (5.12.13 kernel), thinkfan v1.2.2.

Interestingly, I could fix the issue by removing the indices line. It also works when using a hwmon based config instead of tpacpi, i.e., both of the configuration options below work on my machine:

sensors:
  - hwmon: /sys/class/hwmon
    name: coretemp
    indices: [1,2,3,4,5]

  - tpacpi: /proc/acpi/ibm/thermal
    # indices: [1,2,3]

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/vmatare/thinkfan/issues/139#issuecomment-874160793

vmatare commented 3 years ago

This should be fixed in the latest master, specifically by https://github.com/vmatare/thinkfan/commit/6b9e34895064b7aede360958649910de4839ab8a. Please test and let me know if the issue is fixed for you.

haaase commented 2 years ago

Hi there, I am sorry for the late reply. I was traveling for a while.

I can indeed confirm that tpacpi with indices works on my machine when building from latest master (I tried 9847f66). Thanks a lot for the quick fix! :)