[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    Re: [LTP] Setgroups01_16 Test Failure
From:       Daniel Gollub <dgollub () suse ! de>
Date:       2008-10-20 12:14:28
Message-ID: 200810201414.29478.dgollub () suse ! de
[Download RAW message or body]

On Monday 20 October 2008 13:08:19 Subrata Modak wrote:
> On Mon, 2008-10-20 at 03:55 -0700, CAI Qian wrote:
> > Hi,
> > 
> > Setgroups01_16 test always fails for x86_64.
> > 
> > setgroups01_16    1  FAIL  :  setgroups(65536, list) Failed, errno=14 : Bad address
> > 
> 
> I also see this failure on x86_64:
> 
> uname -a
> Linux 2.6.27-autokern1 #1 SMP PREEMPT Mon Oct 20 07:30:55 UTC 2008
> x86_64 GNU/Linux
> 
> # ./testcases/bin/setgroups01_16
> setgroups01_16    1  FAIL  :  setgroups(65536, list) Failed, errno=14 :
> Bad address
> 
> 
> But Passes fine:
> 
> # ./testcases/bin/setgroups01_16
> setgroups01_16    1  PASS  :  setgroups(65536, list) returned 0
> 
> on:
> 1) uname -a
> Linux 2.6.27-autokern1 #1 SMP Mon Oct 20 07:31:24 UTC 2008 ppc64
> GNU/Linux
> 2) uname -a
> Linux 2.6.27-autokern1 #1 SMP Mon Oct 20 00:45:37 PDT 2008 i686
> GNU/Linux
> 3) uname -a
> Linux 2.6.27-autokern1 #1 SMP Mon Oct 20 07:40:06 UTC 2008 ppc64
> GNU/Linux
> 4) uname -a
> Linux 2.6.18-92.el5 #1 SMP Tue Apr 29 13:16:12 EDT 2008 i686 i686 i386
> GNU/Linux
> 
> 
> Not sure why ??

I just sent some patches for setgroups02_16 - looks like it's a similar
problem for setgroups01_16 (for some reason setgroups01_16 didn't failed for
me, only setgroups02_16)

Anyway, i guess the reason is the use of the uninitialized groups list and
passing the _full_ length to the syscalls.

Could you try attached patch?

best regards,
Daniel

---

Index: ltp-full-20081020/testcases/kernel/syscalls/setgroups/compat_16.h
===================================================================
--- ltp-full-20081020.orig/testcases/kernel/syscalls/setgroups/compat_16.h
+++ ltp-full-20081020/testcases/kernel/syscalls/setgroups/compat_16.h
@@ -54,7 +54,7 @@ GETGROUPS(size_t size16, GID_T *list16)
 	if (r < 0)
 	  goto out;
   
-	for (i = 0; i < size16; i++) {
+	for (i = 0; i < r; i++) {
 		if (!GID_SIZE_CHECK(list32[i]))
 		  tst_brkm(TBROK,
 			   cleanup,
Index: ltp-full-20081020/testcases/kernel/syscalls/setgroups/setgroups01.c
===================================================================
--- ltp-full-20081020.orig/testcases/kernel/syscalls/setgroups/setgroups01.c
+++ ltp-full-20081020/testcases/kernel/syscalls/setgroups/setgroups01.c
@@ -130,7 +130,7 @@ TCID_DEFINE(setgroups01); 	/* Test progr
 int TST_TOTAL=1;    		/* Total number of test cases. */
 extern int Tst_count;		/* Test Case counter for tst_* routines */
 
-int len = NGROUPS; 
+int len = NGROUPS, ngrps = 0; 
 GID_T list[NGROUPS];
 
 int
@@ -163,7 +163,7 @@ main(int ac, char **av)
 	/* 
 	 * Call setgroups(2) 
 	 */
-	TEST(SETGROUPS(len, list));
+	TEST(SETGROUPS(ngrps, list));
 	
 	/* check return code */
 	if ( TEST_RETURN == -1 ) {
@@ -205,7 +205,7 @@ setup()
     /* Pause if that option was specified */
     TEST_PAUSE;
 
-    if (GETGROUPS(len, list) == -1) {
+    if ((ngrps = GETGROUPS(len, list)) == -1) {
        tst_brkm(TBROK, cleanup,
 		"getgroups(%d, list) Failure. errno=%d : %s",
 		len, errno, strerror(errno));

-------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic