Bug 548711 - [abrt] crash in procps-3.2.8-3.fc12
Summary: [abrt] crash in procps-3.2.8-3.fc12
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: procps
Version: 12
Hardware: i686
OS: Linux
low
medium
Target Milestone: ---
Assignee: Daniel Novotny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:31c88edc350304d85eb1a9bf85d...
Depends On:
Blocks: 585938
TreeView+ depends on / blocked
 
Reported: 2009-12-18 10:27 UTC by Michael Schwendt
Modified: 2010-04-26 13:41 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
: 585938 (view as bug list)
Environment:
Last Closed: 2010-01-11 14:31:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (2.12 KB, text/plain)
2009-12-18 10:27 UTC, Michael Schwendt
no flags Details
patch I mailed to upstream (2.45 KB, patch)
2010-01-09 15:06 UTC, Michael Schwendt
no flags Details | Diff

Description Michael Schwendt 2009-12-18 10:27:17 UTC
abrt 1.0.2 detected a crash.

How to reproduce
-----
1. Run /usr/bin/w in Electric Fence

Comment
-----
The problem is that in ./proc/sysinfo.c uptime(), it is not considered that the "savelocale" string is overwritten by the subsequent call to setlocale(). Hence restoring the locale later on won't work this way. "savelocale" ought to be a copy of the string pointed to by setlocale()'s return-value.

[...]
    char *restrict savelocale;

    FILE_TO_BUF(UPTIME_FILE,uptime_fd);
    savelocale = setlocale(LC_NUMERIC, NULL);
    setlocale(LC_NUMERIC,"C");
    if (sscanf(buf, "%lf %lf", &up, &idle) < 2) {
        setlocale(LC_NUMERIC,savelocale);
        fputs("bad data in " UPTIME_FILE "\n", stderr);
	    return 0;
    }
    setlocale(LC_NUMERIC,savelocale);
[...]

Attached file: backtrace
cmdline: w
component: procps
executable: /usr/bin/w
kernel: 2.6.31.6-166.fc12.i686
package: procps-3.2.8-3.fc12
rating: 4
reason: Process was terminated by signal 11 (Segmentation fault)

Comment 1 Michael Schwendt 2009-12-18 10:27:21 UTC
Created attachment 379180 [details]
File: backtrace

Comment 2 Michael Schwendt 2010-01-09 15:06:39 UTC
Created attachment 382658 [details]
patch I mailed to upstream

Comment 3 Daniel Novotny 2010-01-11 14:31:54 UTC
hello Michael,
thanks for the bug report and for the patch
fixed in rawhide: procps-3.2.8-5.fc13


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