Hi, a Debian user tracked down a crash in the acpi code, when refreshing fan state. All details are in the Debian bug report, but basically get_acpi_value() takes a full path while it's currently given a filename, so it returns NULL, and then strcmp() crash on NULL. He cooked a patch (which I attach) which fix the path problem, the check for NULL before strcmp, and replaces strcmp() by strncmp() because on his box (and maybe others) there's a \n after 'on' in the state file. I just tested the patch on a box where /proc/acpi/fan exists, and it seems to work fine. Btw, is there an ETA for replacing every /proc code by the /sys one, now that /proc/acpi begins to be deprecated? Cheers and thanks,
Created attachment 1757 Fix fan info catching
(In reply to comment #0) Thanks, but the patch isn't perfect as it does not free() properly. See changes in repository. I can't test the free()ing of char *state as I don't have fan state with Linux 2.6.22, 2.6.24 and 2.6.25. There are no plans for /sys/. I guess I'll skip this step and wait until there's a convenient proc-like file system again. Who cares about deprecation if there's something good, reliable and convenient? I don't.
(In reply to comment #2) > (In reply to comment #0) > > Thanks, but the patch isn't perfect as it does not free() properly. See changes > in repository. I can't test the free()ing of char *state as I don't have fan > state with Linux 2.6.22, 2.6.24 and 2.6.25. I'll try the repository and report back. > > There are no plans for /sys/. I guess I'll skip this step and wait until > there's a convenient proc-like file system again. Who cares about deprecation > if there's something good, reliable and convenient? I don't. A convenient proc-like filesystem? There won't be. Switch to sysfs, that's you're “something good, reliable and convenient”. I don't think you have another choice. Better switch before removal :) Cheers,
(In reply to comment #3) > (In reply to comment #2) > > (In reply to comment #0) > > > > Thanks, but the patch isn't perfect as it does not free() properly. See changes > > in repository. I can't test the free()ing of char *state as I don't have fan > > state with Linux 2.6.22, 2.6.24 and 2.6.25. > > I'll try the repository and report back. I just build the plugin with the patch, and it runs fine. I didn't look precisely if the memory didn't grow, but I guess so. Cheers,
(In reply to comment #4) > (In reply to comment #3) > > (In reply to comment #2) > > > (In reply to comment #0) > > > > > > Thanks, but the patch isn't perfect as it does not free() properly. See changes > > > in repository. I can't test the free()ing of char *state as I don't have fan > > > state with Linux 2.6.22, 2.6.24 and 2.6.25. > > > > I'll try the repository and report back. > > I just build the plugin with the patch, and it runs fine. I didn't look > precisely if the memory didn't grow, but I guess so. Wanna close this bug?
cf. comment 5