[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SRU] update for powertop in 6.0.1



Hi Adam

On Tue, Jun 26, 2012 at 07:31:00PM +0200, Salvatore Bonaccorso wrote:
> Hi
> 
> On Fri, Apr 06, 2012 at 09:42:54PM +0100, Adam D. Barratt wrote:
> > On Tue, 2011-11-22 at 21:26 +0000, Adam D. Barratt wrote:
> > > On Wed, 2011-10-19 at 18:18 +0200, Philipp Kern wrote:
> > > > On Thu, Mar 17, 2011 at 01:39:03PM +0100, Patrick Winnertz wrote:
> > > > > > Impressive design.  What would happen if it skips half of the "config"?  I
> > > > > > agree that not segfaulting is incredibly better than segfaulting, but like
> > > > > > this the remaining bunch of lines will be silently ignored?
> > > > > I've rewritten the patch from Mel Gorman, now you'll get a printf output on 
> > > > > the console if the config file is too large (and powertop will abort). 
> > > > > Please have a look on the updated debdiff attached to this mail.
> > > > 
> > > > Bug reports are much easier to track.  Please go ahead and sorry for
> > > > the delay.
> > > 
> > > Ping?
> > 
> > Re-ping.
> 
> Is there something one can help for getting this into a stable point
> release?
> 
> @Release-Team: I know you will be more busy for the wheezy release
> now!

As discussed last week shortly on IRC, attached is now the debdiff
(only changed changelog entry to reflect NMU) for powertop.

(I have added winnie@debian.org to recipient lists)

Can I upload this?

Regards,
Salvatore
diff -u powertop-1.11/debian/changelog powertop-1.11/debian/changelog
--- powertop-1.11/debian/changelog
+++ powertop-1.11/debian/changelog
@@ -1,3 +1,14 @@
+powertop (1.11-1+squeeze1) stable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix segfault on newer kernels with large config files.
+    Thanks to Mel Gorman (Closes: #610101) 
+    NMU upload prepared with debdiff created by Patrick Winnertz
+    <winnie@debian.org> and found on debian-release mailing list.
+    http://lists.debian.org/debian-release/2011/03/msg00292.html
+
+ -- Salvatore Bonaccorso <carnil@debian.org>  Sun, 01 Jul 2012 13:12:05 +0200
+
 powertop (1.11-1) unstable; urgency=low
 
   * New upstream release
@@ -188 +198,0 @@
-
diff -u powertop-1.11/debian/patches/00list powertop-1.11/debian/patches/00list
--- powertop-1.11/debian/patches/00list
+++ powertop-1.11/debian/patches/00list
@@ -1,0 +2 @@
+increase-configlimit.dpatch
only in patch2:
unchanged:
--- powertop-1.11.orig/debian/patches/increase-configlimit.dpatch
+++ powertop-1.11/debian/patches/increase-configlimit.dpatch
@@ -0,0 +1,59 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## increase-configlimit.patch.dpatch by  <mel@csn.ul.ie>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' powertop-1.11~/config.c powertop-1.11/config.c
+--- powertop-1.11~/config.c	2011-03-11 19:06:28.000000000 +0100
++++ powertop-1.11/config.c	2011-03-17 13:23:23.969122826 +0100
+@@ -33,9 +33,14 @@
+ #include "powertop.h"
+ 
+ /* static arrays are not nice programming.. but they're easy */
+-static char configlines[5000][100];
++static char configlines[MAXCONFIGLINES][100];
+ static int configcount;
+ 
++static void cleanup_curses_w_errormsg(void) {
++	endwin();
++	printf(_("Your kernel config exceeds the limit of %i lines, aborting!\n"),MAXCONFIGLINES);
++}
++
+ static void read_kernel_config(void)
+ {
+ 	FILE *file;
+@@ -49,6 +54,10 @@
+ 			char line[100];
+ 			if (fgets(line, 100, file) == NULL)
+ 				break;
++			if (configcount >= MAXCONFIGLINES) {
++				atexit(cleanup_curses_w_errormsg);
++				exit(EXIT_FAILURE);
++			}
+ 			strcpy(configlines[configcount++], line);
+ 		}
+ 		pclose(file);
+@@ -77,6 +86,10 @@
+ 		char line[100];
+ 		if (fgets(line, 100, file) == NULL)
+ 			break;
++		if (configcount >= MAXCONFIGLINES) {
++			atexit(cleanup_curses_w_errormsg);
++			exit(EXIT_FAILURE);
++		}
+ 		strcpy(configlines[configcount++], line);
+ 	}
+ 	fclose(file);
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' powertop-1.11~/powertop.h powertop-1.11/powertop.h
+--- powertop-1.11~/powertop.h	2008-12-30 19:52:54.000000000 +0100
++++ powertop-1.11/powertop.h	2011-03-17 13:23:35.981182381 +0100
+@@ -88,6 +88,7 @@
+ 
+ #define _(STRING)    gettext(STRING)
+ 
++#define MAXCONFIGLINES 10000
+ 
+ #define PT_COLOR_DEFAULT    1
+ #define PT_COLOR_HEADER_BAR 2

Attachment: signature.asc
Description: Digital signature


Reply to: