History log of /netbsd-src/tests/lib/libpthread/Makefile (Results 1 – 16 of 16)
Revision Date Author Comments
# 5b36b4ea 24-Nov-2023 riastradh <riastradh@NetBSD.org>

pthread: Add tests for pthread user stack allocation.

PR lib/57721

XXX pullup-10
XXX pullup-9
XXX pullup-8


# a11399dd 21-Jun-2020 lukem <lukem@NetBSD.org>

fix build of h_thread_local_dtor.cpp


# a9ca1710 24-Apr-2019 kamil <kamil@NetBSD.org>

Add a complete C11 threads(3) implementation

C11 Thread support library is a portable threading C API between OSs,
similar to std::threads in the C++ world.

The library is implemented as a thin shi

Add a complete C11 threads(3) implementation

C11 Thread support library is a portable threading C API between OSs,
similar to std::threads in the C++ world.

The library is implemented as a thin shim over POSIX interfaces.

NetBSD implements the API as a part of the POSIX threading library
(libpthread(3)).

C11 threads(3) are in the process of making them an integral part
of the POSIX standard. The interface has been implemented in major
OSs and used with stopgap libraries for older versions of them.

C11 threading library is already used (with a stopgap implementation)
in the NetBSD distribution in MESA.

Original implementation by myself from 2016.

ATF tests are new and cover almost all interfaces.

Proposed on tech-userlevel@.

show more ...


# e5678be8 11-Jul-2017 joerg <joerg@NetBSD.org>

Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Intr

Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
functions are used for destructors of thread_local objects.

If a pending destructor exists, prevent unloading of shared objects.
Introduce __dl_cxa_refcount interface for this purpose. When the last
reference is gone and the object has been dlclose'd before, the
unloading is finalized.

Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists
on providing __cxa_thread_atexit as direct wrapper without further
patching.

show more ...


# 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 ...


# 1e971735 12-Apr-2013 christos <christos@NetBSD.org>

loosen the test only for qemu.


# dd14258b 28-Mar-2013 christos <christos@NetBSD.org>

Add pthread_cond_timedwait(3) test from PR/47703


# a4ddc2c8 21-Mar-2013 christos <christos@NetBSD.org>

new dlopen tests for libpthread from manu@


# bba80928 12-Sep-2012 manu <manu@NetBSD.org>

setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha

setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@

show more ...


# 710017dd 06-Apr-2011 jruoho <jruoho@NetBSD.org>

As per PR lib/44818, remove 'lib/libpthread/t_status'. It takes two minutes
to rewrite this properly if someone misses this.


# 68f3621e 24-Mar-2011 jruoho <jruoho@NetBSD.org>

A dummy conformance-test for pthread_detach(3). I will extend this later.


# c3917926 24-Mar-2011 jruoho <jruoho@NetBSD.org>

A dummy conformance-test of pthread_equal(3).


# 1b0b4551 08-Dec-2010 joerg <joerg@NetBSD.org>

Link t_fpu against libm if the compiler doesn't want to inline sin/cos.


# 236a4409 30-Nov-2010 joerg <joerg@NetBSD.org>

Test alignment of constructor / destructor calls as well as the stack
of new threads. Currently implement for i386 and AMD64.


# b226f3d0 28-Jul-2010 jruoho <jruoho@NetBSD.org>

Add a simple test for pthread_join(3).


# 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 ...