[OmniOS-discuss] bug in powertop

Peter Tribble peter.tribble at gmail.com
Wed Jun 10 16:04:20 UTC 2015


On Tue, Jun 9, 2015 at 4:45 PM, Michael Rasmussen <mir at miras.org> wrote:

> Hi all,
>
> Anybody able to start powertop using some of the available options?
> root at nas:/root# powertop -d 1
> Segmentation Fault (core dumped)
>

Oh, that's bad.

Look at:


http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/powertop/common/powertop.c#81

which is:

char *optarg;

So, when getopt_long parses the arguments and pokes things back into
optarg, where's it going to end up? Not the right optarg, hence the SEGV
when strtod() is called on the local optarg.

Delete that line in powertop.c and all should be well.

(I get the following as well:
powertop: failed to compile P-states (frequencies) program
powertop: failed to compile C-states (idle power) program
so I'm not sure it's actually functional.)

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://omniosce.org/ml-archive/attachments/20150610/9def4879/attachment.html>


More information about the OmniOS-discuss mailing list