control: severity -1 important

On Sun, Oct 12, 2014 at 06:58:21PM +0200, Marco wrote:

> Thanks for the reply I was giving up hope :)
> 
> > My guess would be that thinkfan gets corrupted data from 'somewhere',
> > and then some lack of bounds or type checking messes up other internal
> > variables and leads to corrupt data being written out.

So would be mine. Could you try with the generic (non-IBM) interface as 
described in the thinkfan.conf.complex? As this uses a different parser, 
it should "just" work. Yet we should fix the issue you are facing (but I 
downgraded the bug to "only" important, as it does not happen to every 
user and I'd love to keep thinkfan in Jessie)

> To be more 'scientific' I tried first to make thinkfan print cur_lvl
> value when workign, so I patched system.c code like this:
> 
> diff --git a/system.c b/system.c
> index 43d7515..86eb492 100644
> --- a/system.c
> +++ b/system.c
> @@ -127,6 +127,7 @@ void setfan_ibm() {
>               errcnt |= ERR_FAN_SET;
>       }
>       else {
> +             report(LOG_INFO, LOG_INFO, "cur_lvl = %s\n", cur_lvl);
>               if (unlikely(write(ibm_fan, cur_lvl, l) < l)) {
>                       prefix = "\n";
>                       report(LOG_ERR, LOG_ERR, MSG_ERR_FANCTRL);
> 
> And the result is (as expected), something like this:
> 
> sleeptime=5, tmax=96, last_tmax=96, biased_tmax=96 -> fan="level 3"
> cur_lvl = level 3
> cur_lvl = level 3
> cur_lvl = level 3
> sleeptime=5, tmax=71, last_tmax=104, biased_tmax=71 -> fan="level 7"
> cur_lvl = level 7
> cur_lvl = level 7
> cur_lvl = level 7
> sleeptime=2, tmax=104, last_tmax=70, biased_tmax=155 -> fan="level 3"
> cur_lvl = level 3
> 
> While when thinkfan is 'broken' the output is something like this:
> 
> cur_lvl = ??
> 
> Cleaning up and resetting fan control.
> 
> cur_lvl = ?D
> 
> Cleaning up and resetting fan control.
> 
> cur_lvl = ?d
> 
> Cleaning up and resetting fan control.
> 
> cur_lvl = ??
> 
> Cleaning up and resetting fan control.
> 
> cur_lvl = ?T
> 
> Cleaning up and resetting fan control.
> 
> These are all from different runs since thinkfan crashes each time
> (strange charachters may look different on may terminal, but I think the
> point is that cur_lvl points to sequence of bytes all messed up).

Yeah, looks like a weird read, for some reason.

> > Can you try to monitor /proc/acpi/ibm/thermal with
> > a script or so and see if anything weird is going on?

Could you also monitor "/proc/acpi/ibm/fan", as this containts the 
fan-settings?

> I'm diving now a little more into thinkfan source code (slowly, because it
> is a long time I don't read C). I will see if I can spot the source of
> those strange chars.

Thanks!
Evgeni

-- 
Bruce Schneier can read and understand Perl programs.


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to