Asserts that td_thr_getname() handles shorter buffer parameter and the
result is properly truncated.
Currently this test fails due to bug in pthread_dbg.
Sponsored by <The NetBSD Foundation>
threads2:
Asserts that td_thr_iter() call is executed for each thread once
threads3:
Asserts that for each td_thr_iter() call td_thr_info() is valid
These tests pass correctly.
Sponsored by <The NetBSD Foundation>
The following PR are now resolved and are reported to be properly fixed:
PR lib/51635 td_thr_iter in <pthread_dbg.h> seems broken
PR lib/51633 tests/lib/libpthread_dbg/t_dummy unreliable
Sponsored by <The NetBSD Foundation>
Source and destination were swapped. The source of this confusion was that
running these tests under gdb(1) will generate false positives as it will
initialize pthread__dbg to PID of the debugger. This means that it is
currently not possible to debug pthread_dbg code under a full-stack
debugger using NetBSD debugging library for threads.
This should address:
PR lib/51633 tests/lib/libpthread_dbg/t_dummy unreliable
PR lib/51635: td_thr_iter in <pthread_dbg.h> seems broken
After applying the fix I'm able to run all pthread_dbg tests without
indeterminism. The indeterminism was caused by overwritting source of data
with trash.
Sponsored by <The NetBSD Foundation>
This test contains threads1 test that:
Asserts that td_thr_iter() call without extra logic works
This tests fails and is linked with gnats:
PR lib/51635: td_thr_iter in <pthread_dbg.h> seems broken
Sponsored by <The NetBSD Foundation>
The dummy2 test reports failures on i386 releng machines.
The same with dummy3, but it's also reproducible sometimes on my amd64
setup. It's not always broken, neither always functional - once a while it
reports failure. So far I have not reproduced failure in dummy2.
PR lib/51633 tests/lib/libpthread_dbg/t_dummy unreliable
Sponsored by <The NetBSD Foundation>
This test verifies that it's not possible to attach twice to the same
process with td_open() -- it asserts failure with status TD_ERR_INUSE.
This test does nothing besides initializing and deinitializing pthread_dbg
debugging instance.
Refactor code to be more reusable.
Set proper description of dummy2.
Sponsored by <The NetBSD Foundation>.
This tests implements:
- .proc_read with memcpy(3)
- .proc_write with memcpy(3)
- .proc_lookup with dlopen(3) and dlsym(3) combination
td_open() is verified to return with success (TD_ERR_OK), followed by a
call to td_close().
This test does nothing else than initializing and deinitializing td_proc_t
structure, with appropriately implemented functions.
Sponsored by <The NetBSD Foundation>
At the moment this test does nothing except reports failure from td_open()
for overloaded (implemented) dummy1_proc_lookup() (.proc_lookup from
td_proc_callbacks_t) of the following form:
static int
dummy1_proc_lookup(void *arg, const char *sym, caddr_t *addr)
{
return TD_ERR_ERR;
}
This file and directory with tests is placeholder for new ones, without
further need to alter mtree and distribution sets.
The libpthread_dbg interface and library is used by gdb(1) to handle
threads in applications.
Sponsored by <The NetBSD Foundation>
Add new tests:
- waitpid_options
- waitid_options
- wait3_options
- wait4_options
- wait6_options
These tests are included in t_wait_noproc and t_wait_noproc_wnohang.
waitpid_options, wait3_options, wait4_options test combinations of options
of: bit for WALLSIG, WALTSIG, __WALL, __WCLONE and later a full combination
mask of WNOWAIT, WEXITED, WUNTRACED, WSTOPPED, WTRAPPED and WCONTINUED.
waitid and wait6 test full combination mask of WNOWAIT, WEXITED, WUNTRACED,
WSTOPPED, WTRAPPED and WCONTINUED -- excluded empty value and singular
WNOWAIT.
For compatibility reasons alter waitid and wait6 to test against options
WEXITED | WTRAPPED, as it's equivalent to waitpid, wait3, wait4.
The intention for these tests it to catch any possible issues with slighty
changed behavior of wait(2)-like functions in terms of valid options
values.
All tests pass successfully.
Sponsored by <The NetBSD Foundation>
This test has set expected failure like other functions in the wait(2)
family and is linked with PR standards/51606.
The PR is labeled as:
wait4() (and friends) with WNOHANG and no children does not error
Originally, this test was accidently disabled in the WNOHANG checks. This
was noted by Robert Elz.
Sponsored by <The NetBSD Foundation>.
The t_wait_noproc test checks whether wait(2)-family of functions return
error and set ECHILD for lack of childs.
The t_wait_noproc_wnohang adds to options (except wait(2), wait3(2)) new
parameter WNOHANG and verifies that error is still signaled and errno set
to ECHILD.
Currently t_wait_noproc_wnohang reports failures, these have been marked as
expected and referenced to PR standards/51606.
The problem report is authored by Robert Elz, and the initial regression
has been notified by Nicolas Joly.
Remove redundant test in tests/lib/libc/sys/t_wait for wait6(2) with no
WNOHANG specified.
Sponsored by <The NetBSD Foundation>.
This test verifies that it is possible to emit multiple times SIGSTOP and
SIGCONT for a child.
Add checks that status does not return more than one valid state from the
following list: STOPPED, CONTINUED, EXITED and SIGNALED. This check fails
for WIFCONTINUED()==true as it currently and wrongly returns true for
WIFSTOPPED().
This verification is added to wait6_stopgo_loop and wait6_stop_and_go and
marked as expected failure and linked with PR standards/51603.
Remove trailing whitespace.
Sponsored by <The NetBSD Foundation>
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>.
it actually (used to) behave when it was incorrect... Aside from
a possible EPERM (which is not tested) the only error possible from
mlock() is ENOMEM. POSIX also allows EINVAL if the address is not
page aligned and the implementation does not round down to the previous
page boundary, but NetBSD does.
The kernel was recently fixed to return the correct errors for mlock()
so now we really need the test to be checking them, and not expecting
the incorrect errno values that the kernel used to return.
Same for munlock() - there ENOMEM is the only possible error, again,
EINVAL cannot happen as the kernel rounds to page boundaries.
For munlock() the kernel has not yet been corrected (that is coming
real soon...) and one of the munlock() tests will currently fail
(as of the time this commit is made, hopefully not for much longer)
as it should - it is indicating a kernel bug.
Note that NetBSD mlock(2) talks about EINVAL for cases where the length
parameter is negative ... but that is a size_t - good luck having that
ever occur (the man page will soon be corrected as well.)
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).
various dates over a span of a few decades, instead of just once
relative to the current date. This makes the test fail consistently
instead of sometimes failing and sometimes not depending on when
it is run. Makes PR lib/50574 consistently reproducible.
If the USB HID 1.11 spec is interperted to the letter, there's no such
thing as a unsigned Logical/Physical Minimum/Maximum. When the (signed)
Minimum is greater than the (signed) Maximum, it's a possibility that
the device is attempting to present unsigned report data.
While here, improve the general legibility of the printout. Not
actually relevant to PR 50574, but anyone looking at that should be
aware of this change.
not 14. When evaluated on a Monday, it apparently means 13 days in the
future. There's not exactly a spec for parsedate.y, so conform to the
implementation.
PR 50574.
XXX: to me at least this is an odd notion of "next Sunday", but whatever...
particular it doesn't add a week if evaluating that on Wednesday.
Whether that's right is an open question, but there's not exactly a
spec for parsedate.y and there's no point having the test fail one
day in seven.
PR 50574.
kernel (or rump-server) has autoload enabled.
This should finish fixing PR bin/49153
XXX The test still does not run successfully, due to another bug that
XXX was recently introduced. This second bug is being worked on.
with EAFNOSUPPORT (similar to the bind test) if the domain of the socket
does not match the address family of the supplied address.
test currently fails as it should
These were not strictly needed before, as lseek would error on negative
arguments, but having added open_memstream we have a virtual file pointer
that assumes that it gets sane values, so we get an assertion triggered
on a negative value. Best to check in one place rather than at all the
relevant points.
Instead, use printf(1) to save the regexp in a shell variable,
taking advantage of the fact that printf understands "\r".
This should fix a complaint from subversion, reported in PR 49249.
Instead of just checking that parsedate(3) does not return an error,
also pass the result through localtime_r(3) or gmtime_r(3) and check the
year/month/day/hour/minute/second fields in the resulting struct tm.
for the float case, reflecting the actual exp2f() argument value after
rounding to float precision. Fixes PR lib/49256. Thanks to Makoto
Kamada and Tetsuya Isaki for the analysis.
after checking pthread_self() didn't change. Otherwise the process exits
outside of atf context.
Should fix "Test case exited normally but failed to create the results file: Results file is empty" reports from atf-run.