Skip to contentSkip to conversation

Issue with rt_sigqueueinfo testcase in LTP.

LTP In review rohit verma 5 participants 7 messages Aug 4, 2009 – Aug 14, 2009 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

FYI...

---------- Forwarded message ----------
From: Subrata Modak <[email protected]>
Date: Tue, Aug 4, 2009 at 5:37 PM
Subject: Re: Issue with rt_sigqueueinfo testcase in LTP.
To: rohit verma <[email protected]>
Cc: [email protected]

Hi Rohit,

Quoted 37 lines · rohit verma

Dear Manas Kumar Nayak,

I have found an issue with rt_sigqueueinfo test-case.

Following is the test output:

rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted rt_sigqueueinfo01    0  WARN  :  tst_rmdir(): rmobj(/tmp/rt_3FaSpK)
failed: lstat(/tmp/rt_3FaSpK) failed; errno=2: No such file or directory

I think the following lines are causing the failures:

(Line - 164)

uinfo.si_errno = 0;
uinfo.si_code = 0;//SI_USER
TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));

Reason -

You can observe the following comment & source when you look at the Linux source (v 2.6.29)
(linux-2.6.29/kernel/signal.c)

          /* Not even root can pretend to send signals from the kernel. Nor can they impersonate a kill(), which adds source info.  */ if (info.si_code >= 0)
                return -EPERM;

which implies that si_code cannot be set to ' 0 ' (SI_USER) when invoking the rt_sigqueueinfo syscall.

Quoted 5 lines

I am not sure how to fix this issue. But, a possible fix would be to remove the second set of fork &
rt_sigqueueinfo invocations and use the first set (with SI_QUEUE). If needed, the loop count can be
increased.

Please propose this over to the mailing list. Manas has just ported the test case from Crackerjack to LTP. He may not be exactly aware of the issues, as it was a blind port, which in one way was good, as the porting generated issues, people interested discussed and solved them ;-)

Regards--
Subrata

Quoted 2 lines
Signature · 12 lines
Regards,
Rohit

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#3 lore raw

I can confirm that fault too - on Microblaze and x86 too. The funny thing is that this test failed but it is reported as passed in log.

Michal

Quoted 75 lines

FYI...

---------- Forwarded message ----------
From: Subrata Modak <[email protected]>
Date: Tue, Aug 4, 2009 at 5:37 PM
Subject: Re: Issue with rt_sigqueueinfo testcase in LTP.
To: rohit verma <[email protected]>
Cc: [email protected]

Hi Rohit,

Quoted 37 lines · rohit verma

Dear Manas Kumar Nayak,

I have found an issue with rt_sigqueueinfo test-case.

Following is the test output:

rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted
rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted
rt_sigqueueinfo01    0  WARN  :  tst_rmdir(): rmobj(/tmp/rt_3FaSpK)
failed: lstat(/tmp/rt_3FaSpK) failed; errno=2: No such file or

directory

I think the following lines are causing the failures:

(Line - 164)

uinfo.si_errno = 0;
uinfo.si_code = 0;//SI_USER
TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));

Reason -

You can observe the following comment & source when you look at the Linux source (v 2.6.29)
(linux-2.6.29/kernel/signal.c)

          /* Not even root can pretend to send signals from the kernel.
           Nor can they impersonate a kill(), which adds source info.  */
        if (info.si_code >= 0)
                return -EPERM;

which implies that si_code cannot be set to ' 0 ' (SI_USER) when invoking the rt_sigqueueinfo syscall.

Quoted 6 lines

I am not sure how to fix this issue. But, a possible fix would be to remove the second set of fork &
rt_sigqueueinfo invocations and use the first set (with SI_QUEUE). If needed, the loop count can be
increased.

Please propose this over to the mailing list. Manas has just ported the test case from Crackerjack to LTP. He may not be exactly aware of the issues, as it was a blind port, which in one way was good, as the porting generated issues, people interested discussed and solved them ;-)

Regards--
Subrata

Quoted 1 line
Signature · 14 lines
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#4 lore raw

PATCH 1/1 Issue with rt_sigqueueinfo testcase in LTP.

Yes, I had just noticed this as well. Since it was "passing", it took awhile to spot.

Returning pass even with tst_resm(TFAIL,.. Being called must have something to do with the forking, but I'm not familiar with how the LTP framework deals with that.

In any case, I've create this patch for our internal tree that does the following:
- cleans up spacing for tabs, it was mix of two before
- removes the second testcase which is I think is invalid (this gets rid of the bad return code as well).
- removed the inner loop, it doesn't make sense as the tst_exit in the original code would never let it run past the first loop.
- moved cleanup() and setup() to the appropriate places where they will only be called in pairs.

-----Original Message-----
From: Michal Simek [mailto:[email protected]]
Sent: Thursday, August 06, 2009 2:10 AM
To: rohit verma
Cc: ltp-list
Subject: Re: [LTP] Issue with rt_sigqueueinfo testcase in LTP.

I can confirm that fault too - on Microblaze and x86 too.
The funny thing is that this test failed but it is reported as passed in log.

Michal

Quoted 58 lines

FYI...

---------- Forwarded message ----------
From: Subrata Modak <[email protected]>
Date: Tue, Aug 4, 2009 at 5:37 PM
Subject: Re: Issue with rt_sigqueueinfo testcase in LTP.
To: rohit verma <[email protected]>
Cc: [email protected]

Hi Rohit,

Quoted 33 lines · rohit verma

Dear Manas Kumar Nayak,

I have found an issue with rt_sigqueueinfo test-case.

Following is the test output:

rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted
rt_sigqueueinfo01    1  PASS  :  Test Succeeded
rt_sigqueueinfo01    1  FAIL  :  Test Failed, errno=1 : Operation not permitted
rt_sigqueueinfo01    0  WARN  :  tst_rmdir(): rmobj(/tmp/rt_3FaSpK)
failed: lstat(/tmp/rt_3FaSpK) failed; errno=2: No such file or 

directory

I think the following lines are causing the failures:

(Line - 164)

uinfo.si_errno = 0;
uinfo.si_code = 0;//SI_USER
TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));

Reason -

You can observe the following comment & source when you look at the Linux source (v 2.6.29)
(linux-2.6.29/kernel/signal.c)

          /* Not even root can pretend to send signals from the kernel.
           Nor can they impersonate a kill(), which adds source info.  */
        if (info.si_code >= 0)
                return -EPERM;
Quoted 9 lines

which implies that si_code cannot be set to ' 0 ' (SI_USER) when invoking the rt_sigqueueinfo syscall.

I am not sure how to fix this issue. But, a possible fix would be to remove the second set of fork & rt_sigqueueinfo invocations and use the first set (with SI_QUEUE). If needed, the loop count can be increased.

Quoted 16 lines

Please propose this over to the mailing list. Manas has just ported the test case from Crackerjack to LTP. He may not be exactly aware of the issues, as it was a blind port, which in one way was good, as the porting generated issues, people interested discussed and solved them ;-)

Regards--
Subrata

Quoted 1 line

--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c +50 -74
diff -Nurp -x CVS ltp-20090531/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c ltp-wdir/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c
@@ -46,20 +46,19 @@
 #include <sys/syscall.h>
 #include <string.h>
 
-
 /* Harness Specific Include Files. */
 #include "test.h"
 #include "usctest.h"
 #include "linux_syscall_numbers.h"
 
 /* Extern Global Variables */
-extern int Tst_count;           /* counter for tst_xxx routines.         */
-extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+extern int Tst_count; /* counter for tst_xxx routines.         */
+extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */
 
 /* Global Variables */
-char *TCID = "rt_sigqueueinfo01";  /* Test program identifier.*/
-int  testno;
-int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+char *TCID = "rt_sigqueueinfo01"; /* Test program identifier.*/
+int testno;
+int TST_TOTAL = 2; /* total number of tests in this file.   */
 
 /* Extern Global Functions */
 /******************************************************************************/
@@ -80,12 +79,12 @@ int  TST_TOTAL = 2;                   /*
 /*                                                                            */
 /******************************************************************************/
 extern void cleanup() {
-        /* Remove tmp dir and all files in it */
-        TEST_CLEANUP;
-        tst_rmdir();
+	/* Remove tmp dir and all files in it */
+	TEST_CLEANUP;
+	tst_rmdir();
 
-        /* Exit with appropriate return code. */
-        tst_exit();
+	/* Exit with appropriate return code. */
+	tst_exit();
 }
 
 /* Local  Functions */
@@ -107,73 +106,50 @@ extern void cleanup() {
 /*                                                                            */
 /******************************************************************************/
 void setup() {
-        /* Capture signals if any */
-        /* Create temporary directories */
-        TEST_PAUSE;
-        tst_tmpdir();
+	/* Capture signals if any */
+	/* Create temporary directories */
+	TEST_PAUSE;
+	tst_tmpdir();
 }
 
-
 int main(int ac, char **av) {
 	int pid, retval;
-        pid = getpid();
-        siginfo_t uinfo;
-        int lc;                 /* loop counter */
-        char *msg;              /* message returned from parse_opts */
-	
-        /* parse standard options */
-        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
-             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
-             tst_exit();
-           }
-
-        setup();
-
-        /* Check looping state if -i option given */
-        for (lc = 0; TEST_LOOPING(lc); ++lc) {
-                Tst_count = 0;
-                for (testno = 0; testno < TST_TOTAL; ++testno) {
-			TEST(pid = fork());
-		        if(TEST_RETURN < 0){
-				tst_resm(TFAIL,"fork() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
-                        	cleanup();
-				tst_exit();
-		        } else if (TEST_RETURN == 0){
-				  uinfo.si_errno = 0;
-			          uinfo.si_code = -1;
-		                  TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));
-				   if(TEST_RETURN == 0){
-					tst_resm(TPASS,"Test Succeeded");
-					tst_exit();
-			          } else {
-					tst_resm(TFAIL,"Test Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
-	                        	cleanup();
-					tst_exit();
-		                    }
-		        }
-
+	pid = getpid();
+	siginfo_t uinfo;
+	int lc; /* loop counter */
+	char *msg; /* message returned from parse_opts */
+
+	/* parse standard options */
+	if ((msg = parse_opts(ac, av, (option_t *) NULL, NULL)) != (char *) NULL) {
+		tst_brkm(TBROK, tst_exit, "OPTION PARSING ERROR - %s", msg);
+	}
+
+	/* Check looping state if -i option given */
+	for (lc = 0; TEST_LOOPING(lc); ++lc) {
+		Tst_count = 0;
+		for (testno = 0; testno < TST_TOTAL; ++testno) {
 			TEST(pid = fork());
-                        if(TEST_RETURN < 0){
-                                tst_resm(TFAIL,"fork() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
-                                cleanup();
-                                tst_exit();
-                        } else if (TEST_RETURN == 0){
-                                  uinfo.si_errno = 0;
-                                  uinfo.si_code = 0;
-                                  TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));
-                                   if(TEST_RETURN == 0){
-                                        tst_resm(TPASS,"Test Succeeded");
-                                        tst_exit();
-                                  } else {
-                                        tst_resm(TFAIL,"Test Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
-                                        cleanup();
-                                        tst_exit();
-                                    }
-                        }
-
-                }
-	Tst_count++;
-        }	
-        tst_exit();
+			setup();
+			if (TEST_RETURN < 0) {
+				tst_resm(TFAIL, "fork() Failed, errno=%d : %s", TEST_ERRNO,
+						strerror(TEST_ERRNO));
+				cleanup();
+			} else if (TEST_RETURN == 0) {
+				uinfo.si_errno = 0;
+				uinfo.si_code = SI_QUEUE;
+				TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17,
+						&uinfo));
+				if (TEST_RETURN == 0) {
+					tst_resm(TPASS, "Test Succeeded");
+				} else {
+					tst_resm(TFAIL, "Test Failed, errno=%d : %s", TEST_ERRNO,
+							strerror(TEST_ERRNO));
+				}
+				cleanup();
+			}
+			tst_exit();
+		}
+		Tst_count++;
+	}
 }
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw
Quoted 3 lines · Henry Yei

Yes, I had just noticed this as well.  Since it was "passing", it took awhile to spot.

Returning pass even with tst_resm(TFAIL,.. Being called must have something to do with the forking, but I'm not familiar with how the LTP framework deals with that.

I don't think that's the problem. I think that the real problem is how the testcase itself is written, because I don't see any code that checks WIFEXITED and WIFSIGNALED (I would check for both those items when doing sigqueue), and I don't see where the child(ren) actually exit... HMMM...

Thoughts?
-Garrett

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#6 lore raw
Quoted 6 lines · Garrett Cooper
Quoted 3 lines · Henry Yei

Yes, I had just noticed this as well. Since it was "passing", it took awhile to spot.

Returning pass even with tst_resm(TFAIL,.. Being called must have something to do with the forking, but I'm not familiar with how the LTP framework deals with that.

I don't think that's the problem. I think that the real problem is how

The part of the problem is how and when are setup() and cleanup()s are handled.

Quoted 3 lines

the testcase itself is written, because I don't see any code that checks WIFEXITED and WIFSIGNALED (I would check for both those items when doing sigqueue), and I don't see where the child(ren) actually

Can you just add them up when you find time. Meanwhile i am checking in Henryś patch. Thanks.

Regards--
Subrata

Quoted 5 lines

exit... HMMM...

Thoughts?
-Garrett

Quoted 9 lines

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#7 lore raw

Hi,

I have checked Henryś patch for rt_sigqueueinfo on my system (Linux-2.6.29.1), It seems to be working fine.
I'm not sure about the parent- child syncronization that Garrett is talking about, haven't checked it thoroughly.

Quoted 37 lines · Subrata Modak
Quoted 6 lines · Garrett Cooper
Quoted 3 lines · Henry Yei

Yes, I had just noticed this as well.  Since it was "passing", it took awhile to spot.

Returning pass even with tst_resm(TFAIL,.. Being called must have something to do with the forking, but I'm not familiar with how the LTP framework deals with that.

I don't think that's the problem. I think that the real problem is how

The part of the problem is how and when are setup() and cleanup()s are handled.

Quoted 3 lines

the testcase itself is written, because I don't see any code that checks WIFEXITED and WIFSIGNALED (I would check for both those items when doing sigqueue), and I don't see where the child(ren) actually

Can you just add them up when you find time. Meanwhile i am checking in Henryś patch. Thanks.

Regards--
Subrata

Quoted 14 lines

exit... HMMM...

Thoughts?
-Garrett

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Signature · 12 lines
Regards,
Rohit

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#8 lore raw

-----Original Message-----
From: rohit verma [mailto:[email protected]]
Sent: Thursday, August 13, 2009 11:56 PM
To: [email protected]
Cc: Garrett Cooper; Henry Yei; ltp-list
Subject: Re: [LTP] [PATCH] Issue with rt_sigqueueinfo testcase in LTP.

Hi,

Quoted 2 lines

I have checked Henryś patch for rt_sigqueueinfo on my system (Linux-2.6.29.1), It seems to be >working fine. I'm not sure about the parent- child syncronization that Garrett is talking about, haven't checked >it thoroughly.

Fyi, my patch may have broken some standard LTP functionality, like running multiple copies (-n).

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list