From: Helge D. <de...@gm...> - 2006-12-20 22:44:41
|
Some shmt* testcases fail on Linux on PARISC/hppa: shmt02 2 FAIL : shmat Failed: shmid = 134709249, errno = 22 shmt04 1 FAIL : Error: shmat: shmid = 134774785, errno = 22 shmt05 1 FAIL : shmat shmt05 4 FAIL : shmctl Failed to remove: shmid = 134807553, errno = 22 shmt06 1 FAIL : Error: shmat: shmid = 134873090, errno = 22 shmt07 1 FAIL : Error: shmat: shmid = 134905858, errno = 22 shmt09 4 FAIL : Error: sbrk succeeded! ret = 0x0002d17f, curbrk = 0x0002e17f, The patch below fixes it like this: c3000:~/ltp-full-20061121/testcases/kernel/mem/shmt# for i in shmt?? ; do echo $i; ./$i; done shmt02 shmt02 1 PASS : shmget shmt02 2 PASS : shmat shmt02 3 PASS : Correct shared memory contents shmt03 shmt03 1 PASS : shmget shmt03 2 PASS : 1st shmat shmt03 3 PASS : 2nd shmat shmt03 4 PASS : Correct shared memory contents shmt04 shmt04 1 PASS : shmget,shmat shmt04 2 PASS : shmdt shmt05 shmt05 1 PASS : shmget & shmat shmt05 2 PASS : 2nd shmget & shmat shmt06 shmt06 1 PASS : shmget,shmat shmt06 2 PASS : shmdt shmt07 shmt07 1 PASS : shmget,shmat shmt07 2 PASS : cp & cp+1 correct shmt08 shmt08 1 PASS : shmget,shmat shmt08 2 PASS : shmdt shmt09 shmt09 1 PASS : sbrk, sbrk, shmget, shmat shmt09 2 PASS : sbrk, shmat shmt09 3 PASS : sbrk, shmat shmt09 4 PASS : sbrk shmt10 shmt10 1 PASS : shmat,shmdt Could you please apply the patch ? Helge PS: Please CC me on replies. --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt02.c.org 2006-12-20 22:46:47.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt02.c 2006-12-20 22:48:57.000000000 +0100 @@ -81,7 +81,7 @@ /* are we doing with ia64 or arm_arch_4t arch */ -#if defined (__ia64__) || defined (__ARM_ARCH_4T__) +#if defined (__ia64__) || defined (__ARM_ARCH_4T__) || defined(__hppa__) cp = (char *) shmat(shmid, (void *)NULL, 0); #else cp = (char *) shmat(shmid, (void *)0x80000, 0); --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt04.c.org 2006-12-20 22:46:56.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt04.c 2006-12-20 22:53:39.000000000 +0100 @@ -63,8 +63,16 @@ key_t key; sigset_t sigset; -#define ADDR1 (void *)0x40000000 +#if defined(__ia64__) +#define ADDR (void *)0x40000000 +#elif defined(__ARM_ARCH_4T__) +#define ADDR NULL +#elif defined(__hppa__) +#define ADDR (void *)0x1400000 +#else #define ADDR (void *)0x80000 +#endif + #define SIZE 16*1024 @@ -105,15 +113,8 @@ (void)kill(pid, SIGINT); } else { -#ifdef __ia64__ - cp = (char *) shmat(shmid, ADDR1, 0); -#elif defined(__ARM_ARCH_4T__) - cp = (char *) shmat(shmid, NULL, 0); -#else cp = (char *) shmat(shmid, ADDR, 0); -#endif - - if (cp == (char *)-1) { + if (cp == (char *)-1) { perror("shmat"); tst_resm(TFAIL, "Error: shmat: shmid = %d, errno = %d\n", @@ -183,14 +184,8 @@ } else { -#ifdef __ia64__ - cp = (char *) shmat(shmid, ADDR1, 0); -#elif defined(__ARM_ARCH_4T__) - cp = (char *) shmat(shmid, NULL, 0); -#else cp = (char *) shmat(shmid, ADDR, 0); -#endif - if (cp == (char *)-1) { + if (cp == (char *)-1) { perror("shmat:child process"); tst_resm(TFAIL, "Error: shmat: errno=%d, shmid=%d, child_pid=%d\n", --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt05.c.org 2006-12-20 22:47:04.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt05.c 2006-12-20 22:59:49.000000000 +0100 @@ -55,10 +55,18 @@ key_t key[2]; -#define ADDR (void *)0x80000 -#define ADDR1 (void *)0x80010 -#define ADDR_IA (void *)0x40000000 -#define ADDR1_IA (void *)0x40000010 + +#if defined(__ia64__) +#define ADDR (void *) 0x40000000 +#elif defined(__ARM_ARCH_4T__) +#define ADDR (void *) NULL +#elif defined(__hppa__) +#define ADDR (void *) 0x1400000 +#else +#define ADDR (void *) 0x80000 +#endif + +#define ADDR1 (void *) (((unsigned long)ADDR) + 0x10) #define SIZE 16*1024 @@ -83,13 +91,7 @@ "Error: shmget: shmid = %d, errno = %d\n", shmid, errno) ; } else { -#ifdef __ia64__ - cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) - cp = (char *) shmat(shmid, (void *)NULL, 0); -#else cp = (char *) shmat(shmid, ADDR, 0); -#endif if (cp == (char *)-1) { tst_resm(TFAIL,"shmat"); rm_shm(shmid) ; @@ -107,9 +109,7 @@ "Error: shmget: shmid1 = %d, errno = %d\n", shmid1, errno) ; } else { -#ifdef __ia64__ - cp1 = (char *) shmat(shmid1, ADDR1_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#if defined(__ARM_ARCH_4T__) cp1 = (char *) shmat(shmid1, (void *)NULL, 0); #else cp1 = (char *) shmat(shmid1, ADDR1, 0); --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt06.c.org 2006-12-20 22:47:11.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt06.c 2006-12-20 23:10:46.000000000 +0100 @@ -47,12 +47,21 @@ #include <stdlib.h> #include <unistd.h> -#define ADDR (void *)0x80000 -#define ADDR1 (void *)0xA0000 -#define ADDR_MIPS (void *)0x80000 -#define ADDR1_MIPS (void *)0xC0000 -#define ADDR_IA (void *)0x40000000 -#define ADDR1_IA (void *)0x50000000 + +#if defined(__ia64__) +#define ADDR (void *) 0x40000000 +#define ADDR1 (void *) 0x50000000 +#elif defined(__ARM_ARCH_4T__) || defined(__hppa__) +#define ADDR (void *) NULL +#define ADDR1 (void *) NULL +#elif defined(__mips__) +#define ADDR (void *) 0x80000 +#define ADDR1 (void *) 0xC0000 +#else +#define ADDR (void *) 0x80000 +#define ADDR1 (void *) 0xA0000 +#endif + #define SIZE 16*1024 /** LTP Port **/ @@ -105,15 +114,7 @@ (void)kill(pid, SIGINT); } else { -#ifdef __ia64__ - cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) - cp = (char *) shmat(shmid, (void*) NULL, 0); -#elif defined(__mips__) - cp = (char *) shmat(shmid, ADDR_MIPS, 0); -#else - cp = (char *) shmat(shmid, ADDR, 0); -#endif + cp = (char *) shmat(shmid, ADDR, 0); if (cp == (char *)-1) { perror("shmat") ; tst_resm(TFAIL, @@ -181,15 +182,7 @@ errno, shmid, chld_pid); } else { -#ifdef __ia64__ - cp = (char *) shmat(shmid, ADDR1_IA, 0); -#elif defined(__ARM_ARCH_4T__) - cp = (char *) shmat(shmid, (void *) NULL, 0); -#elif defined(__mips__) - cp = (char *) shmat(shmid, ADDR1_MIPS, 0); -#else - cp = (char *) shmat(shmid, ADDR1, 0); -#endif + cp = (char *) shmat(shmid, ADDR1, 0); if (cp == (char *)-1) { perror("shmat:child process"); tst_resm(TFAIL, --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt07.c.org 2006-12-20 22:47:17.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt07.c 2006-12-20 23:12:27.000000000 +0100 @@ -84,7 +84,7 @@ #ifdef __ia64__ cp = (char *) shmat(shmid, ADDR_IA, 0); -#elif defined(__ARM_ARCH_4T__) +#elif defined(__ARM_ARCH_4T__) || defined(__hppa__) cp = (char *) shmat(shmid, (void *) NULL, 0); #else cp = (char *) shmat(shmid, ADDR, 0); --- ltp-full-20061121/testcases/kernel/mem/shmt/shmt09.c.org 2006-12-20 22:47:22.000000000 +0100 +++ ltp-full-20061121/testcases/kernel/mem/shmt/shmt09.c 2006-12-20 23:22:59.000000000 +0100 @@ -68,7 +68,7 @@ char *c1=NULL, *c2=NULL, *c3=NULL; void *vp; int shmid; -#if defined(__ia64__) || defined(__mips__) +#if defined(__ia64__) || defined(__mips__) || defined(__hppa__) int increment; #endif key_t key; @@ -179,7 +179,7 @@ rm_shm(shmid); tst_exit(); } -#elif __mips__ +#elif defined(__mips__) || defined(__hppa__) increment=262144; /* 256Kb */ while ((vp = sbrk(increment)) != (void *)-1); if (errno != ENOMEM) { |