Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 184992 - compiler warnings from the kernel for uninitialized variables, some of which can create indeterminate states
Summary: compiler warnings from the kernel for uninitialized variables, some of which ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 19:48 UTC by eric engstrom
Modified: 2007-07-11 21:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eric engstrom 2007-07-11 19:48:22 UTC
here are a list of the files with fully qualified paths.  i have also fixed them on my system and am attaching the fixes (which are simple hacks to avoid random results and to get the compiler to be quiet... but better than it is now).

file: arch/i386/mach-generic/../mach-es7000/es7000plat.c (appears it could be used uninitialized)
line: 193
var:  std.count uninitialized

file: arch/i386/kernel/cpu/transmeta.c (really could be used uninitialized)
line: 37
var:  cpu_freq

file: ipc/msg.c (compiler noise)
line: 
var:  setbuf.qbytes, setbuf.uid, setbuf.gid, setbuf.mode

file: ipc/sem.c (compiler noise)
line: 
var:  setbuf.uid, setbuf.gid, setbuf.mode

file: fs/jfs/jfs_txnmgr.c (appears by inspection that it could leave a linked list improperly terminated)
line:
var:  pxd.addr1, pxd.addr2, pxd.len

file: fs/udf/balloc.c (potential bug in filesystem by inspection)
line:
var:  goal_eloc.logicalBlockNum

file: fs/udf/super.c (potential bug by inspection)
line:
var:  ino.partitionReferenceNum

file: fs/xfs/xfs_bmap.c (compiler noise)
line:
var:  rtx

file: arch/i386/kernel/microcode.c (compiler noise)
line:
var:  new_mc

bug fixes follow in additional information for each of these.  some are not elegant but perserve the behavior of the existing code but eliminate the potentially random condition.

Reproducible: Always

Steps to Reproduce:
1. repro is easy if you recompile the kernel and >log just these errors will report to the console
2.
3.




es7000plat.c changes...
add line 168: sdt.count = 0;

transmeta.c changes...
add line 21: cpu_freq = 0;

msg.c changes...
add lines 395-398:
    setbug.qbytes =
    setbuf.uid =
    setbuf.gid =
    setbuf.mode = 0;

sem.c changes...
add lines 865-867:
    setbuf.uid =
    setbuf.gid =
    setbuf.mode = 0;

jfs_txnmgr.c changes...
add lines 1925-1927:
    pxd.len = 0;
    pxd.addr1 = 0;
    pxd.addr2 = 0;

balloc.c changes...
add lines 754-756:
    int    goal_eloc_initialized = 0; /* this is at the end of the variable declations */

    goal_eloc_.logicalBlockNum = 0;

add lines 809:
    goal_eloc_initialized = 1; /* this is at the end nspread < spread conditional block */

add lines 827-833:
    if( goal_eloc_initialized == 0 )
    {
        udf_release_data(goal_bh);
        mutex_unlock(&sbi->s_alloc_mutex);
        *err = -EDQUOT; /* not sure if this is the right error but it is a valid error */
        return 0;
    }
/* this stuff is added right before the line of code that reads... newblock = goal_eloc.logicalBlockNum; */

super.c changes...
add line 1364-1366:
    int partition_initialized = 0;

    ino.partitionReferenceNum = 0;

add line 1389: partition_initialized = 1; /* at the end of conditional block that starts with j != 1 */

add line 1400-1401:
    if( partition_initialized == 0 )
        return 1;

xfs_bmap.c changes...
move line...
    xfs_rtblock_t  rtx;  (near 2620 in declarations for xfs_bmap_rtalloc)
to 2660 inside the scope of the conditional block (ap->eof && ap->off == 0) where it is used and initialized it to zero.
    xfs_rtblock_t  rtx = 0;

microcode.c
change line 387 by adding an initialization to so it reads...
    void *new_mc = 0;
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-07-11 20:20:21 UTC
Sorry, I have no clue what's this bug about. Whatever it is, needs to be submitted upstream (as a unified diff, not as a description what to do :)
Comment 2 SpanKY gentoo-dev 2007-07-11 21:50:23 UTC
it's obviously about the kernel

eric: this sort of thing is best handled by e-mailing LKML with patches ... otherwise people will eventually fix it