[Pkg-acpi-devel] Bug#762910: lines longer than 39 characters are mishandled in /proc/acpi/wakeup

Guillem Jover guillem at debian.org
Sat Nov 15 11:35:00 UTC 2014

Control: severity -1 important


This might deserve to be serious instead of important, but I'll leave
that up to the maintainers. It would be nice to fix it for Jessie,
though, as both severities should be good candidates for acceptance.

On Fri, 2014-09-26 at 10:29:09 +0200, Gergely Risko wrote:
> Package: acpitool
> Version: 0.5.1-3
> Tags: patch

> While parsing /proc/acpi/wakeup, src/acpitool.cpp assumes that lines are
> maximum 39 char long (40 including the terminating NUL character at the
> end of C strings).
> Since I have a line in /proc/acpi/wakeup that is exactly 40 char long,
> the tool doesn't work (it hangs up when it hits that line, consuming
> 100% CPU forever).

Yeah, I've got the same problem with lines such as:

LID       S3    *enabled   platform:PNP0C0D:00
SLPB      S3    *enabled   platform:PNP0C0E:00

and acpitool -w (or -e) getting stuck like this:

$ acpitool -w
   Device       S-state   Status   Sysfs node
  1. LID          S3    *enabled   platform:PNP0C0D:00
  2. SLPB         S3    *enabled   platform:PNP0C0E:0

> The attached patch changes this behavior to assume maximum 79 char long
> lines by increasing the buffer size to 80.

I'm attaching a patch I prepared before noticing this bug report,
switching that code to dynamically allocated types instead, which
should be more future-proof anyway.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-assume-fixed-line-lengths-for-proc-acpi-wakeu.patch
Type: text/x-diff
Size: 1574 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-acpi-devel/attachments/20141115/7bcf9c6e/attachment.patch>

More information about the Pkg-acpi-devel mailing list