History log of /netbsd-src/tests/lib/libpthread/t_mutex.c (Results 1 – 20 of 20)
Revision Date Author Comments
# a2cd51fb 07-May-2022 rin <rin@NetBSD.org>

Bump timeout for slow machines.


# e55c81dc 01-Dec-2017 kre <kre@NetBSD.org>

Since there has been no objection (or even comment) in response
to my message on tech-userlevel ...

Subject: tests/lib/libpthread/t_mutex:mutex6
Date: Thu, 23 Nov 2017 17:34:54 +0700
Mes

Since there has been no objection (or even comment) in response
to my message on tech-userlevel ...

Subject: tests/lib/libpthread/t_mutex:mutex6
Date: Thu, 23 Nov 2017 17:34:54 +0700
Message-ID: <28385.1511433294@andromeda.noi.kre.to>

which can be found at:
http://mail-index.netbsd.org/tech-userlevel/2017/11/23/msg011010.html

which analysed the mutex6 test case of this test, and concluded
that it was useless, nonsense, and broken (the whole test is just a
race - not even really using or testing mutexes), let it be henceforth
forever gone.

show more ...


# 75bf572a 01-Apr-2017 martin <martin@NetBSD.org>

Make the mutex6 test (which fails every know and then, but too rarely
to actually debug it) print some debug info when failing.


# 44424683 23-Mar-2017 martin <martin@NetBSD.org>

Avoid using an uninitialized mutex.


# 36c31375 05-Mar-2017 chs <chs@NetBSD.org>

reenable mutex2 and mutex3 on powerpc now that PR 44387 is fixed.


# ab92520e 16-Jan-2017 christos <christos@NetBSD.org>

PR/51888: Ngie Cooper: more error checking, missing includes


# b6bcbcb5 31-Oct-2016 christos <christos@NetBSD.org>

more tests from kamil


# 73f2b871 31-Oct-2016 christos <christos@NetBSD.org>

fix typos


# 179c7d3b 31-Oct-2016 christos <christos@NetBSD.org>

Merge and fix the timed mutex tests to use absolute time.
NB: the new tests are broken?


# 53e134ea 30-Oct-2016 kamil <kamil@NetBSD.org>

Add new test t_timedmutex

This test is a clone on t_mutex with additional two tests for timed-mutex
specific block.

All simple-mutex (not with the timed property according to the C11 wording)
speci

Add new test t_timedmutex

This test is a clone on t_mutex with additional two tests for timed-mutex
specific block.

All simple-mutex (not with the timed property according to the C11 wording)
specific tests are covered by pthread_mutex_timedlock(3) with parameter
ts_lengthy of sufficiently large tv_sec value (right now UINT16_MAX). If,
a test will hang, it won't wait UINT16_MAX seconds, but will be terminated
within the default timeout for ATF tests (right now 300 [sec] in my
NetBSD/amd64 setup).

This test was inspired by a classic selflock test failure of
pthread_mutex_timedlock(3) of the following form:

#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <time.h>

int main(int argc, char **argv)
{
pthread_mutex_t mtx;
struct timespec ts;

ts.tv_sec = 0;
ts.tv_nsec = 1000;
printf("ts{.tv_sec = %d, .tv_nsec=%ld}\n", ts.tv_sec, ts.tv_nsec);
fflush(stdout);

printf("mtx_init\n");
assert(pthread_mutex_init(&mtx, NULL) == 0);

printf("mtx_lock\n");
assert(pthread_mutex_lock(&mtx) == 0);

printf("mtx_timedlock\n");
assert(pthread_mutex_timedlock(&mtx, &ts) == ETIMEDOUT);

printf("mtx_unlock\n");
assert(pthread_mutex_unlock(&mtx) == 0);

printf("mtx_destroy\n");
assert(pthread_mutex_destroy(&mtx) == 0);

return 0;
}

Current NetBSD implementation wrongly hangs on this test.

The issue was detected during development of the C11 portable threads.

My local tests in chroot presents that the are further issues:

t_timedmutex (21/25): 10 test cases
mutex1: [0.001142s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:75: *param != 20
mutex2: [0.261499s] Passed.
mutex3: [0.261496s] Passed.
mutex4: [0.001204s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:265: pthread_mutex_timedlock(&mutex, &ts_lengthy): Connection timed out
mutex5: [0.001235s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:337: pthread_mutex_timedlock(&mutex5, &ts_lengthy): Connection timed out
mutex6: [21.218497s] Failed: /usr/src/tests/lib/libpthread/t_timedmutex.c:512: start != 1
mutexattr1: [0.001328s] Passed.
mutexattr2: [0.001175s] Passed.
timedmutex1: [301.119397s] Failed: Test case timed out after 300 seconds
timedmutex2: [301.123081s] Failed: Test case timed out after 300 seconds
[623.990659s]

I'm also receiveing the same failure in the mutex6 test in t_mutex, so
there might be a false positives due to local chroot(8) issues.

Commit approved by <christos>.

show more ...


# 59c5c6b5 31-Jul-2016 christos <christos@NetBSD.org>

we require root for sched_fifo, and more verbose messages.


# 82732dd2 06-Jul-2016 christos <christos@NetBSD.org>

fix uninitialized var.


# 7cf7644f 03-Jul-2016 christos <christos@NetBSD.org>

GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is d

GSoC 2016 Charles Cui: Implement thread priority protection based on work
by Andy Doran. Also document the get/set pshared thread calls as not
implemented, and add a skeleton implementation that is disabled.
XXX: document _sched_protect(2).

show more ...


# 97c0a6f6 04-Nov-2014 justin <justin@NetBSD.org>

PR misc/49356 remove unnecessary references to atf-c/config.h

The function included via this header is not used and is removed in
later versions of atf, so let us avoid it.


# e110dcc9 09-Feb-2014 jmmv <jmmv@NetBSD.org>

Use compiler builtins instead of atf_arch and atf_machine.

The atf_arch and atf_machine configuration variables were removed from
atf-0.19 without me realizing that some tests were querying them dir

Use compiler builtins instead of atf_arch and atf_machine.

The atf_arch and atf_machine configuration variables were removed from
atf-0.19 without me realizing that some tests were querying them directly.

Instead of reintroducing those variables, just rely on compiler builtins
as many other tests already do.

Should fix PR bin/48582.

show more ...


# b78cd4dd 04-Apr-2011 martin <martin@NetBSD.org>

Do only set a (lower than default) timeout value if we are on powerpc and
expect to run into a real deadrun ofter.
The (too short) timeout otherwise makes slower archs fail.


# 9613b94f 21-Feb-2011 riz <riz@NetBSD.org>

mutex2/mutex3 are expected to fail on powerpc because of
PR port-powerpc/44387.

XXX the ugly sleep at the end is because ATF will mark an un-triggered
race condition (ie, the test passes unexpectedl

mutex2/mutex3 are expected to fail on powerpc because of
PR port-powerpc/44387.

XXX the ugly sleep at the end is because ATF will mark an un-triggered
race condition (ie, the test passes unexpectedly) as a test failure otherwise.

show more ...


# 0553513a 20-Feb-2011 jmmv <jmmv@NetBSD.org>

The mutex3 test is supposed to use a static initializer so that it differs
to the mutex2 test. This detail was lost during the atfification of these
tests.

Spotted by pooka@ and riz@.


# ffa14f53 16-Jul-2010 njoly <njoly@NetBSD.org>

Add missing pthread_mutex_init call in mutex3 testcase.


# ac555471 16-Jul-2010 jmmv <jmmv@NetBSD.org>

Convert the libpthread tests to atf.
Initial work from the GSoC 2008 project by Lukasz Strzygowski.

I think that this, together with the previous conversion of librt, obsoletes
the tests in the sema

Convert the libpthread tests to atf.
Initial work from the GSoC 2008 project by Lukasz Strzygowski.

I think that this, together with the previous conversion of librt, obsoletes
the tests in the semaphore/ directory. Will investigate later.

show more ...