From: "lina.zhao" <lina.zhao@windriver.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] [patch] madvise03 address issue
Date: Mon, 20 Sep 2010 16:25:41 +0800 [thread overview]
Message-ID: <4C971A85.4030000@windriver.com> (raw)
[-- 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
reply other threads:[~2010-09-20 8:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C971A85.4030000@windriver.com \
--to=lina.zhao@windriver.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox