public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: "Mitani" <mitani@ryobi.co.jp>
To: ltp-list@lists.sourceforge.net
Cc: "當座 健市" <toza@ryobi.co.jp>
Subject: [LTP] [PATCH] fix "sigaction" tests
Date: Mon, 1 Nov 2010 15:22:05 +0900	[thread overview]
Message-ID: <000001cb798d$1aaa0210$4ffe0630$@co.jp> (raw)

[-- Attachment #1: Type: text/plain, Size: 9054 bytes --]

Hi,


POSIX "conformance/interfaces/sigaction/16-1" and other 25 tests failed
with following message:
------------
conformance/interfaces/sigaction/16-1: execution: FAILED: Output:
Caught signal 6
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-1.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-10: execution: FAILED: Output:
Caught signal 13
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-10.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-11: execution: FAILED: Output:
Caught signal 3
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-11.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-12: execution: FAILED: Output:
Caught signal 11
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-12.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-13: execution: FAILED: Output:
Caught signal 15
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-13.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-14: execution: FAILED: Output:
Caught signal 20
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-14.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-15: execution: FAILED: Output:
Caught signal 21
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-15.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-16: execution: FAILED: Output:
Caught signal 22
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-16.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-17: execution: FAILED: Output:
Caught signal 10
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-17.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-18: execution: FAILED: Output:
Caught signal 12
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-18.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-19: execution: FAILED: Output:
Caught signal 29
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-19.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-2: execution: FAILED: Output:
Caught signal 14
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-2.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-20: execution: FAILED: Output:
Caught signal 27
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-20.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-21: execution: FAILED: Output:
Caught signal 31
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-21.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-22: execution: FAILED: Output:
Caught signal 5
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-22.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-23: execution: FAILED: Output:
Caught signal 23
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-23.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-24: execution: FAILED: Output:
Caught signal 26
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-24.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-25: execution: FAILED: Output:
Caught signal 24
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-25.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-26: execution: FAILED: Output:
Caught signal 25
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-26.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-3: execution: FAILED: Output:
Caught signal 7
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-3.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-4: execution: FAILED: Output:
Caught signal 17
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-4.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-5: execution: FAILED: Output:
Caught signal 18
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-5.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-6: execution: FAILED: Output:
Caught signal 8
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-6.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-7: execution: FAILED: Output:
Caught signal 1
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-7.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-8: execution: FAILED: Output:
Caught signal 4
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-8.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-9: execution: FAILED: Output:
Caught signal 2
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-9.c FAILED: The
function returned EINTR while SA_RESTART is set
------------

Environment is as follows:
  - RHEL4.8 (kernel version 2.6.9-89)   --- (x86, x86_64, ia64)
  - RHEL5.5 (kernel version 2.6.18-194) --- (x86, x86_64, ia64)


The cause of above error is that sem_wait() of the testing kernel version
always returns with EINTR.

"man sem_wait" says:
------------
[...]

       EINTR  The call was interrupted by a signal handler.

[...]

NOTES
       A  signal handler always interrupts a blocked call to one of these
functions, regardless
       of the use of the sigaction(2) SA_RESTART flag.

POSIX.1-2001.
------------


And "man 7 signal" of "RHEL6.0 Beta"(*) says:
------------
       If a blocked call to one of the following interfaces is interrupted
by
       a  signal handler, then the call will be automatically restarted
after
       the signal handler returns if the SA_RESTART flag was used;
otherwise
       the call will fail with the error EINTR:

[...]

           * POSIX  semaphore  interfaces:  sem_wait(3)  and
sem_timedwait(3)
             (since Linux 2.6.22; beforehand, always failed with EINTR).

[...]

   Interruption of System Calls and Library Functions by Stop Signals
       On Linux, even in the absence of  signal  handlers,  certain
blocking
       interfaces  can fail with the error EINTR after the process is
stopped
       by one of the  stop  signals  and  then  resumed  via  SIGCONT.
This
       behavior is not sanctioned by POSIX.1, and doesn’t occur on other
sys-
       tems.

[...]

           * Linux 2.6.21 and earlier: futex(2) FUTEX_WAIT,
sem_timedwait(3),
             sem_wait(3).

------------
(*) -- Above description didn't exist in "man" of RHEL4.8/5.5.
       But "man" of RHEL6.0 Beta says that "sem_wait()" failed in the
       version earlier than Linux 2.6.22.


Therefore, These 26 tests are useful after 2.6.22 version, I think.

I tried to revised "testcases/open_posix_testsuite/conformance/interfaces/
sigaction/templates/template_16-1.in"

============
---
a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
template_16-1.in	2010-10-14 03:58:31.000000000 +0900
+++
b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
template_16-1.new	2010-10-18 17:47:40.000000000 +0900
@@ -55,6 +55,8 @@
 #include <signal.h>
 #include <errno.h>

+#include <sys/utsname.h>
+

/***************************************************************************
***/
 /***************************   Test framework
*******************************/

/***************************************************************************
***/
@@ -124,6 +126,23 @@
 	return NULL;
 }

+/* Checking for Kernel Version function */
+int kernel_ver_cmp(int k1, int k2, int k3)
+{
+	struct utsname buf;
+	int r1, r2, r3;
+
+	uname(&buf);
+	sscanf(buf.release, "%d.%d.%d", &r1, &r2, &r3);
+	if (r1 > k1)
+		return 0;
+	if (r2 > k2)
+		return 0;
+	if (r3 > k3)
+		return 0;
+	return 1;
+}
+
 /* main function */
 int main()
 {
@@ -133,6 +152,12 @@

 	struct sigaction sa;

+	/* Checking for Kernel Version */
+	if ( kernel_ver_cmp(2, 6, 21) != 0 )
+	{
+		UNTESTED( "sem_wait() returned EINTR on kernel versions
lower than 2.6.22" );
+	}
+
 	/* Initialize output */
 	output_init();

============

Above patch is revision only for templates.
The following procedure is necessary after applying patch:
------------
#cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
#./gentests.pl
------------

Similar revisions are necessary for other 25 "sigaction" tests.



Regards--

-Tomonori Mitani

[-- Attachment #2: template_16-1.patch --]
[-- Type: application/octet-stream, Size: 1285 bytes --]

--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in	2010-10-14 03:58:31.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.new	2010-10-18 17:47:40.000000000 +0900
@@ -55,6 +55,8 @@
 #include <signal.h>
 #include <errno.h>
 
+#include <sys/utsname.h>
+
 /******************************************************************************/
 /***************************   Test framework   *******************************/
 /******************************************************************************/
@@ -124,6 +126,23 @@
 	return NULL;
 }
 
+/* Checking for Kernel Version function */
+int kernel_ver_cmp(int k1, int k2, int k3)
+{
+	struct utsname buf;
+	int r1, r2, r3;
+
+	uname(&buf);
+	sscanf(buf.release, "%d.%d.%d", &r1, &r2, &r3);
+	if (r1 > k1)
+		return 0;
+	if (r2 > k2)
+		return 0;
+	if (r3 > k3)
+		return 0;
+	return 1;
+}
+
 /* main function */
 int main()
 {
@@ -133,6 +152,12 @@
 
 	struct sigaction sa;
 
+	/* Checking for Kernel Version */
+	if ( kernel_ver_cmp(2, 6, 21) != 0 )
+	{
+		UNTESTED( "sem_wait() returned EINTR on kernel versions lower than 2.6.22" );
+	}
+
 	/* Initialize output */
 	output_init();
 

[-- Attachment #3: Type: text/plain, Size: 415 bytes --]

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2010-11-01  6:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01  6:22 Mitani [this message]
2010-11-01  7:08 ` [LTP] [PATCH] fix "sigaction" tests Garrett Cooper
2010-11-01  8:00   ` Gui Jianfeng
2010-11-01  9:43     ` Garrett Cooper
2010-11-18  4:35       ` Bian Naimeng
2010-11-18  4:37         ` Garrett Cooper
2010-11-18  4:59           ` Bian Naimeng
2010-11-18  6:57             ` Mitani
2010-11-18  7:50               ` Bian Naimeng
2010-11-19 13:16             ` Cyril Hrubis
     [not found]               ` <4CE9CAE0.2070808@cn.fujitsu.com>
2010-11-25 18:44                 ` Cyril Hrubis
     [not found]                   ` <AANLkTim2rWksdiugWwFU_TRu44t5gqzHFwJPYLV-YdsY@mail.gmail.com>
2010-11-25 19:38                     ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001cb798d$1aaa0210$4ffe0630$@co.jp' \
    --to=mitani@ryobi.co.jp \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=toza@ryobi.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox