* [LTP] [PATCH] fix UNRESOLVED failures of pthread tests in open_posix_testsuite
@ 2009-09-04 1:35 Seiichi Ikarashi
2009-09-07 11:39 ` Subrata Modak
0 siblings, 1 reply; 2+ messages in thread
From: Seiichi Ikarashi @ 2009-09-04 1:35 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]
Hi,
I report a couple of "UNRESOLVED" failures of open_posix_testsuite in ltp
and send a patch for them.
I got following failures while executing open_posix_testsuite.
> conformance/interfaces/pthread_setschedparam/5-1: execution: UNRESOLVED: Output:
> [07:16:29]Test conformance/interfaces/pthread_setschedparam/5-1.c unresolved: got 22 (Invalid argument) on line 152 (Sem_post in signal handler 1)
> conformance/interfaces/pthread_detach/4-3: execution: UNRESOLVED: Output:
> *snip*
> [12:05:38]Test conformance/interfaces/pthread_detach/4-3.c unresolved: got 22 (Invalid argument) on line 157 (Sem_post in signal handler 1)
Both of them have wrong steps of its test preparation:
1. register signal handlers (just do sem_post()) for SIGUSR1/SIGUSR2.
2. block those signals
3. prepare something (sem_init()) for these signal handlers
4. send signals to itself from sub-threads.
They have a window of not-yet-prepared-for-signals
between step 1 and 2. I think above "UNRESOLVED" failures
(sem_post() before sem_init()) are the result of getting a
signal during this window.
I don't know who sent a signal to them but I guess
neighboring tests are suspects, because number of tests run
concurrently in open_posix_testsuite.
The fix shall be just delaying step 1 to between step 2 and 4,
so I wrote such a patch for both pthread_setschedparam and
pthread_detach. I have confirmed that this UNRESOLVED failure
disappeared with this patch applied.
Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
Regards,
[-- Attachment #2: opt_pthread.patch --]
[-- Type: text/x-patch, Size: 3372 bytes --]
Index: ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c,v
retrieving revision 1.3
diff -u -r1.3 4-3.c
--- ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c 3 Jun 2005 16:31:46 -0000 1.3
+++ ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c 4 Sep 2009 00:51:35 -0000
@@ -258,16 +258,6 @@
/* Initialize thread attribute objects */
scenar_init();
- /* We need to register the signal handlers for the PROCESS */
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = sighdl1;
- if ((ret = sigaction (SIGUSR1, &sa, NULL)))
- { UNRESOLVED(ret, "Unable to register signal handler1"); }
- sa.sa_handler = sighdl2;
- if ((ret = sigaction (SIGUSR2, &sa, NULL)))
- { UNRESOLVED(ret, "Unable to register signal handler2"); }
-
/* We prepare a signal set which includes SIGUSR1 and SIGUSR2 */
sigemptyset(&usersigs);
ret = sigaddset(&usersigs, SIGUSR1);
@@ -285,6 +275,16 @@
{ UNRESOLVED(errno, "Semsig2 init"); }
#endif
+ /* We need to register the signal handlers for the PROCESS */
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = 0;
+ sa.sa_handler = sighdl1;
+ if ((ret = sigaction (SIGUSR1, &sa, NULL)))
+ { UNRESOLVED(ret, "Unable to register signal handler1"); }
+ sa.sa_handler = sighdl2;
+ if ((ret = sigaction (SIGUSR2, &sa, NULL)))
+ { UNRESOLVED(ret, "Unable to register signal handler2"); }
+
if ((ret = pthread_create(&th_work, NULL, test, NULL)))
{ UNRESOLVED(ret, "Worker thread creation failed"); }
Index: ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c,v
retrieving revision 1.1
diff -u -r1.1 5-1.c
--- ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c 3 Jun 2005 16:32:47 -0000 1.1
+++ ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c 4 Sep 2009 00:51:35 -0000
@@ -224,23 +224,6 @@
/* Initialize output routine */
output_init();
- /* We need to register the signal handlers for the PROCESS */
- sigemptyset ( &sa.sa_mask );
- sa.sa_flags = 0;
- sa.sa_handler = sighdl1;
-
- if ( ( ret = sigaction ( SIGUSR1, &sa, NULL ) ) )
- {
- UNRESOLVED( ret, "Unable to register signal handler1" );
- }
-
- sa.sa_handler = sighdl2;
-
- if ( ( ret = sigaction ( SIGUSR2, &sa, NULL ) ) )
- {
- UNRESOLVED( ret, "Unable to register signal handler2" );
- }
-
/* We prepare a signal set which includes SIGUSR1 and SIGUSR2 */
sigemptyset( &usersigs );
@@ -274,6 +257,23 @@
#endif
+ /* We need to register the signal handlers for the PROCESS */
+ sigemptyset ( &sa.sa_mask );
+ sa.sa_flags = 0;
+ sa.sa_handler = sighdl1;
+
+ if ( ( ret = sigaction ( SIGUSR1, &sa, NULL ) ) )
+ {
+ UNRESOLVED( ret, "Unable to register signal handler1" );
+ }
+
+ sa.sa_handler = sighdl2;
+
+ if ( ( ret = sigaction ( SIGUSR2, &sa, NULL ) ) )
+ {
+ UNRESOLVED( ret, "Unable to register signal handler2" );
+ }
+
me = pthread_self();
if ( ( ret = pthread_create( &th_work, NULL, test, &me ) ) )
[-- Attachment #3: Type: text/plain, Size: 355 bytes --]
------------------------------------------------------------------------------
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
[-- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] fix UNRESOLVED failures of pthread tests in open_posix_testsuite
2009-09-04 1:35 [LTP] [PATCH] fix UNRESOLVED failures of pthread tests in open_posix_testsuite Seiichi Ikarashi
@ 2009-09-07 11:39 ` Subrata Modak
0 siblings, 0 replies; 2+ messages in thread
From: Subrata Modak @ 2009-09-07 11:39 UTC (permalink / raw)
To: Seiichi Ikarashi; +Cc: ltp-list
On Fri, 2009-09-04 at 10:35 +0900, Seiichi Ikarashi wrote:
> Hi,
>
> I report a couple of "UNRESOLVED" failures of open_posix_testsuite in ltp
> and send a patch for them.
>
> I got following failures while executing open_posix_testsuite.
>
> > conformance/interfaces/pthread_setschedparam/5-1: execution: UNRESOLVED: Output:
> > [07:16:29]Test conformance/interfaces/pthread_setschedparam/5-1.c unresolved: got 22 (Invalid argument) on line 152 (Sem_post in signal handler 1)
>
> > conformance/interfaces/pthread_detach/4-3: execution: UNRESOLVED: Output:
> > *snip*
> > [12:05:38]Test conformance/interfaces/pthread_detach/4-3.c unresolved: got 22 (Invalid argument) on line 157 (Sem_post in signal handler 1)
>
> Both of them have wrong steps of its test preparation:
> 1. register signal handlers (just do sem_post()) for SIGUSR1/SIGUSR2.
> 2. block those signals
> 3. prepare something (sem_init()) for these signal handlers
> 4. send signals to itself from sub-threads.
>
> They have a window of not-yet-prepared-for-signals
> between step 1 and 2. I think above "UNRESOLVED" failures
> (sem_post() before sem_init()) are the result of getting a
> signal during this window.
> I don't know who sent a signal to them but I guess
> neighboring tests are suspects, because number of tests run
> concurrently in open_posix_testsuite.
>
> The fix shall be just delaying step 1 to between step 2 and 4,
> so I wrote such a patch for both pthread_setschedparam and
> pthread_detach. I have confirmed that this UNRESOLVED failure
> disappeared with this patch applied.
>
> Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
Ok Thanks.
Regards--
Subrata
>
> Regards,
>
> ------------------------------------------------------------------------------
> 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 Ltp-list@lists.sourceforge.net 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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-09-07 11:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-04 1:35 [LTP] [PATCH] fix UNRESOLVED failures of pthread tests in open_posix_testsuite Seiichi Ikarashi
2009-09-07 11:39 ` Subrata Modak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox