Bug 64004

Summary: Bug shows up in raid1 component that appears to be a compiler bug
Product: [Retired] Red Hat Linux Reporter: alvin
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-04 23:22:13 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description alvin 2002-04-23 17:36:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.19-6.2.7.iplink2 i686)

Description of problem:
raid1.o will crash with a bad pointer but when a change is made that changes the
optimization and flow of the code the bug goes away.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
This uses gcc
 gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-101)

1. compile 2.4.x(X>9) kernel with raid1
2. test for crash
3. change code
4. compile
5. test
	

Additional info:

from raid1.c

        /* Find the disk which is closest */

        do {
                if (disk <= 0)
                        disk = conf->raid_disks;
                disk--;
                if ((conf->mirrors[disk].write_only) ||
                                (!conf->mirrors[disk].operational))

by changinging the code to:
        /* Find the disk which is closest */

        do {
                if (disk <= 0)
                        disk = conf->raid_disks;
                disk--;
                md_bugcheck(disk);
                if ((conf->mirrors[disk].write_only) ||
                                (!conf->mirrors[disk].operational))
                        continue;

the problem seems to go away.
the md_bugcheck is a routeine declaired in md.c that just returns.


raid1 will not load with a kernel built with this compiler and code.

Comment 1 Jakub Jelinek 2004-10-04 23:22:13 UTC
GCC 2.96-RH is now too old and there is not a self-contained testcase
for this.
If you manage to reproduce this with some recent GCC, please reopen.