Looking into failures for shmat01 and shmt09 I came upon sys/shm.h,
which defines SHMLBA.
Unfortunately it is set to the pagesize, which is wong as well.
I've opened glibc bug #6471 for this.

If I patch sys/shm.h to the cache size the shmat01 test succeeds.
shmt09 needs an additional patch to correct the sbrk increment to
the SHMLBA size, which you find attached.
I'll submit a patch for mmap01 later this week.

Best regards,
Martin

        Signed-off-by: Martin Habets <[EMAIL PROTECTED]>

On Wed, Apr 30, 2008 at 10:59:26PM +0100, Martin Habets wrote:
> LTP test mmap01 fails on sparc with:
> 
> mmap01      1  FAIL  :  mmap() Failed on mmapfile, errno=22
> 
> because the address passed in is only page aligned:
> 
>       /*
>        * Initialize addr to align with the first page boundary above the
>        * break address of the process.
>        */
>       addr = (void *) (((intptr_t)sbrk(0) + (page_sz - 1)) & ~(page_sz - 1));
> ...
>       addr = mmap(addr, page_sz, PROT_READ | PROT_WRITE,
>                   MAP_FILE|MAP_SHARED|MAP_FIXED, fildes, 0);
> 
> The address should be aligned to the value of SHMLBA as defined in
> asm/shmparam.h.
> See Documentation/cachetlb.txt for the explanation behind this.
> For most architectures this value is the page size, but not all.
> 
> Unfortunately asm/shmparam.h is not suitable for inclusion in user space
> programs. I looked at sysconf(LEVEL1_DCACHE_SIZE), but that returns 0 on
> sparc.
> Is there another solution other than hardcoding the exceptions in
> architecture specific code?
> 
> Thanks,
> Martin
Index: ltp/testcases/kernel/mem/shmt/shmt09.c
===================================================================
--- ltp.orig/testcases/kernel/mem/shmt/shmt09.c	2008-05-01 00:14:26.000000000 +0100
+++ ltp/testcases/kernel/mem/shmt/shmt09.c	2008-05-01 00:14:55.000000000 +0100
@@ -60,7 +60,7 @@
 
 #ifdef __ia64__
 #define INCREMENT 		8388608	/* 8Mb */
-#elif defined (__mips__)  ||  defined (__hppa__)
+#elif defined (__mips__)  ||  defined (__hppa__) || defined (__sparc__)
 #define INCREMENT		262144	/* 256Kb */
 #elif defined __sh__ || defined (__arm__)
 #define INCREMENT 		16384   /* 16kb */
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to