summaryrefslogtreecommitdiff
path: root/tests/lib/libpthread/t_mutex.c
AgeCommit message (Collapse)Author
2022-05-07Bump timeout for slow machines.rin
2017-12-01Since there has been no objection (or even comment) in responsekre
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.
2017-04-01Make the mutex6 test (which fails every know and then, but too rarelymartin
to actually debug it) print some debug info when failing.
2017-03-23Avoid using an uninitialized mutex.martin
2017-03-05reenable mutex2 and mutex3 on powerpc now that PR 44387 is fixed.chs
2017-01-16PR/51888: Ngie Cooper: more error checking, missing includeschristos
2016-10-31more tests from kamilchristos
2016-10-31fix typoschristos
2016-10-31Merge and fix the timed mutex tests to use absolute time.christos
NB: the new tests are broken?
2016-10-30Add new test t_timedmutexkamil
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>.
2016-07-31we require root for sched_fifo, and more verbose messages.christos
2016-07-06fix uninitialized var.christos
2016-07-03GSoC 2016 Charles Cui: Implement thread priority protection based on workchristos
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).
2014-11-04PR misc/49356 remove unnecessary references to atf-c/config.hjustin
The function included via this header is not used and is removed in later versions of atf, so let us avoid it.
2014-02-09Use compiler builtins instead of atf_arch and atf_machine.jmmv
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.
2011-04-04Do only set a (lower than default) timeout value if we are on powerpc andmartin
expect to run into a real deadrun ofter. The (too short) timeout otherwise makes slower archs fail.
2011-02-21mutex2/mutex3 are expected to fail on powerpc because ofriz
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.
2011-02-20The mutex3 test is supposed to use a static initializer so that it differsjmmv
to the mutex2 test. This detail was lost during the atfification of these tests. Spotted by pooka@ and riz@.
2010-07-16Add missing pthread_mutex_init call in mutex3 testcase.njoly
2010-07-16Convert the libpthread tests to atf.jmmv
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.