Bug 151245

Summary: LTP madvise02 testcase segfaults
Product: Red Hat Enterprise Linux 3 Reporter: Jay Turner <jturner>
Component: kernelAssignee: Don Howard <dhoward>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: petrides, riel, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-03-19 02:45:40 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:
Attachments:
Description Flags
madvise02.c code none

Description Jay Turner 2005-03-16 11:28:24 UTC
Description of problem:
Running ltp-full-20050307 against the 2.4.21-30.EL results in a sig11 in the
madvise02 testscript.  This testcase runs successfully on RHEL4
(2.6.9-5.0.3.EL.)  Might very well be a testcase issue, but nothing "looks"
obviously wrong at first blush.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jay Turner 2005-03-16 11:29:23 UTC
Created attachment 112047 [details]
madvise02.c code

Comment 2 Don Howard 2005-03-17 20:55:15 UTC
Running the testcase by hand I see all tests passing.

Comment 3 Don Howard 2005-03-17 20:58:32 UTC
$ sudo ./madvise02
madvise02    1  PASS  :  expected failure - errno = 22 : Invalid argument
madvise02    2  PASS  :  expected failure - errno = 22 : Invalid argument
madvise02    3  PASS  :  expected failure - errno = 22 : Invalid argument
madvise02    4  PASS  :  expected failure - errno = 12 : Cannot allocate memory
madvise02    5  PASS  :  expected failure - errno = 9 : Bad file descriptor


$ cat /etc/redhat-release
Red Hat Enterprise Linux WS release 3 (Taroon Update 4)
$ uname -a
Linux scarletbegonias 2.4.21-30.ELsmp #1 SMP Wed Mar 9 19:39:50 EST 2005 i686
i686 i386 GNU/Linux


Comment 4 Don Howard 2005-03-17 21:03:54 UTC
Is this fault happening on an arch other than x86?

Comment 5 Jay Turner 2005-03-18 07:44:09 UTC
I'm getting horrible with bug reports these days.  Seeing this on IA64.

Comment 6 Don Howard 2005-03-19 02:45:40 UTC
Looks like the crash is due to a typo bug in the testcase:


--- madvise02.c.orig    2005-03-18 21:32:22.000000000 -0500
+++ madvise02.c 2005-03-18 21:32:46.000000000 -0500
@@ -308,7 +308,7 @@ void check_and_print(int expected_errno)
                                TEST_ERRNO, strerror(TEST_ERRNO));
                } else {
                        tst_resm(TFAIL, "got errno = %d : %s",
-                               EINVAL, TEST_ERRNO, strerror(TEST_ERRNO));
+                                TEST_ERRNO, strerror(TEST_ERRNO));
                }
        } else {
                tst_resm(TFAIL, "madvise failed, expected "


With this patch the test now fails (but does not crash) at case 5 - this failure
also looks to be an ia64 specific bug in the test itself - on other arches
memory is allocated for this test, but not for ia64.   I don't follow why that
might be.

I can dig into this some more later if needed, but it's not a kernel bug.
Reopen this if you've got more questions.