<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 9, 2015 at 4:45 PM, Michael Rasmussen <span dir="ltr"><<a href="mailto:mir@miras.org" target="_blank">mir@miras.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
Anybody able to start powertop using some of the available options?<br>
root@nas:/root# powertop -d 1<br>
Segmentation Fault (core dumped)<br></blockquote><div><br></div><div>Oh, that's bad.<br><br></div><div>Look at:<br><br> <a href="http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/powertop/common/powertop.c#81">http://src.illumos.org/source/xref/illumos-gate/usr/src/cmd/powertop/common/powertop.c#81</a><br><br></div><div>which is:<br><br>char                        *optarg;<br><br>So, when getopt_long parses the arguments and pokes things back into<br></div><div>optarg, where's it going to end up? Not the right optarg, hence the SEGV<br>when strtod() is called on the local optarg.<br><br></div><div>Delete that line in powertop.c and all should be well.<br><br></div><div>(I get the following as well:<br>powertop: failed to compile P-states (frequencies) program<br>powertop: failed to compile C-states (idle power) program<br>so I'm not sure it's actually functional.)<br></div></div><br>-- <br><div class="gmail_signature">-Peter Tribble<br><a href="http://www.petertribble.co.uk/" target="_blank">http://www.petertribble.co.uk/</a> - <a href="http://ptribble.blogspot.com/" target="_blank">http://ptribble.blogspot.com/</a></div>
</div></div>