public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [patch] madvise03 address issue
@ 2010-09-20  8:25 lina.zhao
  0 siblings, 0 replies; only message in thread
From: lina.zhao @ 2010-09-20  8:25 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

Hi,

In the ltp madvise03 case, it will allocate a share memory
whose size is equal to the max share memory value.
The max share memory value can be changed to a bigger one
through change /proc/sys/kernel/shmmax.
then the 0x22000000 is not a invalid address.
So change the address to NULL to let the system choose a valid address.

Thanks,

Lina

[-- Attachment #2: 0001-madvise03-address-issue.patch --]
[-- Type: text/x-diff, Size: 1569 bytes --]

From adbdd3f74ab425a654523234ca24034d40468519 Mon Sep 17 00:00:00 2001
From: Lina Zhao <lina.zhao@windriver.com>
Date: Mon, 20 Sep 2010 15:41:42 +0800
Subject: [PATCH] madvise03 address issue

In the ltp madvise03 case, it will allocate a share memory
whose size is equal to the max share memory value.
The max share memory value can be changed to a bigger one
through change /proc/sys/kernel/shmmax.
then the 0x22000000 is not a invalid address.
So change the address to NULL to let the system choose a valid address.

Signed-off-by: Lina Zhao <lina.zhao@windriver.com>
---
 testcases/kernel/syscalls/madvise/madvise03.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/madvise/madvise03.c b/testcases/kernel/syscalls/madvise/madvise03.c
index 2527865..269f292 100644
--- a/testcases/kernel/syscalls/madvise/madvise03.c
+++ b/testcases/kernel/syscalls/madvise/madvise03.c
@@ -203,14 +203,14 @@ int main(int argc, char *argv[])
 			tst_brkm(TBROK, cleanup, "shmget error");
 		}
 
-		/* Attach shared memory segment to 0x22000000 address */
+		/* Attach shared memory segment to random address */
 		if ((addr1 =
-		     shmat(shmid1, (void *)0x22000000, 0)) == (void *)-1) {
+		     shmat(shmid1, NULL, 0)) == (void *)-1) {
 			tst_brkm(TBROK, cleanup, "shmat error");
 		}
 
 		/*(1) Test case for MADV_REMOVE */
-		TEST(madvise((void *)0x22000000, 4096, MADV_REMOVE));
+		TEST(madvise((void *)addr1, 4096, MADV_REMOVE));
 		check_and_print("MADV_REMOVE");
 
 		/*(2) Test case for MADV_DONTFORK */
-- 
1.6.3.1


[-- Attachment #3: Type: text/plain, Size: 276 bytes --]

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-20  8:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-20  8:25 [LTP] [patch] madvise03 address issue lina.zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox