aboutsummaryrefslogtreecommitdiff
path: root/contrib/netbsd-tests/lib/libpthread
Commit message (Collapse)AuthorAgeFilesLines
* h_resolv: Fix a buffer overflow in load().John Baldwin2022-12-281-5/+5
| | | | | | | | | | | | | | | | fgetln() returns a pointer to an array of characters that is 'len' characters long, not 'len + 1'. While here, overwriting the contents of the buffer returned by fgetln isn't really safe, so switch to using getline() instead. Note that these fixes are a subset of those applied to a near-identical copy of this function in libc's resolv_test.c in commit 2afeaad315ac19450389b8f2befdbe7c91c37818. Reviewed by: ngie Reported by: CHERI (buffer overflow) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D37886
* Significantly speed up libthr/mutex_test and make more reliableAlex Richardson2020-11-261-15/+100
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using a simple global++ as the data race, with this change we perform the increment by loading the global, delaying for a bit and then storing back the incremented value. If I move the increment outside of the mutex protected range, I can now see the data race with only 100 iterations on amd64 in almost all cases. Before this change such a racy test almost always passed with < 100,000 iterations and only reliably failed with the current limit of 10 million. I noticed this poorly written test because the mutex:mutex{2,3} and timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins. Writing good concurrency tests is hard so I won't attempt to do so, but this change should make the test more likely to fail if pthread_mutex_lock is not implemented correctly while also significantly reducing the time it takes to run these four tests. It will also reduce the time it takes for QEMU RISC-V testsuite runs by almost 40 minutes (out of currently 7 hours). Reviewed By: brooks, ngie Differential Revision: https://reviews.freebsd.org/D26473 Notes: svn path=/head/; revision=368055
* Update pthread_cond_timedwait() test to current NetBSDEric van Gyzen2019-08-161-20/+18
| | | | | | | | | | | | | NetBSD adapted and committed our r350620. Update to their version 1.8. Reviewed by: ngie Obtained from: NetBSD MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D21279 Notes: svn path=/head/; revision=351118
* Relax time constraint in pthread_cond_timedwait unit testEric van Gyzen2019-08-051-0/+11
| | | | | | | | | | | | | | | | pthread_cond_timedwait() should wait _at least_ until the timeout, but it might appear to wait longer due to system activity and scheduling. The test ignored fractional seconds when comparing the actual and expected timeouts, so it allowed anywhere between zero and one extra second of wait time. Zero is a bit unreasonable. Compare fractional seconds so we always allow up to one extra second. Reviewed by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=350620
* Have pthread_cond_destroy() return EBUSY if the condvar has waiters.Mark Johnston2019-03-081-0/+92
| | | | | | | | | | | | | | | | This is not required of a compliant implementation, but it's easy to check for and helps improve compatibility with other common implementations. Moreover, it's consistent with our pthread_mutex_destroy(). PR: 234805 Reviewed by: jhb, kib, ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19496 Notes: svn path=/head/; revision=344935
* Increase timeout for timedmutex_test:mutex2, timedmutex_test:mutex3Ruslan Bukin2018-08-061-0/+12
| | | | | | | | | | | | tests. Default value is 300. It takes ~310s to complete each of these tests in QEMU/RISC-V. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=337381
* Merge ^/vendor/NetBSD/tests/dist@r312370Enji Cooper2017-01-181-4/+4
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312372
* Remove explicit pthread_np.h #include, per change in libnetbsd@r312303Enji Cooper2017-01-161-4/+0
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312304
* Diff reduce with upstream and prep for next set of content pushesEnji Cooper2017-01-164-17/+3
| | | | Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312302
* Merge ^/vendor/NetBSD/tests/dist@r312294Enji Cooper2017-01-167-75/+21
| | | | | | | | | This includes a number of accepted upstream fixes, as well as a reimplementation of the net/carp/... testcase (which is currently unused). Notes: svn path=/projects/netbsd-tests-upstream-01-2017/; revision=312295
* Upgrade NetBSD tests to 01.11.2017_23.20 snapshotEnji Cooper2017-01-133-22/+212
| | | | | | | | | | | | | | | This contains some new testcases in /usr/tests/...: - .../lib/libc - .../lib/libthr - .../lib/msun - .../sys/kern Tested on: amd64, i386 MFC after: 1 month Notes: svn path=/head/; revision=312008
* run: ensure pthread_condattr_{init,setclock} is successfulEnji Cooper2017-01-041-0/+7
| | | | | | | | | MFC after: 1 week Reported by: Coverity CID: 1268631, 1268633 Notes: svn path=/head/; revision=311274
* swapcontext1: test for getcontext(3) and swapcontext(3) success properlyEnji Cooper2017-01-041-0/+12
| | | | | | | | | | | The beforementioned libcalls both succeed if the return codes aren't -1 MFC after: 3 days Reported by: Coverity CID: 976790, 976791 Notes: svn path=/head/; revision=311269
* fpu: ensure calls to pthread_create succeed and test sched_yield to makeEnji Cooper2017-01-041-0/+23
| | | | | | | | | | | | | | sure it returns 0 sched_yield tests for values returning 0 of type int and sched_yield is of type long, so the test is a mismatch MFC after: 1 week Reported by: Coverity CID: 1254953, 1254954, 1254965, 1254966 Notes: svn path=/head/; revision=311265
* Skip test on FreeBSD only. So test can be upstreamed to NetBSD.Ruslan Bukin2016-10-181-1/+1
| | | | | | | | | Requested by: ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Notes: svn path=/head/; revision=307583
* Skip test on MIPS as it modifies TLS pointer in set_mcontext().Ruslan Bukin2016-10-181-0/+9
| | | | | | | | | Discussed with: kib Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Notes: svn path=/head/; revision=307553
* Expect :mutexattr2 to fail on FreeBSDEnji Cooper2016-08-131-0/+17
| | | | | | | | | | | | | | | pthread_mutexattr_getprioceiling and pthread_mutexattr_setprioceiling both return EINVAL if ->m_protocol != PTHREAD_PRIO_PROTECT. The reasoning behind this decision isn't documented in neither the FreeBSD nor the OpenGroup manpages. Add printf's to add in debugging the issue PR: 211802 Sponsored by: EMC / Isilon Storage Division Notes: svn path=/projects/netbsd-tests-update-12/; revision=304036
* Checkpoint initial integration workEnji Cooper2016-08-123-7/+299
| | | | | | | | | | | | - Some of the lib/libc and lib/thr tests fail - lib/msun/exp_test:exp2_values now passes with clang 3.8.0 The Makefiles in contrib/netbsd-tests were pruned as they have no value Sponsored by: EMC / Isilon Storage Division Notes: svn path=/projects/netbsd-tests-update-12/; revision=304003
* Add #include sys/types.h for register_t for mipsEnji Cooper2015-04-251-0/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=281966
* Fix lib/libthr/tests/detach_testEnji Cooper2015-01-171-1/+15
| | | | | | | | | | | | | | | - Eliminate race with liberal use of sleep(3) [1] - Fix NetBSD-specific implementation way of testing result from pthread_cancel by testing with `td` instead of `NULL` [2] PR: 196738 [1] PR: 191906 [2] MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=277278
* Mechanically replace #if defined(__FreeBSD__) and #if defined(__NetBSD__) withEnji Cooper2014-11-172-2/+2
| | | | | | | | | | | | their #ifdef equivalents for everything changed in contrib/netbsd-tests. There are some items from the vendor tree that use #if defined(__FreeBSD__) or #if defined(__NetBSD__) which are being left alone Requested by: bde, rpaulo Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=274626
* Add missing sys/time.h #include for timespecsub macro in ↵Enji Cooper2014-11-163-0/+12
| | | | | | | lib/libnetbsd/sys/time.h Notes: svn path=/head/; revision=274577
* Port helper program to FreeBSD, similar to ../../lib/libc/stdlib/h_atexit.cEnji Cooper2014-11-161-0/+20
| | | | | | | | Submitted by: pho In collaboration with: kib Notes: svn path=/head/; revision=274576
* #ifdef out a printf on !NetBSD that causes the testcase to fail when comparingEnji Cooper2014-11-161-0/+2
| | | | | | | | | the output from the helper program Submitted by: pho Notes: svn path=/head/; revision=274575
* Add pthread_np.h #include and initialize the pthread attribute on FreeBSDEnji Cooper2014-11-161-0/+7
| | | | | | | Submitted by: pho Notes: svn path=/head/; revision=274574
* Expect :pthread_detach to fail with EINVAL instead of ESRCH on FreeBSDEnji Cooper2014-11-161-0/+4
| | | | | | | | PR: 191906 In collaboration with: pho Notes: svn path=/head/; revision=274573
* Only expect timeouts on powerpc with NetBSDEnji Cooper2014-11-161-0/+12
| | | | | | | Submitted by: pho Notes: svn path=/head/; revision=274572
* Use _exit instead of exit so the file descriptors aren't flushed twice in theEnji Cooper2014-11-161-0/+8
| | | | | | | | | child processes Submitted by: pho Notes: svn path=/head/; revision=274571
* Import proper fix for misc/49356 (/usr/include/atf-c/config.h) after ↵Enji Cooper2014-11-042-6/+4
| | | | | | | | | | | atf-c/config.h was removed from the build Pointyhat to: me (again, for not running make delete-old after running test builds) Notes: svn path=/head/; revision=274079
* Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,Enji Cooper2014-10-0235-0/+4749
minus the vendor Makefiles Provide directions for how to bootstrap the vendor sources in FREEBSD-upgrade MFC after 2 weeks Discussed with: rpaulo Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=272458