Re: [Powertop] [bugreport] crash on powertop --debug --html=file.html
Jan-Simon Möller <dl9pf at gmx.de> Sun, 01 Jul 2012 22:07:40 +0200
| Newsgroups | dev.linux.lists.powertop |
|---|---|
| Message-ID | <[email protected]> |
no change.
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Sergey Senozhatsky <sergey.senozhatsky(a)gmail.com> schrieb:
On (07/01/12 15:46), Jan-Simon Möller wrote:
> Am Mittwoch, 27. Juni 2012, 18:32:42 schrieb Sergey Senozhatsky:
> >
> > Could you please run
> >
> > valgrind --tool=memcheck --leak-check=full --show-reachable=yes
> > --leak-resolution=high --track-origins=yes -v
> > --log-file=./powertop-memcheck powertop --debug --html=file.html
> >
> > and provide powertop-memcheck file?
> >
> >
> > -ss
>
> Attached.
Thanks, I'll take a look.
Meanwhile, could you please try the following patch?
---
src/devlist.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/devlist.cpp b/src/devlist.cpp
index 93f2081..9f06b92 100644
--- a/src/devlist.cpp
+++ b/src/devlist.cpp
@@ -146,11 +146,12 @@ void collect_open_devices(void)
if (!dev)
continue;
dev->pid = strtoull(entry->d_name, NULL, 10);
- strncpy(dev->device, link, 251);
+ strncpy(dev->device, link, 250);
+ dev->device[251] = 0x00;
sprintf(filename, "/proc/%s/comm", entry->d_name);
- strncpy(dev->comm, read_sysfs_string("/proc/%s/comm", entry->d_name).c_str(), 31);
+ strncpy(dev->comm, read_sysfs_string("/proc/%s/comm", entry->d_name).c_str(), 30);
+ dev->comm[31] = 0x00;
target->push_back(dev);
-
}
}
closedir(dir2);
attachment.html
(text/html, 2 KB)
<html><head></head><body>no change.<br> -- <br> Sent from my Android phone with K-9 Mail. Please excuse my brevity.<br><br><div class="gmail_quote"><br> <br> Sergey Senozhatsky <[email protected]> schrieb:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> <pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif">On (07/01/12 15:46), Jan-Simon Möller wrote:<br />> Am Mittwoch, 27. Juni 2012, 18:32:42 schrieb Sergey Senozhatsky:<br />> > <br />> > Could you please run<br />> > <br />> > valgrind --tool=memcheck --leak-check=full --show-reachable=yes<br />> > --leak-resolution=high --track-origins=yes -v<br />> > --log-file=./powertop-memcheck powertop --debug --html=file.html<br />> > <br />> > and provide powertop-memcheck file?<br />> > <br />> > <br />> > -ss<br />> <br />> Attached.<br /><br />Thanks, I'll take a look.<br /><br />Meanwhile, could you please try the following patch?<br /><br />---<br /><br /> src/devlist.cpp | 7 ++++---<br /> 1 file changed, 4 insertions(+), 3 deletions(-)<br /><br />diff --git a/src/devlist.cpp b/src/devlist.cpp<br />index 93f2081..9f06b92 100644<br />--- a/src/devlist.cpp<br />+++ b/src/devlist.cpp<br />@@ -146,11 +146,12 @@ void collect_open_devices(void)<br /> if (!dev)<br /> continue;<br /> dev->pid = strtoull(entry->d_name, NULL, 10);<br />- strncpy(dev->device, link, 251);<br />+ strncpy(dev->device, link, 250);<br />+ dev->device[251] = 0x00;<br /> sprintf(filename, "/proc/%s/comm", entry->d_name);<br />- strncpy(dev->comm, read_sysfs_string("/proc/%s/comm", entry->d_name).c_str(), 31);<br />+ strncpy(dev->comm, read_sysfs_string("/proc/%s/comm", entry->d_name).c_str(), 30);<br />+ dev->comm[31] = 0x00;<br /> target->push_back(dev);<br />-<br /> }<br /> }<br /> closedir(dir2);<br /><br /></pre></blockquote></div></body></html>