Bug 246796 - Stack overflow detected when running powertop with de_DE.UTF-8 locale
Stack overflow detected when running powertop with de_DE.UTF-8 locale
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: powertop (Show other bugs)
7
All Linux
low Severity low
: ---
: ---
Assigned To: Adam Jackson
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-04 19:08 EDT by Till Maas
Modified: 2007-11-30 17:12 EST (History)
1 user (show)

See Also:
Fixed In Version: 1.7-3.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-12 19:38:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Backtrace of the error in gdb with powertop-debuginfo installed on F7 (2.58 KB, application/octet-stream)
2007-07-04 19:08 EDT, Till Maas
no flags Details
uses strncpy instead of strcpy for writing into status_bar_slots (2.56 KB, patch)
2007-07-04 20:54 EDT, Till Maas
no flags Details | Diff

  None (edit)
Description Till Maas 2007-07-04 19:08:56 EDT
Description of problem:

When I start powertop with LC_ALL=de_DE.UTF-8, after 5 seconds it says that a
stack overflow has been detected:

The problem seems to be here:
#6  0x0804cf21 in pick_suggestion () at suggestions.c:122
#7  0x0804acfd in main () at powertop.c:649

Version-Release number of selected component (if applicable):
1.5-1.fc7

How reproducible:
always

Steps to Reproduce:
1. run: LC_ALL=de_DE.UTF-8 powertop
  
Actual results:
Program terminates with backtrace/stack overflow detection warning (output attached)

Expected results:
A useful screen as it appears with LC_ALL=C
Comment 1 Till Maas 2007-07-04 19:08:56 EDT
Created attachment 158557 [details]
Backtrace of the error in gdb with powertop-debuginfo installed on F7
Comment 2 Josh Boyer 2007-07-04 19:45:17 EDT
1.5 is two releases behind.  I'll look at bumping powertop in F-7 to version 1.7
as soon as I can.  We'll see if that fixes it.
Comment 3 Till Maas 2007-07-04 20:29:34 EDT
(In reply to comment #2)
> 1.5 is two releases behind.  I'll look at bumping powertop in F-7 to version 1.7
> as soon as I can.  We'll see if that fixes it.

I compiled the spec from devel with "make i386" for F-7 and on another machine
there is pretty much the same error, the backtrace only shows another line
number for powertop.c:

#6  0x0804d791 in pick_suggestion () at suggestions.c:122
#7  0x0804ad1d in main () at powertop.c:676
Comment 4 Till Maas 2007-07-04 20:54:17 EDT
Created attachment 158569 [details]
uses strncpy instead of strcpy for writing into status_bar_slots

This patch fixes at least my issue. The problem is, that just strcpy is used to
write into status_bar_slots[9], which is 40 characters long. The localized
messages are one character longer. The patch changes all instances of strcpy
into strncpy and also defines constans STATUS_BAR_SLOTSIZE and
STATUS_BAR_NR_SLOTS for usage in strncpy. But I guess the complete source needs
further inspection for similiar bugs. And maybe the SLOTSIZE can be made
bigger, because I guess that some messages may be even longer.
Comment 5 Till Maas 2007-07-04 21:10:59 EDT
I also sent the patch to power bughost org, but I do not know, whether or not
they accept my mail without being subsribed to the list.
Comment 6 Till Maas 2007-07-05 07:49:46 EDT
I also found some typos in the german translation, if you want, I add the strcpy
and the translation patch to the devel branch. But I would increase the
STATUS_BAR_SLOTSIZE first, maybe to 60 characters, because there are several
hints, that are longer than 40 characters and would not be displayed completely
otherwise.
Comment 7 Adam Jackson 2007-07-09 14:01:46 EDT
Added that patch to 1.7-3.fc8, it'll bubble back to F-7 in an update.

Thanks!
Comment 8 Fedora Update System 2007-07-10 02:41:46 EDT
powertop-1.7-3.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2007-07-12 19:38:51 EDT
powertop-1.7-3.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.