Hi,

With Exec-Shield in place, the Kernel automatically adjusts the stack downward
by a random amount of bytes. This will cause the test failed occasionally on
IA-32, because the 11th requested chunk of address space (bfe00000-bff00000)
has already been used by the stack. For example, stack could be at
bfe0b000-bfe20000, and then, shmat(2) failed,

 mykey to uniquely identify the shared memory segment 0x451005ae

 Get shared memory segment (1048576 bytes)

 Attach shared memory segment to process
ERROR [line: 205] shmat failed - return: 0xffffffff: Invalid argument

It looks like the stack adjustment has a range that it could be chosen, so I
changed the start of 11th address space to a lower address. Tests showed that
the stack will not go downward that much.

In addition, there are a few minor fixes,
- keep the width of comments within 72 characters.
- remove unnecessary 0x prefix.

Cai Qian

Signed-off-by: CAI Qian <[EMAIL PROTECTED]>

--- testcases/kernel/ipc/ipc_stress/shmem_test_06.c.orig        2008-10-07 
17:41:31.624446064 +0800
+++ testcases/kernel/ipc/ipc_stress/shmem_test_06.c     2008-10-08 
18:58:23.223863675 +0800
@@ -1,11 +1,12 @@
 /*
  *   Copyright (C) Bull S.A. 1996
  *   Copyright (c) International Business Machines  Corp., 2001
+ *   Copyright (C) 2008 CAI Qian <[EMAIL PROTECTED]>
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License as
+ *   published by the Free Software Foundation; either version 2 of the
+ *   License, or (at your option) any later version.
  *
  *   This program is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
@@ -13,8 +14,9 @@
  *   the GNU General Public License for more details.
  *
  *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ *   USA
  */
 /*---------------------------------------------------------------------+
 |                           shmem_test_06.c                            |
@@ -26,8 +28,7 @@
 |               0x3 to 0xC and 0xE .                                   |
 |                                                                      |
 | Description:  Simplistic test to verify that a process can obtain    |
-|               11 shared memory regions in the adress space from      |
-|               0x30000000 to 0xCFFFFFFF and 0xE0000000 to 0xEFFFFFFF. |
+|               11 shared memory regions.                              |
 |                                                                      |
 |                                                                      |
 | Algorithm:    *  from 1 up to 11                                     |
@@ -90,7 +91,7 @@
 0x90000000,
 0xA0000000,
 0xB0000000,
-0xBFE00000,
+0xBF000000,
 };
 int offsets_cnt = sizeof (offsets) /sizeof (offsets[0]);
 /* Defines
@@ -206,7 +207,7 @@
        }
 
       
-      printf ("\n\tShared memory segment address : 0x%p \n",shmptr[i]);
+      printf ("\n\tShared memory segment address : %p \n",shmptr[i]);
       
       printf ("\n\tIndex through shared memory segment ...\n");
       

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to