All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-21 19:10 Harvey
  0 siblings, 0 replies; 10+ messages in thread
From: Harvey @ 2014-12-21 19:10 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 4314 bytes --]

Hope I am right here:

On Archlinux 64bit as well as 32bit systems powertop 2.7 crashes
reproducible like this when called with the parameter --auto-tune:

Steps to reproduce: Just try:

[root(a)teefax ~]# powertop --auto-tune
Loaded 0 prior measurements
Cannot load from file /var/cache/powertop/saved_parameters.powertop
RAPL device for cpu 0
RAPL device for cpu 0
RAPL device for cpu 0
Devfreq not enabled
Cannot load from file /var/cache/powertop/saved_parameters.powertop
unknown op '{'
Leaving PowerTOP
*** Error in `powertop': double free or corruption (!prev): 0x0975bc20 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x6b5c9)[0xb74685c9]
/usr/lib/libc.so.6(+0x71217)[0xb746e217]
/usr/lib/libc.so.6(+0x719ed)[0xb746e9ed]
/usr/lib/libc.so.6(closedir+0x23)[0xb74aafd3]
powertop[0x806fb31]
powertop[0x805758a]
powertop[0x804d36e]
/usr/lib/libc.so.6(__libc_start_main+0xde)[0xb7414e5e]
powertop[0x804e39d]
======= Memory map: ========
08048000-080bb000 r-xp 00000000 08:13 129320 /usr/bin/powertop
080bb000-080bc000 r--p 00072000 08:13 129320 /usr/bin/powertop
080bc000-080bd000 rw-p 00073000 08:13 129320 /usr/bin/powertop
080bd000-080bf000 rw-p 00000000 00:00 0
09529000-09ae7000 rw-p 00000000 00:00 0 [heap]
b73e1000-b73e4000 rw-p 00000000 00:00 0
b73e4000-b73f8000 r-xp 00000000 08:13 149123 /usr/lib/libresolv-2.20.so
b73f8000-b73f9000 ---p 00014000 08:13 149123 /usr/lib/libresolv-2.20.so
b73f9000-b73fa000 r--p 00014000 08:13 149123 /usr/lib/libresolv-2.20.so
b73fa000-b73fb000 rw-p 00015000 08:13 149123 /usr/lib/libresolv-2.20.so
b73fb000-b73fd000 rw-p 00000000 00:00 0
b73fd000-b75ae000 r-xp 00000000 08:13 149166 /usr/lib/libc-2.20.so
b75ae000-b75b1000 r--p 001b0000 08:13 149166 /usr/lib/libc-2.20.so
b75b1000-b75b3000 rw-p 001b3000 08:13 149166 /usr/lib/libc-2.20.so
b75b3000-b75b5000 rw-p 00000000 00:00 0
b75b5000-b75d1000 r-xp 00000000 08:13 159577 /usr/lib/libgcc_s.so.1
b75d1000-b75d2000 rw-p 0001b000 08:13 159577 /usr/lib/libgcc_s.so.1
b75d2000-b761d000 r-xp 00000000 08:13 149165 /usr/lib/libm-2.20.so
b761d000-b761e000 r--p 0004a000 08:13 149165 /usr/lib/libm-2.20.so
b761e000-b761f000 rw-p 0004b000 08:13 149165 /usr/lib/libm-2.20.so
b761f000-b7708000 r-xp 00000000 08:13 159583 /usr/lib/libstdc++.so.6.0.20
b7708000-b770c000 r--p 000e9000 08:13 159583 /usr/lib/libstdc++.so.6.0.20
b770c000-b770d000 rw-p 000ed000 08:13 159583 /usr/lib/libstdc++.so.6.0.20
b770d000-b7715000 rw-p 00000000 00:00 0
b7715000-b772d000 r-xp 00000000 08:13 149130 /usr/lib/libpthread-2.20.so
b772d000-b772e000 r--p 00017000 08:13 149130 /usr/lib/libpthread-2.20.so
b772e000-b772f000 rw-p 00018000 08:13 149130 /usr/lib/libpthread-2.20.so
b772f000-b7731000 rw-p 00000000 00:00 0
b7731000-b773d000 r-xp 00000000 08:13 137914 /usr/lib/libpci.so.3.3.0
b773d000-b773e000 r--p 0000b000 08:13 137914 /usr/lib/libpci.so.3.3.0
b773e000-b773f000 rw-p 0000c000 08:13 137914 /usr/lib/libpci.so.3.3.0
b773f000-b77a1000 r-xp 00000000 08:13 132783 /usr/lib/libncursesw.so.5.9
b77a1000-b77a3000 r--p 00062000 08:13 132783 /usr/lib/libncursesw.so.5.9
b77a3000-b77a4000 rw-p 00064000 08:13 132783 /usr/lib/libncursesw.so.5.9
b77a4000-b77c2000 r-xp 00000000 08:13 149793 /usr/lib/libnl-3.so.200.20.0
b77c2000-b77c3000 r--p 0001d000 08:13 149793 /usr/lib/libnl-3.so.200.20.0
b77c3000-b77c4000 rw-p 0001e000 08:13 149793 /usr/lib/libnl-3.so.200.20.0
b77c4000-b77c9000 r-xp 00000000 08:13 149794
/usr/lib/libnl-genl-3.so.200.20.0
b77c9000-b77ca000 r--p 00004000 08:13 149794
/usr/lib/libnl-genl-3.so.200.20.0
b77ca000-b77cb000 rw-p 00005000 08:13 149794
/usr/lib/libnl-genl-3.so.200.20.0
b77d6000-b77d8000 rw-p 00000000 00:00 0
b77d8000-b77da000 r--p 00000000 00:00 0 [vvar]
b77da000-b77db000 r-xp 00000000 00:00 0 [vdso]
b77db000-b77fc000 r-xp 00000000 08:13 149126 /usr/lib/ld-2.20.so
b77fc000-b77fd000 rw-p 00000000 00:00 0
b77fd000-b77fe000 r--p 00021000 08:13 149126 /usr/lib/ld-2.20.so
b77fe000-b77ff000 rw-p 00022000 08:13 149126 /usr/lib/ld-2.20.so
bfe80000-bfea1000 rw-p 00000000 00:00 0 [stack]
Aborted (core dumped)

See also Arch Bug report here:
https://bugs.archlinux.org/task/43150

They pointed me to this mailing list. Hope I am right here.

Harvey

-- 
I am root. If you see me laughing, you'd better have a backup!

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-21 21:25 Sami Kerola
  0 siblings, 0 replies; 10+ messages in thread
From: Sami Kerola @ 2014-12-21 21:25 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On 21 December 2014 at 19:10, Harvey <harv(a)gmx.de> wrote:
> Hope I am right here:
>
> On Archlinux 64bit as well as 32bit systems powertop 2.7 crashes
> reproducible like this when called with the parameter --auto-tune:

Hi Harvey,

Rather strange. I have up to date archlinux and the same does not
happen when I run --auto-tune.

I'm just a hobbyist contributor and I haven't cracked out how to know
where in code 'double free or corruption (!prev): 0x0975bc20' issue
happen. Could you compile the tool with debugging symbols, and
recreate issue the way we could see backtrace? That would make fixing
a lot easier.

cd /tmp
wget https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
tar xzf powertop-2.7.tar.gz
cd powertop-2.7
CXXLAGS="-O0 -g -ggdb -fno-omit-frame-pointer" ./configure
make -j3
sudo -i
cd /tmp/powertop-2.7
./src/powertop --auto-tune
[crash]
coredumpctl gdb
(gdb) bt full
<copy paste this output to reply>

-- 
Sami Kerola
http://www.iki.fi/kerolasa/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-22  0:15 Arjan van de Ven
  0 siblings, 0 replies; 10+ messages in thread
From: Arjan van de Ven @ 2014-12-22  0:15 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 807 bytes --]

> I'm just a hobbyist contributor and I haven't cracked out how to know
> where in code 'double free or corruption (!prev): 0x0975bc20' issue
> happen. Could you compile the tool with debugging symbols, and
> recreate issue the way we could see backtrace? That would make fixing
> a lot easier.
>
> cd /tmp
> wget https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
> tar xzf powertop-2.7.tar.gz
> cd powertop-2.7
> CXXLAGS="-O0 -g -ggdb -fno-omit-frame-pointer" ./configure
> make -j3
> sudo -i
> cd /tmp/powertop-2.7
> ./src/powertop --auto-tune
> [crash]
> coredumpctl gdb
> (gdb) bt full
> <copy paste this output to reply>

this would indeed be very helpful

another helpful thing could be to run "strace" on powertop, and c-n-p the last 20 lines or so



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-22  1:27 Joerg Mayer
  0 siblings, 0 replies; 10+ messages in thread
From: Joerg Mayer @ 2014-12-22  1:27 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]

On Sun, Dec 21, 2014 at 04:15:48PM -0800, Arjan van de Ven wrote:
> >I'm just a hobbyist contributor and I haven't cracked out how to know
> >where in code 'double free or corruption (!prev): 0x0975bc20' issue
> >happen. Could you compile the tool with debugging symbols, and
> >recreate issue the way we could see backtrace? That would make fixing
> >a lot easier.
> >
> >cd /tmp
> >wget https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
> >tar xzf powertop-2.7.tar.gz
> >cd powertop-2.7
> >CXXLAGS="-O0 -g -ggdb -fno-omit-frame-pointer" ./configure
> >make -j3
> >sudo -i
> >cd /tmp/powertop-2.7
> >./src/powertop --auto-tune
> >[crash]
> >coredumpctl gdb
> >(gdb) bt full
> ><copy paste this output to reply>
> 
> this would indeed be very helpful
> 
> another helpful thing could be to run "strace" on powertop, and c-n-p the last 20 lines or so

The fun with global variables. The following patch fixed this form me.

diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
index d2e56e3..4de5c9b 100644
--- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
                fprintf(stderr, "Devfreq not enabled\n");
                is_enabled = false;
                closedir(dir);
+               dir = NULL;
                return;
        }

Ciao
   Jörg
-- 
Joerg Mayer                                           <jmayer(a)loplof.de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-22 14:12 Harvey
  0 siblings, 0 replies; 10+ messages in thread
From: Harvey @ 2014-12-22 14:12 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Arjan,

> another helpful thing could be to run "strace" on powertop, and
> c-n-p the last 20 lines or so

I put a complete trace from an i686 system here:
http://pastebin.com/nxyR7FGr

Hope this helps

Harvey

- -- 
I am root. If you see me laughing, you'd better have a backup!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlSYJr0ACgkQi5aqmLBUSgk/1wCeP/sBVGV/IAQd3FyazuYhkthD
+xMAniSpY3+1mED+70JB+9ciTobso40G
=UzPq
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2014-12-22 14:26 Harvey
  0 siblings, 0 replies; 10+ messages in thread
From: Harvey @ 2014-12-22 14:26 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1882 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Hi Sami.

thank you for your answer.

>> On Archlinux 64bit as well as 32bit systems powertop 2.7 crashes 
>> reproducible like this when called with the parameter 
>> --auto-tune:
> 
> Rather strange. I have up to date archlinux and the same does not 
> happen when I run --auto-tune.

As of today the crash is gone on my x86_64 system (all testing repos
enabled). I guess you tried on x86_64, but not i686? Don't know why
its gone in x86_64, but anyway, i686 still crashes. And the headless
server I use powertop on to elegantly optimize power settings still
crashes when using powertop --auto-tune. The funny thing is that the
settings get optimized nevertheless as a call of powertop wihout
- --auto-tune parameter shows me.

> I'm just a hobbyist contributor and I haven't cracked out how to 
> know where in code 'double free or corruption (!prev): 0x0975bc20' 
> issue happen. Could you compile the tool with debugging symbols, 
> and recreate issue the way we could see backtrace? That would make 
> fixing a lot easier.
> 
> cd /tmp wget
> 
https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
> 
> 
tar xzf powertop-2.7.tar.gz
> cd powertop-2.7 CXXLAGS="-O0 -g -ggdb -fno-omit-frame-pointer" 
> ./configure make -j3 sudo -i cd /tmp/powertop-2.7 ./src/powertop 
> --auto-tune [crash] coredumpctl gdb (gdb) bt full <copy paste this 
> output to reply>

I tried this but there was no useful output due to missing debugging
symbols, I guess what do I have to do to enable those?

Thank you
Harvey


- -- I am root. If you see me laughing, you'd better have a backup!

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlSYKiYACgkQi5aqmLBUSgmtzwCfXHzmcyZuES5OlqR4oq4eF6TZ
QJQAn32UAso83cAUch03mNW1xWpIE7hc
=dV+X
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2015-01-22 21:50 Michael Mullin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Mullin @ 2015-01-22 21:50 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Please see the following patch to address the reported crash
- ---
- From e994a414f619410877023fce35ade12d1cfce68d Mon Sep 17 00:00:00 2001
From: Michael Mullin <masmullin(a)hush.com>
Date: Thu, 22 Jan 2015 16:33:31 -0500
Subject: [PATCH] If "dir" is closed early inside create_add_devfreq_devices()
 then there is a potential double free due to a second close during the
 cleanup phase in clear_all_devfreq()

Signed-off-by: Michael Mullin <masmullin(a)hush.com>

- ---
 src/devices/devfreq.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
index d2e56e3..f652a57 100644
- --- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
 		fprintf(stderr, "Devfreq not enabled\n");
 		is_enabled = false;
 		closedir(dir);
+		dir = NULL;
 		return;
 	}

@@ -327,6 +328,8 @@ void clear_all_devfreq()
 	}
 	all_devfreq.clear();
 	/* close /sys/class/devfreq */
- -	if (dir != NULL)
+	if (dir != NULL) {
 		closedir(dir);
+		dir = NULL;
+	}
 }
- -- 
2.2.2


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJUwXCLAAoJEJHz7fmWOTHsR2YH/3ASltE3MVMu7V6HoKYvGHFL
VsjQNenXTEYLSSiVMZfbZHaypHnH8SdhfJTBMHF1+v2fS2LzuEA/qFfleS39+L9S
E/EZGdCWXnrK56pa+Lu6JWguwCNmyhNyOQ+nnaU6v9jH0YmQGx5hMPZu/aPhlZTU
LWHxj0Knch1WGUATlofOy98XCbhY9yDICQxMDfJicun6cOAahlQminqJcLTSyGbY
t5lVWR2E1ybnpojlot8t2BRmCYR210VmB+Pbpralk+nSRtX2rx4yT/Hx5B3wBbwJ
msNs+6+6WKG20EVhxxbTSqLAar9ZMf8w+K8Qsz8Zqg4yzaGra3u6kl80Wr/ElqA=
=ObTH
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2015-01-22 23:32 Joerg Mayer
  0 siblings, 0 replies; 10+ messages in thread
From: Joerg Mayer @ 2015-01-22 23:32 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 3021 bytes --]

Hmm, it looks like nobody reacted to (and thus duplicated the work of):

Date: Mon, 22 Dec 2014 02:27:26 +0100                                                             
From: Joerg Mayer <jmpt(a)loplof.de>                                                                
To: powertop(a)ml01.01.org                                                                          
In-Reply-To: <549762B4.3090108(a)linux.intel.com>                                                   

Which contains the first part of the patch (the one causing the crash) but
not the second (which isn't *strictly* required but makes sense from a
"good style" point of view).

Did anyone but me actually see that message? I verified that I did receive it
back via the list (receive headers).

Thanks
   Jörg

On Thu, Jan 22, 2015 at 04:50:10PM -0500, Michael Mullin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
> Please see the following patch to address the reported crash
> - ---
> - From e994a414f619410877023fce35ade12d1cfce68d Mon Sep 17 00:00:00 2001
> From: Michael Mullin <masmullin(a)hush.com>
> Date: Thu, 22 Jan 2015 16:33:31 -0500
> Subject: [PATCH] If "dir" is closed early inside create_add_devfreq_devices()
>  then there is a potential double free due to a second close during the
>  cleanup phase in clear_all_devfreq()
> 
> Signed-off-by: Michael Mullin <masmullin(a)hush.com>
> 
> - ---
>  src/devices/devfreq.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
> index d2e56e3..f652a57 100644
> - --- a/src/devices/devfreq.cpp
> +++ b/src/devices/devfreq.cpp
> @@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
>  		fprintf(stderr, "Devfreq not enabled\n");
>  		is_enabled = false;
>  		closedir(dir);
> +		dir = NULL;
>  		return;
>  	}
> 
> @@ -327,6 +328,8 @@ void clear_all_devfreq()
>  	}
>  	all_devfreq.clear();
>  	/* close /sys/class/devfreq */
> - -	if (dir != NULL)
> +	if (dir != NULL) {
>  		closedir(dir);
> +		dir = NULL;
> +	}
>  }
> - -- 
> 2.2.2
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> 
> iQEcBAEBCAAGBQJUwXCLAAoJEJHz7fmWOTHsR2YH/3ASltE3MVMu7V6HoKYvGHFL
> VsjQNenXTEYLSSiVMZfbZHaypHnH8SdhfJTBMHF1+v2fS2LzuEA/qFfleS39+L9S
> E/EZGdCWXnrK56pa+Lu6JWguwCNmyhNyOQ+nnaU6v9jH0YmQGx5hMPZu/aPhlZTU
> LWHxj0Knch1WGUATlofOy98XCbhY9yDICQxMDfJicun6cOAahlQminqJcLTSyGbY
> t5lVWR2E1ybnpojlot8t2BRmCYR210VmB+Pbpralk+nSRtX2rx4yT/Hx5B3wBbwJ
> msNs+6+6WKG20EVhxxbTSqLAar9ZMf8w+K8Qsz8Zqg4yzaGra3u6kl80Wr/ElqA=
> =ObTH
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop

-- 
Joerg Mayer                                           <jmayer(a)loplof.de>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2015-01-22 23:43 Michael Mullin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Mullin @ 2015-01-22 23:43 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 2652 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I did not see your change before I posted the patch below.  However, I do see it now.
https://lists.01.org/pipermail/powertop/2014-December/001730.html

Joerg found it first.  Please take my patch as a verification of his.

On 01/22/2015 06:32 PM, Joerg Mayer wrote:
> Hmm, it looks like nobody reacted to (and thus duplicated the work of):
> 
> Date: Mon, 22 Dec 2014 02:27:26 +0100 From: Joerg Mayer <jmpt(a)loplof.de> To: powertop(a)ml01.01.org In-Reply-To: <549762B4.3090108(a)linux.intel.com>
> 
> Which contains the first part of the patch (the one causing the crash) but not the second (which isn't *strictly* required but makes sense from a "good style" point of view).
> 
> Did anyone but me actually see that message? I verified that I did receive it back via the list (receive headers).
> 
> Thanks Jörg
> 
> On Thu, Jan 22, 2015 at 04:50:10PM -0500, Michael Mullin wrote: Please see the following patch to address the reported crash --- From e994a414f619410877023fce35ade12d1cfce68d Mon Sep 17 00:00:00 2001 From: Michael Mullin <masmullin(a)hush.com> Date: Thu, 22 Jan 2015 16:33:31 -0500 Subject: [PATCH] If "dir" is closed early inside create_add_devfreq_devices() then there is a potential double free due to a second close during the cleanup phase in clear_all_devfreq()
> 
> Signed-off-by: Michael Mullin <masmullin(a)hush.com>
> 
> --- src/devices/devfreq.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp index d2e56e3..f652a57 100644 --- a/src/devices/devfreq.cpp +++ b/src/devices/devfreq.cpp @@ -247,6 +247,7 @@ void create_all_devfreq_devices(void) fprintf(stderr, "Devfreq not enabled\n"); is_enabled = false; closedir(dir); +		dir = NULL; return; }
> 
> @@ -327,6 +328,8 @@ void clear_all_devfreq() } all_devfreq.clear(); /* close /sys/class/devfreq */ -	if (dir != NULL) +	if (dir != NULL) { closedir(dir); +		dir = NULL; +	} }
>> 
>> _______________________________________________ PowerTop mailing list PowerTop(a)lists.01.org https://lists.01.org/mailman/listinfo/powertop
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJUwYsGAAoJEJHz7fmWOTHsKyAH/jlGevaIUil2FlGvkkGo4Y+U
xeQNfkVKQbtzpvYW8jKvp+3e08AfNpZIfHrhcholOA9YimV4QDCTLeMc56L89IIZ
CF1xXf+Li09cb9d52sdctHhwGuGAr9a951HqSumns3uyFVjYkhLDvrJQajOBONaI
m+h7qffm6R3VkBfieTHEAw+ywp74aVK5jnGeZGK/z2R2w2LE6aFR0tM2ABvUFARL
XenaceU0rFBYiSHd8LipKX4Y/qC3Nk0ExSGMMnXuLZ/pZ304wmogwqpT1ccr7s4n
iSFj+Jo3xYyW2OgceL/kw8N9V4kG4P6wXn1ACRX1Uo09ACsMCEcnx0xWopunpiU=
=0HBf
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Powertop] Powertop crashes with 'powertop --auto-tune'
@ 2015-01-28 23:38 Alexandra Yates
  0 siblings, 0 replies; 10+ messages in thread
From: Alexandra Yates @ 2015-01-28 23:38 UTC (permalink / raw
  To: powertop

[-- Attachment #1: Type: text/plain, Size: 3228 bytes --]


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> I did not see your change before I posted the patch below.  However, I do
> see it now.
> https://lists.01.org/pipermail/powertop/2014-December/001730.html
>
> Joerg found it first.  Please take my patch as a verification of his.
>
> On 01/22/2015 06:32 PM, Joerg Mayer wrote:
>> Hmm, it looks like nobody reacted to (and thus duplicated the work of):
>>
>> Date: Mon, 22 Dec 2014 02:27:26 +0100 From: Joerg Mayer <jmpt(a)loplof.de>
>> To: powertop(a)ml01.01.org In-Reply-To: <549762B4.3090108(a)linux.intel.com>
>>
>> Which contains the first part of the patch (the one causing the crash)
>> but not the second (which isn't *strictly* required but makes sense from
>> a "good style" point of view).
>>
>> Did anyone but me actually see that message? I verified that I did
>> receive it back via the list (receive headers).
>>
>> Thanks Jörg
>>
>> On Thu, Jan 22, 2015 at 04:50:10PM -0500, Michael Mullin wrote: Please
>> see the following patch to address the reported crash --- From
>> e994a414f619410877023fce35ade12d1cfce68d Mon Sep 17 00:00:00 2001 From:
>> Michael Mullin <masmullin(a)hush.com> Date: Thu, 22 Jan 2015 16:33:31
>> -0500 Subject: [PATCH] If "dir" is closed early inside
>> create_add_devfreq_devices() then there is a potential double free due
>> to a second close during the cleanup phase in clear_all_devfreq()
>>
>> Signed-off-by: Michael Mullin <masmullin(a)hush.com>
>>
>> --- src/devices/devfreq.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1
>> deletion(-)
>>
>> diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp index
>> d2e56e3..f652a57 100644 --- a/src/devices/devfreq.cpp +++
>> b/src/devices/devfreq.cpp @@ -247,6 +247,7 @@ void
>> create_all_devfreq_devices(void) fprintf(stderr, "Devfreq not
>> enabled\n"); is_enabled = false; closedir(dir); +		dir = NULL; return; }
>>
>> @@ -327,6 +328,8 @@ void clear_all_devfreq() } all_devfreq.clear(); /*
>> close /sys/class/devfreq */ -	if (dir != NULL) +	if (dir != NULL) {
>> closedir(dir); +		dir = NULL; +	} }
>>>
>>> _______________________________________________ PowerTop mailing list
>>> PowerTop(a)lists.01.org https://lists.01.org/mailman/listinfo/powertop
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBCAAGBQJUwYsGAAoJEJHz7fmWOTHsKyAH/jlGevaIUil2FlGvkkGo4Y+U
> xeQNfkVKQbtzpvYW8jKvp+3e08AfNpZIfHrhcholOA9YimV4QDCTLeMc56L89IIZ
> CF1xXf+Li09cb9d52sdctHhwGuGAr9a951HqSumns3uyFVjYkhLDvrJQajOBONaI
> m+h7qffm6R3VkBfieTHEAw+ywp74aVK5jnGeZGK/z2R2w2LE6aFR0tM2ABvUFARL
> XenaceU0rFBYiSHd8LipKX4Y/qC3Nk0ExSGMMnXuLZ/pZ304wmogwqpT1ccr7s4n
> iSFj+Jo3xYyW2OgceL/kw8N9V4kG4P6wXn1ACRX1Uo09ACsMCEcnx0xWopunpiU=
> =0HBf
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> PowerTop mailing list
> PowerTop(a)lists.01.org
> https://lists.01.org/mailman/listinfo/powertop
>

All,

Big apologies, I though I added Joerg's patch to upstream in December. 
I've added Michael's now, to include all changes.  I would appreciate if
you confirm that upstream is fixed now.


I will add a new release after the test are confirmed to work.

Thank you,
Alexandra.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-01-28 23:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 21:50 [Powertop] Powertop crashes with 'powertop --auto-tune' Michael Mullin
  -- strict thread matches above, loose matches on Subject: below --
2015-01-28 23:38 Alexandra Yates
2015-01-22 23:43 Michael Mullin
2015-01-22 23:32 Joerg Mayer
2014-12-22 14:26 Harvey
2014-12-22 14:12 Harvey
2014-12-22  1:27 Joerg Mayer
2014-12-22  0:15 Arjan van de Ven
2014-12-21 21:25 Sami Kerola
2014-12-21 19:10 Harvey

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.