powertop: powertop.c:113: push_line_pid: Assertion `strlen(string) > 0' failed.

Bug #554983 reported by Zaki Manian
98
This bug affects 20 people
Affects Status Importance Assigned to Milestone
powertop (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: powertop

Powertop is routinely crashing on my Core i7 machine.

This message before crash

powertop: powertop.c:113: push_line_pid: Assertion `strlen(string) > 0' failed.
                                                                               Aborted (core dumped)

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: powertop 1.11+git20091208-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-18.27-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-18-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sat Apr 3 23:16:16 2010
EcryptfsInUse: Yes
InstallationMedia: Error: [Errno 13] Permission denied: '/var/log/installer/media-info'
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: powertop

Revision history for this message
Zaki Manian (zmanian) wrote :
Revision history for this message
Данило Шеган (danilo) wrote :

I usually see this with powertop when I plug the power cable in on a Lucid installation on Sony Vaio Z790 (core 2 duo) as wel.

Revision history for this message
Anthony Batchelor (toeknee) wrote :

For me, it usually happens when powertop is in the background. I've also had it happen when opening a new tab in terminator,

Changed in powertop (Ubuntu):
status: New → Confirmed
Revision history for this message
ischoegl (ischoegl) wrote :

'sudo powertop' crashes on lucid 64bit (both with/without power cord attached). The system is a thinkpad T410 (intel i5). No crash if run without root privileges.

Revision history for this message
Nicolás Wolovick (nwolovick) wrote :

I could not reproduce the situation that triggers the assert.
I have cloned the git repo

git clone git://git.moblin.org/powertop

And it is the same, always in the root account.
I have generated a coredump, but optimizations prevent to read some values.
Extrangely enough, putting in the Makefile no optimizations, seems to avoid such random failing assertion.

CFLAGS?=-O0 -g ${WARNFLAGS}

Does anyone can confirm this behaviour?

Revision history for this message
Nicolás Wolovick (nwolovick) wrote :

I have the following pattern.

-O0, -O3: no failing assert
-O1, -O2: failing assert

But no apparent reason since -O3 is a superset of -O2

gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
diff /tmp/O2-opts /tmp/O3-opts | grep enabled

> -fgcse-after-reload [enabled]
> -finline-functions [enabled]
> -fipa-cp-clone [enabled]
> -fpredictive-commoning [enabled]
> -ftree-vectorize [enabled]
> -funswitch-loops [enabled]

Revision history for this message
Nicolás Wolovick (nwolovick) wrote :

Here is a coredump and some analysis with gdb

Core was generated by `./powertop'.
Program terminated with signal 6, Aborted.
#0 0x00007f7f1f7f7a75 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
 in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0 0x00007f7f1f7f7a75 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007f7f1f7fb5c0 in *__GI_abort () at abort.c:92
#2 0x00007f7f1f7f0941 in *__GI___assert_fail (assertion=0x40c111 "strlen(string) > 0", file=<value optimized out>, line=113,
    function=0x40d5a8 "push_line_pid") at assert.c:81
#3 0x0000000000402b89 in push_line_pid (string=0x7fffdea8df80 "", cpu_count=<value optimized out>, disk_count=<value optimized out>,
    pid=0x7fffdea8ff80 "3552") at powertop.c:113
#4 0x000000000040a953 in parse_event (ptr=<value optimized out>, verbose=0) at perf.c:230
#5 0x000000000040aaf6 in parse_data_dirty_buffer () at perf.c:270
#6 0x0000000000405035 in main (argc=<value optimized out>, argv=<value optimized out>) at powertop.c:1089
(gdb) up
#1 0x00007f7f1f7fb5c0 in *__GI_abort () at abort.c:92
92 abort.c: No such file or directory.
 in abort.c
(gdb) up
#2 0x00007f7f1f7f0941 in *__GI___assert_fail (assertion=0x40c111 "strlen(string) > 0", file=<value optimized out>, line=113,
    function=0x40d5a8 "push_line_pid") at assert.c:81
81 assert.c: No such file or directory.
 in assert.c
(gdb) up
#3 0x0000000000402b89 in push_line_pid (string=0x7fffdea8df80 "", cpu_count=<value optimized out>, disk_count=<value optimized out>,
    pid=0x7fffdea8ff80 "3552") at powertop.c:113
113 assert(strlen(string) > 0);
(gdb) up
#4 0x000000000040a953 in parse_event (ptr=<value optimized out>, verbose=0) at perf.c:230
230 push_line_pid(line, 0, 1, pid);
(gdb) print line
$1 = "\000hromium-browse\000omium-browse' is writing to file 'History-journal' on /dev/sda7.\nThis prevents the disk from going to powersave mode.\000\000\000\227\004\201\037\177\177\000\000\260\342\250\336\377\177\000\000\243\005\201\037\177\177\000\000\002\000\000\000\000\000\000\000\070\000\000\000\061\000\000\000.\000\000\000\070\000\000\000\201\v\201\037\177\177\000\000 113909 10502746\000\000\000\000\000\000\000\240"...
(gdb)

Revision history for this message
Alex Bennée (ajbennee) wrote :

The core dump is because of the assertion failure. Somehow the processing of /proc/timer_stats has broken. I can't see anything obvious as to why. I'd suggest running it under valgrind and seeing if that throws up any warnings.

I have seen some other "interesting" core dumps on 10.04 in various libc string functions in other programs so I wouldn't rule out a library problem.

Revision history for this message
Kristofer (kbitner) wrote :

I have this issue with Lucid 64 bit on a lenovo T410 with core i7. I execute 'sudo powertop' and a couple of seconds later the only thing on the screen is the mouse cursor and the computer freezes.

Revision history for this message
Hasenkopf, Andreas (andi-hasenkopf) wrote :

Some have experienced this problem under 10.04, but not me. On my machine (Thinkpad X200, Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz) powertop was working fine on 10.04.
After installation of 11.04 powertop goes crazy on my machine, too.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.