There is a bug in conky code where it gets the number of CPUs at the startup and if the CPUs are added or removed with hotplug, it SEGVs. I noticed this because I hotplug remove the hyper-threaded CPUs (I can't disable HT at the BIOS level, its a Macbook). On resume from sleep, temporarily, all CPUs are enabled. So, conky tries to write for 8 CPUs to an array which it allocated only for 4 CPUs. The attached patch just stops after the cpu_count, thereby fixing the SEGV. Reproducible: Always Steps to Reproduce: 1. run conky 2. suspend 3. resume Actual Results: conky crashes with SSEGV Expected Results: conky keeps running
Created attachment 408130 [details, diff] Do not go beyond the size of the array allocated for CPUs
Not sure about the state of the conky project, that's why filing it here. If we can do r4 release with the patch, it would be great!
(In reply to devsk from comment #2) > Not sure about the state of the conky project, that's why filing it here. If > we can do r4 release with the patch, it would be great! Thank you very much for the patch. The conky project seemed to have stalled but gained speed again and a lot of patches were added recently. See (https://github.com/brndnmtthws/conky/commits/master) I would appreciate it if you propose this patch also to the conky project.
I filed: https://github.com/brndnmtthws/conky/issues/127
Fixed in GIT.
But according to /proc/stat where data taken from idx==0 it's total cpu usage and idx==1 it's first cpu (cpu0, and cpu3 for idx==4). So patch is wrong and at least should be modified like `if (idx > info.cpu_count) {`. Check: 1. add config for your last cpu with `${cpugraph cpu4}` for example 2. there is data w/o patch 3. empty graph w/ patch
Thanks for noticing. This is fixed in GIT for conky-1.10.6-r6.