Remove pthread_barrier_wait_6-1 because it is unreliable
PATCH 1/1 Remove pthread_barrier_wait_6-1 because it is unreliable
The test is trying assert that an uninitialised argument is handled gracefully however the behavior of the interface is undefined when the argument has not been initialised. This test suite is supposed to verify that any given implementation conforms to the POSIX specification which by definition does not include undefined behavior.
The test is currently failing on Linux with glibc because the process is aborting for some reason other than a seg fault.
Due to security concerns, in some cases it is reasonable to assert that some forms of behavior, such as a NULL pointer dereference, are not acceptable even if the specification allows it. However, in order for the test to run reliably across all implementations, we need to be able to handle any other behavior an implementation is likely to choose. In this case the type of the argument is opaque and so we can't make any reasonable assumptions about how it will be handled. So then we have to handle all possible behavior and detect the scenarios we consider unacceptable.
We feel this is too much complication for a test which is testing something slightly outside of the test suites purpose.
--- .../interfaces/pthread_barrier_wait/6-1.c | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/6-1.c
testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/6-1.c deleted +0 -66
@@ -1,66 +0,0 @@ -/* -* Copyright (c) 2002, Intel Corporation. All rights reserved. -* This file is licensed under the GPL license. For the full content -* of this license, see the COPYING file at the top level of this -* source tree. -* -* pthread_barrier_wait() -* -* The pthread_barrier_wait() function may fail if: -* [EINVAL] The value specified by barrier does not refer to an initialized barrier object. -* -* This case will always pass. -*/ - -#define _XOPEN_SOURCE 600 -#include <pthread.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <signal.h> -#include <errno.h> -#include <string.h> -#include "posixtest.h" - -int rc; - -void sig_handler () -{ -printf - ("main: blocked on barrier wait with an un-initializied barrier object.\n" ); -printf - ("Test PASSED: Note*: Expected EINVAL when calling this funtion with an un-initialized barrier object, but standard says 'may' fail.\n" ); -exit (PTS_PASS ); -} - -int main (void ) -{ -pthread_barrier_t barrier; -struct sigaction act; - -/* Set up main thread to handle SIGALRM */ - act.sa_flags =0 ; - act.sa_handler = sig_handler; -sigfillset (&act.sa_mask); -sigaction (SIGALRM , &act,0 ); - -/* Intialize return code */ - rc =1 ; - -/* Call pthread_barrier_wait while refering to an un-initialized barrier object */ - -/* Just in case we are blocked, send a SIGALRM after 2 sec. */ -alarm (2 ); - - rc =pthread_barrier_wait (&barrier); - -if (rc ==EINVAL ) { -printf ("Test PASSED\n" ); - }else { -printf ("return code : %d, %s\n" , rc,strerror (rc)); -printf - ("Test PASSED: Note*: Expected EINVAL when calling this funtion with an un-initialized barrier object, but standard says 'may' fail.\n" ); - } - -return PTS_PASS ; -}
Signature · 1 line
2.15.1
PATCH 1/1 Remove pthread_barrier_wait_6-1 because it is unreliable
Hi!
[CCing Jan]
Jan can you please have a look to see if this can go in before the release? The test started to fail on newer glibc (due to changes in barrier implementation it ends up either with abort() of floating point exception) and it's IMHO broken by desing as Ritchard described.
Signature · 2 lines
Cyril Hrubis [email protected]
PATCH 1/1 Remove pthread_barrier_wait_6-1 because it is unreliable
----- Original Message -----
Quoted 7 lines
Hi!
[CCing Jan]Jan can you please have a look to see if this can go in before the release? The test started to fail on newer glibc (due to changes in barrier implementation it ends up either with
abort()of floating point exception) and it's IMHO broken by desing as Ritchard described.
Agreed - not worth the effort. I pushed the patch.
Regards,
Jan
Quoted 5 lines
--
Cyril Hrubis
[email protected]