]> sourceware.org Git - glibc.git/log
glibc.git
3 months agoTest mkdirat use of mode argument
Joseph Myers [Thu, 22 Aug 2024 11:25:14 +0000 (11:25 +0000)]
Test mkdirat use of mode argument

The test io/tst-mkdirat doesn't verify the permissions on the created
directory (thus, doesn't verify at all anything about how mkdirat uses
the mode argument).  Add checks of this to the existing test.

Tested for x86_64.

3 months agoAdd more tests of getline
Joseph Myers [Wed, 21 Aug 2024 19:58:14 +0000 (19:58 +0000)]
Add more tests of getline

There is very little test coverage for getline (only a minimal
stdio-common/tstgetln.c which doesn't verify anything about the
results of the getline calls).  Add some more thorough tests
(generally using fopencookie for convenience in testing various cases
for what the input and possible errors / EOF in the file read might
look like).

Note the following regarding testing of error cases:

* Nothing is said in the specifications about what if anything might
  be written into the buffer, and whether it might be reallocated, in
  error cases.  The expectation of the tests (required to avoid memory
  leaks on error) is that at least on error cases, the invariant that
  lineptr points to at least n bytes is maintained.

* The optional EOVERFLOW error case specified in POSIX, "The number of
  bytes to be written into the buffer, including the delimiter
  character (if encountered), would exceed {SSIZE_MAX}.", doesn't seem
  practically testable, as any case reading so many characters (half
  the address space) would also be liable to run into allocation
  failure along (ENOMEM) the way.

* If a read error occurs part way through reading an input line, it
  seems unclear whether a partial line should be returned by getline
  (avoid input getting lost), which is what glibc does at least in the
  fopencookie case used in this test, or whether getline should return
  -1 (error) (so avoiding the program misbehaving by processing a
  truncated line as if it were complete).  (There was a short,
  inconclusive discussion about this on the Austin Group list on 9-10
  November 2014.)

* The POSIX specification of getline inherits errors from fgetc.  I
  didn't try to cover fgetc errors systematically, just one example of
  such an error.

Tested for x86_64 and x86.

3 months agoRevert "inet: Avoid label at end of compound statement in tst-if_nameindex"
Florian Weimer [Wed, 21 Aug 2024 18:02:40 +0000 (20:02 +0200)]
Revert "inet: Avoid label at end of compound statement in tst-if_nameindex"

This reverts commit 26aca73db5e5ea299b554ceae418b13102b24948.

Reason for revert: Unintended semantic change.

3 months agoinet: Avoid label at end of compound statement in tst-if_nameindex
Florian Weimer [Wed, 21 Aug 2024 17:13:10 +0000 (19:13 +0200)]
inet: Avoid label at end of compound statement in tst-if_nameindex

This fails to compile with GCC 8.

3 months agoRules: Also build memcheck tests even when not running them
Samuel Thibault [Tue, 20 Aug 2024 14:22:07 +0000 (16:22 +0200)]
Rules: Also build memcheck tests even when not running them

This will avoid in the future cases like a57cbbd85379 ("malloc: Link
threading tests with $(shared-thread-library") missing the memcheck
cases added in 251843e16fce ("malloc: Link threading tests with
$(shared-thread-library)")

3 months agomalloc: Link threading tests with $(shared-thread-library)
Samuel Thibault [Tue, 20 Aug 2024 14:16:25 +0000 (16:16 +0200)]
malloc: Link threading tests with $(shared-thread-library)

Fixes build failures on Hurd.

3 months agoinet: test if_nametoindex and if_indextoname
DJ Delorie [Fri, 9 Aug 2024 02:44:56 +0000 (22:44 -0400)]
inet: test if_nametoindex and if_indextoname

Tests for if_nameindex, if_name2index, and if_index2name

Tests that valid results are consistent.

Tests that invalid parameters fail correctly.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agoelf: Make dl-fptr and dl-symaddr hppa specific
Adhemerval Zanella [Wed, 31 Jul 2024 15:58:35 +0000 (12:58 -0300)]
elf: Make dl-fptr and dl-symaddr hppa specific

With ia64 removal, the function descriptor supports is only used
by HPPA and new architectures do not seem leaning towards this
design.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
3 months agox86: Unifies 'strnlen-evex' and 'strnlen-evex512' implementations.
Matthew Sterrett [Fri, 9 Aug 2024 22:05:09 +0000 (15:05 -0700)]
x86: Unifies 'strnlen-evex' and 'strnlen-evex512' implementations.

This commit uses a common implementation 'strnlen-evex-base.S' for both
'strnlen-evex' and 'strnlen-evex512'

This patch serves both to reduce the number of implementations, and it also does some small optimizations that benefit strnlen-evex and strnlen-evex512.

All tests pass on x86.

Benchmarks were taken on SKX.
https://www.intel.com/content/www/us/en/products/sku/123613/intel-core-i97900x-xseries-processor-13-75m-cache-up-to-4-30-ghz/specifications.html

Geometric mean for strnlen-evex over all benchmarks (N=10) was (new/old) 0.881
Geometric mean for strnlen-evex512 over all benchmarks (N=10) was (new/old) 0.953

Code Size Changes:
    strnlen-evex       :  +31 bytes
    strnlen-evex512    :  +156 bytes
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
3 months agostring: strerror, strsignal cannot use buffer after dlmopen (bug 32026)
Florian Weimer [Mon, 19 Aug 2024 13:48:03 +0000 (15:48 +0200)]
string: strerror, strsignal cannot use buffer after dlmopen (bug 32026)

Secondary namespaces have a different malloc.  Allocating the
buffer in one namespace and freeing it another results in
heap corruption.  Fix this by using a static string (potentially
translated) in secondary namespaces.  It would also be possible
to use the malloc from the initial namespace to manage the
buffer, but these functions would still not be safe to use in
auditors etc. because a call to strerror could still free a
buffer while it is used by the application.  Another approach
could use proper initial-exec TLS, duplicated in secondary
namespaces, but that would need a callback interface for freeing
libc resources in namespaces on thread exit, which does not exist
today.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agosupport: Use macros for *stat wrappers
Florian Weimer [Fri, 16 Aug 2024 14:05:20 +0000 (16:05 +0200)]
support: Use macros for *stat wrappers

Macros will automatically use the correct types, without
having to fiddle with internal glibc macros.  It's also
impossible to get the types wrong due to aliasing because
support_check_stat_fd and support_check_stat_path do not
depend on the struct stat* types.

The changes reveal some inconsistencies in tests.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoio: Use struct statx and xstatx in tests
Florian Weimer [Fri, 16 Aug 2024 14:05:20 +0000 (16:05 +0200)]
io: Use struct statx and xstatx in tests

This avoids the need to define struct_statx to an appropriate
struct stat type variant because struct statx does not change
based on time/file offset flags.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agosupport: Add the xstatx function
Florian Weimer [Fri, 16 Aug 2024 14:05:19 +0000 (16:05 +0200)]
support: Add the xstatx function

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agosupport: Include <string.h> for strcmp in support_format_addrinfo.c
Florian Weimer [Fri, 16 Aug 2024 14:05:19 +0000 (16:05 +0200)]
support: Include <string.h> for strcmp in support_format_addrinfo.c

This is currently implied by the internal headers, but it makes
sense not to rely on this.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agosupport: Remove #include <config.h>
Florian Weimer [Fri, 16 Aug 2024 14:05:19 +0000 (16:05 +0200)]
support: Remove #include <config.h>

This is not needed: include/intprops.h has its own detection logic.
It makes building these files outside of glibc easer.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agonptl: Fix extraneous testing run by tst-rseq-nptl in the test driver
Maciej W. Rozycki [Fri, 16 Aug 2024 13:38:33 +0000 (14:38 +0100)]
nptl: Fix extraneous testing run by tst-rseq-nptl in the test driver

Fix an issue with commit 8f4632deb354 ("Linux: rseq registration tests")
and prevent testing from being run in the process of the test driver
itself rather than just the test child where one has been forked.  The
problem here is the unguarded use of a destructor to call a part of the
testing.  The destructor function, 'do_rseq_destructor_test' is called
implicitly at program completion, however because it is associated with
the executable itself rather than an individual process, it is called
both in the test child *and* in the test driver itself.

Prevent this from happening by providing a guard variable that only
enables test invocation from 'do_rseq_destructor_test' in the process
that has first run 'do_test'.  Consequently extra testing is invoked
from 'do_rseq_destructor_test' only once and in the correct process,
regardless of the use or the lack of of the '--direct' option.  Where
called in the controlling test driver process that has neved called
'do_test' the destructor function silently returns right away without
taking any further actions, letting the test driver fail gracefully
where applicable.

This arrangement prevents 'tst-rseq-nptl' from ever causing testing to
hang forever and never complete, such as currently happening with the
'mips-linux-gnu' (o32 ABI) target.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoReport error if setaffinity wrapper fails (Bug 32040)
Carlos O'Donell [Thu, 15 Aug 2024 12:12:35 +0000 (08:12 -0400)]
Report error if setaffinity wrapper fails (Bug 32040)

Previously if the setaffinity wrapper failed the rest of the subtest
would not execute and the current subtest would be reported as passing.
Now if the setaffinity wrapper fails the subtest is correctly reported
as faling. Tested manually by changing the conditions of the affinity
call including setting size to zero, or checking the wrong condition.

No regressions on x86_64.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoungetc: Fix backup buffer leak on program exit [BZ #27821]
Siddhesh Poyarekar [Wed, 14 Aug 2024 01:08:49 +0000 (21:08 -0400)]
ungetc: Fix backup buffer leak on program exit [BZ #27821]

If a file descriptor is left unclosed and is cleaned up by _IO_cleanup
on exit, its backup buffer remains unfreed, registering as a leak in
valgrind.  This is not strictly an issue since (1) the program should
ideally be closing the stream once it's not in use and (2) the program
is about to exit anyway, so keeping the backup buffer around a wee bit
longer isn't a real problem.  Free it anyway to keep valgrind happy
when the streams in question are the standard ones, i.e. stdout, stdin
or stderr.

Also, the _IO_have_backup macro checks for _IO_save_base,
which is a roundabout way to check for a backup buffer instead of
directly looking for _IO_backup_base.  The roundabout check breaks when
the main get area has not been used and user pushes a char into the
backup buffer with ungetc.  Fix this to use the _IO_backup_base
directly.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoungetc: Fix uninitialized read when putting into unused streams [BZ #27821]
Siddhesh Poyarekar [Wed, 14 Aug 2024 01:00:06 +0000 (21:00 -0400)]
ungetc: Fix uninitialized read when putting into unused streams [BZ #27821]

When ungetc is called on an unused stream, the backup buffer is
allocated without the main get area being present.  This results in
every subsequent ungetc (as the stream remains in the backup area)
checking uninitialized memory in the backup buffer when trying to put a
character back into the stream.

Avoid comparing the input character with buffer contents when in backup
to avoid this uninitialized read.  The uninitialized read is harmless in
this context since the location is promptly overwritten with the input
character, thus fulfilling ungetc functionality.

Also adjust wording in the manual to drop the paragraph that says glibc
cannot do multiple ungetc back to back since with this change, ungetc
can actually do this.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoMake tst-ungetc use libsupport
Siddhesh Poyarekar [Wed, 14 Aug 2024 23:20:04 +0000 (19:20 -0400)]
Make tst-ungetc use libsupport

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agox86: Add `Avoid_STOSB` tunable to allow NT memset without ERMS
Noah Goldstein [Wed, 14 Aug 2024 06:37:31 +0000 (14:37 +0800)]
x86: Add `Avoid_STOSB` tunable to allow NT memset without ERMS

The goal of this flag is to allow targets which don't prefer/have ERMS
to still access the non-temporal memset implementation.

There are 4 cases for tuning memset:
    1) `Avoid_STOSB && Avoid_Non_Temporal_Memset`
        - Memset with temporal stores
    2) `Avoid_STOSB && !Avoid_Non_Temporal_Memset`
        - Memset with temporal/non-temporal stores. Non-temporal path
          goes through `rep stosb` path. We accomplish this by setting
          `x86_rep_stosb_threshold` to
          `x86_memset_non_temporal_threshold`.
    3) `!Avoid_STOSB && Avoid_Non_Temporal_Memset`
        - Memset with temporal stores/`rep stosb`
    3) `!Avoid_STOSB && !Avoid_Non_Temporal_Memset`
        - Memset with temporal stores/`rep stosb`/non-temporal stores.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
4 months agox86: Use `Avoid_Non_Temporal_Memset` to control non-temporal path
Noah Goldstein [Wed, 14 Aug 2024 06:37:30 +0000 (14:37 +0800)]
x86: Use `Avoid_Non_Temporal_Memset` to control non-temporal path

This is just a refactor and there should be no behavioral change from
this commit.

The goal is to make `Avoid_Non_Temporal_Memset` a more universal knob
for controlling whether we use non-temporal memset rather than having
extra logic based on vendor.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
4 months agox86: Fix bug in strchrnul-evex512 [BZ #32078]
Noah Goldstein [Tue, 13 Aug 2024 15:29:14 +0000 (23:29 +0800)]
x86: Fix bug in strchrnul-evex512 [BZ #32078]

Issue was we were expecting not matches with CHAR before the start of
the string in the page cross case.

The check code in the page cross case:
```
    and    $0xffffffffffffffc0,%rax
    vmovdqa64 (%rax),%zmm17
    vpcmpneqb %zmm17,%zmm16,%k1
    vptestmb %zmm17,%zmm17,%k0{%k1}
    kmovq  %k0,%rax
    inc    %rax
    shr    %cl,%rax
    je     L(continue)
```

expects that all characters that neither match null nor CHAR will be
1s in `rax` prior to the `inc`. Then the `inc` will overflow all of
the 1s where no relevant match was found.

This is incorrect in the page-cross case, as the
`vmovdqa64 (%rax),%zmm17` loads from before the start of the input
string.

If there are matches with CHAR before the start of the string, `rax`
won't properly overflow.

The fix is quite simple. Just replace:

```
    inc    %rax
    shr    %cl,%rax
```
With:
```
    sar    %cl,%rax
    inc    %rax
```

The arithmetic shift will clear any matches prior to the start of the
string while maintaining the signbit so the 1s can properly overflow
to zero in the case of no matches.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
4 months agoTest errno setting on strtod overflow in tst-strtod-round
Joseph Myers [Wed, 14 Aug 2024 17:15:46 +0000 (17:15 +0000)]
Test errno setting on strtod overflow in tst-strtod-round

We have no tests that errno is set to ERANGE on overflow of
strtod-family functions (we do have some tests for underflow, in
tst-strtod-underflow).  Add such tests to tst-strtod-round.

Tested for x86_64.

4 months agolibio/tst-getdelim: Add new test covering NUL as a delimiter
Frédéric Bérat [Tue, 13 Aug 2024 10:01:26 +0000 (12:01 +0200)]
libio/tst-getdelim: Add new test covering NUL as a delimiter

Add a new test to getdelim to verify that '\0' can be set as a
delimiter.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agomanual: Document dprintf and vdprintf
Florian Weimer [Tue, 13 Aug 2024 13:52:34 +0000 (15:52 +0200)]
manual: Document dprintf and vdprintf

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agomanual: Document generic printf error codes
Florian Weimer [Tue, 13 Aug 2024 13:52:34 +0000 (15:52 +0200)]
manual: Document generic printf error codes

Describe EOVERFLOW, ENOMEN, EILSEQ.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoARC: Regenerate ULPs
Pavel Kozlov [Fri, 9 Aug 2024 13:21:31 +0000 (14:21 +0100)]
ARC: Regenerate ULPs

Regenerate fpu and soft-fp ULPs. Based on results from HSDK-4xD board
with GCC 14 build.
Including new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agosupport: Add options list terminator to the test driver
Florian Weimer [Fri, 9 Aug 2024 15:01:17 +0000 (17:01 +0200)]
support: Add options list terminator to the test driver

This avoids crashes if a test is passed unknown options.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoDefine __libc_initial for the static libc
Florian Weimer [Fri, 9 Aug 2024 14:17:14 +0000 (16:17 +0200)]
Define __libc_initial for the static libc

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoTurn on -Wimplicit-fallthrough by default if available
Florian Weimer [Fri, 9 Aug 2024 13:34:53 +0000 (15:34 +0200)]
Turn on -Wimplicit-fallthrough by default if available

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoLoongArch: Add cfi instructions for _dl_tlsdesc_dynamic
mengqinggang [Fri, 5 Jul 2024 02:40:33 +0000 (10:40 +0800)]
LoongArch: Add cfi instructions for _dl_tlsdesc_dynamic

In _dl_tlsdesc_dynamic, there are three 'addi.d sp, sp, -size'
instructions to allocate stack size for Float/LSX/LASX registers.
Every 'addi.d sp, sp, -size' needs a cfi_adjust_cfa_offset because
of sp is used to compute CFA. But only one 'addi.d sp, sp, -size'
will be run according to HWCAP value. And all cfi_adjust_cfa_offset
will be executed in stack unwinding, it result in incorrect CFA.

Change _dl_tlsdesc_dynamic to _dl_tlsdesc_dynamic,
_dl_tlsdesc_dynamic_lsx and _dl_tlsdesc_dynamic_lasx.
Conflicting cfi instructions can be distributed to the three functions.
And cfi instructions can correspond to stack down instructions.

4 months agoLoongArch: Regenerate ULPs
caiyinyu [Thu, 8 Aug 2024 02:31:03 +0000 (10:31 +0800)]
LoongArch: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
4 months agoRISC-V: Regenerate ULPs
Julian Zhu [Thu, 8 Aug 2024 08:11:32 +0000 (16:11 +0800)]
RISC-V: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoMIPS: Regenerate ULPs
Julian Zhu [Thu, 8 Aug 2024 08:11:16 +0000 (16:11 +0800)]
MIPS: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

Signed-off-by: Julian Zhu <jz531210@gmail.com>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agopowerpc64le: Update ulps
Florian Weimer [Thu, 8 Aug 2024 11:42:12 +0000 (13:42 +0200)]
powerpc64le: Update ulps

Based on results from a POWER8 system with a GCC 8 build.

4 months agoelf: Remove struct dl_init_args from elf/dl-open.c
Florian Weimer [Thu, 8 Aug 2024 11:35:03 +0000 (13:35 +0200)]
elf: Remove struct dl_init_args from elf/dl-open.c

It is completely redundant with struct dl_open_args.

4 months agos390x: Update ulps
Florian Weimer [Thu, 8 Aug 2024 10:57:35 +0000 (12:57 +0200)]
s390x: Update ulps

Based on results from a z16 system with a GCC 8 build.

4 months agonptl: Fix stray process left by tst-cancel7 blocking testing
Maciej W. Rozycki [Wed, 7 Aug 2024 18:46:21 +0000 (19:46 +0100)]
nptl: Fix stray process left by tst-cancel7 blocking testing

Fix an issue with commit b74121ae4bc5 ("Update.") and prevent a stray
process from being left behind by tst-cancel7 (and also tst-cancelx7,
which is the same test built with '-fexceptions' additionally supplied
to the compiler), which then blocks remote testing until the process has
been killed by hand.

This test case creates a thread that runs an extra copy of the test via
system(3) and using the '--direct' option so that the test wrapper does
not interfere with this instance.  This extra copy executes its business
and calls sigsuspend(2) and then never terminates by itself.  Instead it
relies on being killed by the main test process directly via a thread
cancellation request or, should that fail, by issuing SIGKILL either at
the conclusion of 'do_test' or by the test driver via 'do_cleanup' where
the test timeout has been hit or the test driver interrupted.

However if the main test process has been instead killed by a signal,
such as due to incorrect execution, before it had a chance to kill the
extra copy of the test case, then the test wrapper will terminate
without running 'do_cleanup' and consequently the extra copy of the test
case will remain forever in its suspended state, and in the remote case
in particular it means that the remote test wrapper will wait forever
for the SSH command to complete.

This has been observed with the 'alpha-linux-gnu' target, where the main
test process triggers SIGSEGV and the test wrapper correctly records:

Didn't expect signal from child: got `Segmentation fault'

in nptl/tst-cancel7.out and terminates, but then the calling SSH command
continues waiting for the remaining process started in the same session
on the remote target to complete.

Address this problem by also registering 'do_cleanup' via atexit(3),
observing that 'support_delete_temp_files' is registered by the test
wrapper before the test initializing function 'do_prepare' is called and
that we call all the functions registered in the reverse of the order in
which they were registered, so it is safe to refer to 'pidfilename' in
'do_cleanup' invoked by exit(3) because by that time temporary files
have not yet been deleted.

A minor inconvenience is that if 'signal_handler' is invoked in the test
wrapper as a result of SIGALRM rather than SIGINT, then 'do_cleanup'
will be called twice, once as a cleanup handler and again by exit(3).
In reality it is harmless though, because issuing SIGKILL is guarded by
a record lock, so if the first call has succeeded in killing the extra
copy of the test case, then the subsequent call will do nothing.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agonptl: Reorder semaphore release in tst-cancel7
Maciej W. Rozycki [Wed, 7 Aug 2024 18:46:21 +0000 (19:46 +0100)]
nptl: Reorder semaphore release in tst-cancel7

Move the release of the semaphore used to synchronize between an extra
copy of the test run as a separate process and the main test process
until after the PID file has been locked.  It is so that if the cleanup
function gets called by the test driver due to premature termination of
the main test process, then the function does not get at the PID file
before it has been locked and conclude that the extra copy of the test
has already terminated.  This won't usually happen due to a relatively
high amount of time required to elapse before timeout triggers in the
test driver, but it will change with the next change.

There is still a small time window remaining with this change in place
where the main test process gets killed for some reason between the
extra copy of the test has been already started by pthread_create(3) and
a successful return from the call to sem_wait(3), in which case the
cleanup function can be reached before PID has been written to the PID
file and the file locked.  It seems that with the test case structured
as it is now and PID-based process management we have no means to avoid
it.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agopowerpc: Regenerate ULPs for soft-fp
Adhemerval Zanella [Wed, 7 Aug 2024 13:46:59 +0000 (10:46 -0300)]
powerpc: Regenerate ULPs for soft-fp

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agopowerpc: Update soft-fp ulps
Adhemerval Zanella [Wed, 7 Aug 2024 13:46:37 +0000 (10:46 -0300)]
powerpc: Update soft-fp ulps

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agosparc: Regenerate ULPs
Adhemerval Zanella [Wed, 7 Aug 2024 13:38:26 +0000 (10:38 -0300)]
sparc: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agoi386: Regenerate ULPs
Adhemerval Zanella [Wed, 7 Aug 2024 13:34:06 +0000 (10:34 -0300)]
i386: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agoarm: Regenerate ULPs
Adhemerval Zanella [Wed, 7 Aug 2024 13:27:38 +0000 (10:27 -0300)]
arm: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agoaarch64: Regenerate ULPs
Adhemerval Zanella [Wed, 7 Aug 2024 13:27:04 +0000 (10:27 -0300)]
aarch64: Regenerate ULPs

From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.

4 months agosysdeps: Re-flow and sort multiline gnu/Makefile definitions
Adhemerval Zanella [Wed, 8 Nov 2023 16:49:52 +0000 (13:49 -0300)]
sysdeps: Re-flow and sort multiline gnu/Makefile definitions

4 months agologin: Re-flow and sort multiline Makefile definitions
Adhemerval Zanella [Wed, 8 Nov 2023 16:49:48 +0000 (13:49 -0300)]
login: Re-flow and sort multiline Makefile definitions

4 months agobenchtests: Add random memset benchmark
Wilco Dijkstra [Wed, 7 Aug 2024 13:49:33 +0000 (14:49 +0100)]
benchtests: Add random memset benchmark

Add a new randomized memset test similar to bench-random-memcpy.  Instead of
repeating the same call to memset over and over again, it times a large number
of different inputs.  The distribution of memset length and alignment is based
on SPEC2017 (length up to 4096 and alignment up to 64).

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoAArch64: Improve generic strlen
Wilco Dijkstra [Wed, 7 Aug 2024 13:43:47 +0000 (14:43 +0100)]
AArch64: Improve generic strlen

Improve performance by handling another 16 bytes before entering the loop.
Use ADDHN in the loop to avoid SHRN+FMOV when it terminates.  Change final
size computation to avoid increasing latency.  On Neoverse V1 performance
of the random strlen benchmark improves by 4.6%.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agonss: Fix incorrect switch fall-through in tst-nss-gai-actions
Florian Weimer [Wed, 7 Aug 2024 12:59:08 +0000 (14:59 +0200)]
nss: Fix incorrect switch fall-through in tst-nss-gai-actions

This only happened on test failure.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoadded inputs giving large errors on x86_64 for new C23 functions
Paul Zimmermann [Thu, 25 Jul 2024 14:38:08 +0000 (16:38 +0200)]
added inputs giving large errors on x86_64 for new C23 functions

These functions are exp10m1, exp2m1, log10p1, log2p1.
Also regenerated ulps on x86_64.

For each format, there are 4 values, one for each rounding mode.
(For the intel96 format, there are 8 values, 4 for Intel hardware,
and 4 for AMD hardware. However, regen-ulps was only run on Intel.
It should be run in a separate patch on a AMD x86_64.)
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agostdlib: Link tst-concurrent-quick_exit with $(shared-thread-library)
Adhemerval Zanella [Tue, 6 Aug 2024 16:53:52 +0000 (13:53 -0300)]
stdlib: Link tst-concurrent-quick_exit with $(shared-thread-library)

This avoids a Hurd build failure.  Fixes commit c6af8a9a3c
("stdlib: Allow concurrent quick_exit (BZ 31997)").

4 months agoUse binutils 2.43 branch in build-many-glibcs.py
Joseph Myers [Tue, 6 Aug 2024 17:00:50 +0000 (17:00 +0000)]
Use binutils 2.43 branch in build-many-glibcs.py

This patch makes build-many-glibcs.py use binutils 2.43 branch.

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).

4 months agortld: Add test case for '--' option
Henrik Lindström [Fri, 26 Jul 2024 10:33:51 +0000 (12:33 +0200)]
rtld: Add test case for '--' option

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agortld: Fix handling of '--' option
Henrik Lindström [Fri, 26 Jul 2024 10:33:50 +0000 (12:33 +0200)]
rtld: Fix handling of '--' option

It always resulted in the error `unrecognized option '--'` previously.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agomanual/stdio: Further clarify putc, putwc, getc, and getwc
Arjun Shankar [Tue, 30 Jul 2024 09:37:57 +0000 (11:37 +0200)]
manual/stdio: Further clarify putc, putwc, getc, and getwc

This is a follow-up to 10de4a47ef3f481592e3c62eb07bcda23e9fde4d that
reworded the manual entries for putc and putwc and removed any
performance claims.

This commit further clarifies these entries and brings getc and getwc in
line with the descriptions of putc and putwc, removing any performance
claims from them as well.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoLoongArch: Update Ulps.
caiyinyu [Fri, 2 Aug 2024 07:37:42 +0000 (15:37 +0800)]
LoongArch: Update Ulps.

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
4 months agostdlib: Allow concurrent quick_exit (BZ 31997)
Adhemerval Zanella [Mon, 5 Aug 2024 14:27:35 +0000 (11:27 -0300)]
stdlib: Allow concurrent quick_exit (BZ 31997)

As for exit, also allows concurrent quick_exit to avoid race
conditions when it is called concurrently.  Since it uses the same
internal function as exit, the __exit_lock lock is moved to
__run_exit_handlers.  It also solved a potential concurrent when
calling exit and quick_exit concurrently.

The test case 'expected' is expanded to a value larger than the
minimum required by C/POSIX (32 entries) so at_quick_exit() will
require libc to allocate a new block.  This makes the test mre likely to
trigger concurrent issues (through free() at __run_exit_handlers)
if quick_exit() interacts with the at_quick_exit list concurrently.

This is also the latest interpretation of the Austin Ticket [1].

Checked on x86_64-linux-gnu.

[1] https://austingroupbugs.net/view.php?id=1845
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoelf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)
Florian Weimer [Thu, 1 Aug 2024 21:31:30 +0000 (23:31 +0200)]
elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)

The old code used l_init_called as an indicator for whether TLS
initialization was complete.  However, it is possible that
TLS for an object is initialized, written to, and then dlopen
for this object is called again, and l_init_called is not true at
this point.  Previously, this resulted in TLS being initialized
twice, discarding any interim writes (technically introducing a
use-after-free bug even).

This commit introduces an explicit per-object flag, l_tls_in_slotinfo.
It indicates whether _dl_add_to_slotinfo has been called for this
object.  This flag is used to avoid double-initialization of TLS.
In update_tls_slotinfo, the first_static_tls micro-optimization
is removed because preserving the initalization flag for subsequent
use by the second loop for static TLS is a bit complicated, and
another per-object flag does not seem to be worth it.  Furthermore,
the l_init_called flag is dropped from the second loop (for static
TLS initialization) because l_need_tls_init on its own prevents
double-initialization.

The remaining l_init_called usage in resize_scopes and update_scopes
is just an optimization due to the use of scope_has_map, so it is
not changed in this commit.

The isupper check ensures that libc.so.6 is TLS is not reverted.
Such a revert happens if l_need_tls_init is not cleared in
_dl_allocate_tls_init for the main_thread case, now that
l_init_called is not checked anymore in update_tls_slotinfo
in elf/dl-open.c.

Reported-by: Jonathon Anderson <janderson@rice.edu>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoelf: Clarify and invert second argument of _dl_allocate_tls_init
Florian Weimer [Thu, 1 Aug 2024 21:31:23 +0000 (23:31 +0200)]
elf: Clarify and invert second argument of _dl_allocate_tls_init

Also remove an outdated comment: _dl_allocate_tls_init is
called as part of pthread_create.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoFix name space violation in fortify wrappers (bug 32052)
Andreas Schwab [Mon, 5 Aug 2024 08:55:51 +0000 (10:55 +0200)]
Fix name space violation in fortify wrappers (bug 32052)

Rename the identifier sz to __sz everywhere.

Fixes: a643f60c53 ("Make sure that the fortified function conditionals are constant")
4 months agoiconv: Fix matching of multi-character transliterations (bug 31859)
Andreas Schwab [Mon, 10 Jun 2024 10:19:17 +0000 (12:19 +0200)]
iconv: Fix matching of multi-character transliterations (bug 31859)

Only return __GCONV_INCOMPLETE_INPUT for a partial match when the end of
the input buffer is reached.  Otherwise it is a non-match, and other
patterns should be tried.

4 months agox86: Tunables may incorrectly set Prefer_PMINUB_for_stringop (bug 32047)
Florian Weimer [Fri, 2 Aug 2024 13:22:14 +0000 (15:22 +0200)]
x86: Tunables may incorrectly set Prefer_PMINUB_for_stringop (bug 32047)

Fixes commit 5bcf6265f215326d14dfacdce8532792c2c7f8f8 ("x86:
Disable non-temporal memset on Skylake Server").

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
4 months agox86: Add missing switch/case fall-through markers to init_cpu_features
Florian Weimer [Fri, 2 Aug 2024 13:22:07 +0000 (15:22 +0200)]
x86: Add missing switch/case fall-through markers to init_cpu_features

The commits introducing these fall-throughs intended them to
happen.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
4 months agostdlib: Link tst-concurrent-exit with $(shared-thread-library)
Florian Weimer [Fri, 2 Aug 2024 12:45:10 +0000 (14:45 +0200)]
stdlib: Link tst-concurrent-exit with $(shared-thread-library)

This avoids a Hurd build failure.  Fixes commit f6ba993e0cda0ca
("stdlib: Allow concurrent exit (BZ 31997)").

4 months agohurd: Fix missing pthread_ compat symbol in libc
Samuel Thibault [Wed, 17 Jul 2024 00:03:13 +0000 (02:03 +0200)]
hurd: Fix missing pthread_ compat symbol in libc

5476f8cd2e68 ("htl: move pthread_self info libc.") and
9dfa2562162b ("htl: move pthread_equal into libc") to
1dc0bc8f0748 ("htl: move pthread_attr_setdetachstate into libc")
moved some pthread_ symbols from libpthread.so to libc.so, but missed
adding the compat version like 5476f8cd2e68 ("htl: move pthread_self
info libc.") did: libc already had these symbols as forwards,
but versioned GLIBC_2.21, while the symbols in libpthread.so were
versioned GLIBC_2.12.

To fix running executables built before this, we thus have to add the
GLIBC_2.12 version, otherwise execution fails with e.g.

/usr/lib/i386-gnu/libglib-2.0.so: symbol lookup error: /usr/lib/i386-gnu/libglib-2.0.so: undefined symbol: pthread_attr_setinheritsched, version GLIBC_2.12

4 months agoresolv: Fix tst-resolv-short-response for older GCC (bug 32042)
Florian Weimer [Thu, 1 Aug 2024 08:46:10 +0000 (10:46 +0200)]
resolv: Fix tst-resolv-short-response for older GCC (bug 32042)

Previous GCC versions do not support the C23 change that
allows labels on declarations.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoAdd mremap tests
H.J. Lu [Wed, 24 Jul 2024 21:05:15 +0000 (14:05 -0700)]
Add mremap tests

Add tests for MREMAP_MAYMOVE and MREMAP_FIXED.  On Linux, also test
MREMAP_DONTUNMAP.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agomremap: Update manual entry
H.J. Lu [Wed, 24 Jul 2024 21:05:14 +0000 (14:05 -0700)]
mremap: Update manual entry

Update mremap manual entry:

1. Change mremap to variadic.
2. Document MREMAP_FIXED and MREMAP_DONTUNMAP.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agolinux: Update the mremap C implementation [BZ #31968]
H.J. Lu [Wed, 24 Jul 2024 21:05:13 +0000 (14:05 -0700)]
linux: Update the mremap C implementation [BZ #31968]

Update the mremap C implementation to support the optional argument for
MREMAP_DONTUNMAP added in Linux 5.7 since it may not always be correct
to implement a variadic function as a non-variadic function on all Linux
targets.  Return MAP_FAILED and set errno to EINVAL for unknown flag bits.
This fixes BZ #31968.

Note: A test must be added when a new flag bit is introduced.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
4 months agoEnhanced test coverage for strncmp, wcsncmp
Florian Weimer [Thu, 27 Jun 2024 14:26:56 +0000 (16:26 +0200)]
Enhanced test coverage for strncmp, wcsncmp

Add string/test-strncmp-nonarray and
wcsmbs/test-wcsncmp-nonarray.

This is the test that uncovered bug 31934.  Test run time
is more than one minute on a fairly current system, so turn
these into xtests that do not run automatically.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
4 months agoEnhance test coverage for strnlen, wcsnlen
Florian Weimer [Wed, 26 Jun 2024 09:27:54 +0000 (11:27 +0200)]
Enhance test coverage for strnlen, wcsnlen

This commit adds string/test-strnlen-nonarray and
wcsmbs/test-wcsnlen-nonarray.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
4 months agostdlib: Mark `abort` as `cold`
Noah Goldstein [Mon, 29 Jul 2024 07:34:33 +0000 (15:34 +0800)]
stdlib: Mark `abort` as `cold`

This helps HotColdSplitting in GCC/LLVM.

Thought about doing `exit` as well since its only called once per
process, but since its easy to imagine a hot path leading into
`exit(0)`, its less clear if its profitable.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agox86_64 hurd: ensure we have a large enough buffer to receive exception_raise requests.
Flavio Cruz [Tue, 30 Jul 2024 04:51:20 +0000 (00:51 -0400)]
x86_64 hurd: ensure we have a large enough buffer to receive exception_raise requests.

Message-ID: <gtxd6s4s7fi7hdrlb7zayq3akij7x6jqawwq3zfl3v4nqspulo@euucuzeonrl6>

4 months agostdlib: Allow concurrent exit (BZ 31997)
Adhemerval Zanella [Thu, 25 Jul 2024 18:41:44 +0000 (15:41 -0300)]
stdlib: Allow concurrent exit (BZ 31997)

Even if C/POSIX standard states that exit is not formally thread-unsafe,
calling it more than once is UB.  The glibc already supports
it for the single-thread, and both elf/nodelete2.c and tst-rseq-disable.c
call exit from a DSO destructor (which is called by _dl_fini, registered
at program startup with __cxa_atexit).

However, there are still race issues when it is called more than once
concurrently by multiple threads.  A recent Rust PR triggered this
issue [1], which resulted in an Austin Group ask for clarification [2].
Besides it, there is a discussion to make concurrent calling not UB [3],
wtih a defined semantic where any remaining callers block until the first
call to exit has finished (reentrant calls, leaving through longjmp, and
exceptions are still undefined).

For glibc, at least reentrant calls are required to be supported to avoid
changing the current behaviour.  This requires locking using a recursive
lock, where any exit called by atexit() handlers resumes at the point of
the current handler (thus avoiding calling the current handle multiple
times).

Checked on x86_64-linux-gnu and aarch64-linux-gnu.

[1] https://github.com/rust-lang/rust/issues/126600
[2] https://austingroupbugs.net/view.php?id=1845
[3] https://www.openwall.com/lists/libc-coord/2024/07/24/4
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
4 months agoAdd F_DUPFD_QUERY from Linux 6.10 to bits/fcntl-linux.h
Adhemerval Zanella [Tue, 16 Jul 2024 17:08:49 +0000 (17:08 +0000)]
Add F_DUPFD_QUERY from Linux 6.10 to bits/fcntl-linux.h

It was added by commit c62b758bae6af16 as a way for userspace to
check if two file descriptors refer to the same struct file.

Checked on aarch64-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoAdd STATX_SUBVOL from Linux 6.10 to bits/statx-generic.h
Adhemerval Zanella [Tue, 16 Jul 2024 17:08:48 +0000 (17:08 +0000)]
Add STATX_SUBVOL from Linux 6.10 to bits/statx-generic.h

Tested for aarch64-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoUpdate kernel version to 6.10 in header constant tests
Adhemerval Zanella [Tue, 16 Jul 2024 17:08:47 +0000 (17:08 +0000)]
Update kernel version to 6.10 in header constant tests

This patch updates the kernel version in the tests tst-mman-consts.py,
tst-mount-consts.py, and tst-pidfd-consts.py to 6.9.

There are no new constants covered by these tests in 6.10.

Tested with build-many-glibcs.py.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoUpdate syscall lists for Linux 6.10
Adhemerval Zanella [Tue, 16 Jul 2024 17:08:46 +0000 (17:08 +0000)]
Update syscall lists for Linux 6.10

Linux 6.10 changes for syscall are:

  * mseal for all architectures.
  * map_shadow_stack for x32.
  * Replace sync_file_range with sync_file_range2 for csky (which
    fixes a broken sync_file_range usage).

Update syscall-names.list and regenerate the arch-syscall.h headers
with build-many-glibcs.py update-syscalls.

Tested with build-many-glibcs.py.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoUse Linux 6.10 in build-many-glibcs.py
Adhemerval Zanella [Tue, 16 Jul 2024 17:08:45 +0000 (17:08 +0000)]
Use Linux 6.10 in build-many-glibcs.py

Tested with build-many-glibcs.py (host-libraries, compilers and glibcs
builds).
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoMitigation for "clone on sparc might fail with -EFAULT for no valid reason" (bz 31394)
Michael Karcher [Sun, 28 Jul 2024 13:30:57 +0000 (15:30 +0200)]
Mitigation for "clone on sparc might fail with -EFAULT for no valid reason" (bz 31394)

It seems the kernel can not deal with uncommitted stack space in the area intended
for the register window when executing the clone() system call. So create a nested
frame (proxy for the kernel frame) and flush it from the processor to memory to
force committing pages to the stack before invoking the system call.

Bug: https://www.mail-archive.com/debian-glibc@lists.debian.org/msg62592.html
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31394
See-also: https://lore.kernel.org/sparclinux/62f9be9d-a086-4134-9a9f-5df8822708af@mkarcher.dialup.fu-berlin.de/
Signed-off-by: Michael Karcher <sourceware-bugzilla@mkarcher.dialup.fu-berlin.de>
Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agomanual: make setrlimit() description less ambiguous
Lukas Bulwahn [Mon, 29 Jul 2024 09:08:17 +0000 (11:08 +0200)]
manual: make setrlimit() description less ambiguous

The existing description for setrlimit() has some ambiguity. It could be
understood to have the semantics of getrlimit(), i.e., the limits from the
process are stored in the provided rlp pointer.

Make the description more explicit that rlp are the input values, and that
the limits of the process is changed with this function.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agomanual/stdio: Clarify putc and putwc
Arjun Shankar [Mon, 29 Jul 2024 12:30:59 +0000 (14:30 +0200)]
manual/stdio: Clarify putc and putwc

The manual entry for `putc' described what "most systems" do instead of
describing the glibc implementation and its guarantees.  This commit
fixes that by warning that putc may be implemented as a macro that
double-evaluates `stream', and removing the performance claim.

Even though the current `putc' implementation does not double-evaluate
`stream', offering this obscure guarantee as an extension to what
POSIX allows does not seem very useful.

The entry for `putwc' is also edited to bring it in line with `putc'.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
4 months agoMIPS: Regenerate ulps
Julian Zhu [Sat, 27 Jul 2024 10:27:52 +0000 (18:27 +0800)]
MIPS: Regenerate ulps

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

Signed-off-by: Julian Zhu <jz531210@gmail.com>
4 months agomalloc: Link threading tests with $(shared-thread-library)
Florian Weimer [Sat, 27 Jul 2024 14:23:55 +0000 (16:23 +0200)]
malloc: Link threading tests with $(shared-thread-library)

Fixes build failures on Hurd.

4 months agoassert: Mark `__assert_fail` as `cold`
Noah Goldstein [Fri, 26 Jul 2024 08:35:13 +0000 (16:35 +0800)]
assert: Mark `__assert_fail` as `cold`

This helps compilers split the codegen for setting up the arguments
(`__expression`, `__filename`, etc...) from the potentially hot cold
where the `assert` is to a presumably cold region on the assertion
failure path.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Sam James <sam@gentoo.org>
4 months agostdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650]
Maciej W. Rozycki [Fri, 26 Jul 2024 12:21:34 +0000 (13:21 +0100)]
stdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650]

Complement commit b03e4d7bd25b ("stdio: fix vfscanf with matches longer
than INT_MAX (bug 27650)") and add a test case for the issue, inspired
by the reproducer provided with the bug report.

This has been verified to succeed as from the commit referred and fail
beforehand.

As the test requires 2GiB of data to be passed around its performance
has been evaluated using a choice of systems and the execution time
determined to be respectively in the range of 9s for POWER9@2.166GHz,
24s for FU740@1.2GHz, and 40s for 74Kf@950MHz.  As this is on the verge
of and beyond the default timeout it has been increased by the factor of
8.  Regardless, following recent practice the test has been added to the
standard rather than extended set.

Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agosupport: Add FAIL test failure helper
Maciej W. Rozycki [Fri, 26 Jul 2024 12:21:34 +0000 (13:21 +0100)]
support: Add FAIL test failure helper

Add a FAIL test failure helper analogous to FAIL_RET, that does not
cause the current function to return, providing a standardized way to
report a test failure with a message supplied while permitting the
caller to continue executing, for further reporting, cleaning up, etc.

Update existing test cases that provide a conflicting definition of FAIL
by removing the local FAIL definition and then as follows:

- tst-fortify-syslog: provide a meaningful message in addition to the
  file name already added by <support/check.h>; 'support_record_failure'
  is already called by 'support_print_failure_impl' invoked by the new
  FAIL test failure helper.

- tst-ctype: no update to FAIL calls required, with the name of the file
  and the line number within of the failure site additionally included
  by the new FAIL test failure helper, and error counting plus count
  reporting upon test program termination also already provided by
  'support_record_failure' and 'support_report_failure' respectively,
  called by 'support_print_failure_impl' and 'adjust_exit_status' also
  respectively.  However in a number of places 'printf' is called and
  the error count adjusted by hand, so update these places to make use
  of FAIL instead.  And last but not least adjust the final summary just
  to report completion, with any error count following as reported by
  the test driver.

- test-tgmath2: no update to FAIL calls required, with the name of the
  file of the failure site additionally included by the new FAIL test
  failure helper.  Also there is no need to track the return status by
  hand as any call to FAIL will eventually cause the test case to return
  an unsuccesful exit status regardless of the return status from the
  test function, via a call to 'adjust_exit_status' made by the test
  driver.

Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agoposix: Use <support/check.h> facilities in tst-truncate and tst-truncate64
Maciej W. Rozycki [Fri, 26 Jul 2024 12:21:34 +0000 (13:21 +0100)]
posix: Use <support/check.h> facilities in tst-truncate and tst-truncate64

Remove local FAIL macro in favor to FAIL_RET from <support/check.h>,
which provides equivalent reporting, with the name of the file of the
failure site additionally included, for the tst-truncate-common core
shared between the tst-truncate and tst-truncate64 tests.

Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agonptl: Use <support/check.h> facilities in tst-setuid3
Maciej W. Rozycki [Fri, 26 Jul 2024 12:21:34 +0000 (13:21 +0100)]
nptl: Use <support/check.h> facilities in tst-setuid3

Remove local FAIL macro in favor to FAIL_EXIT1 from <support/check.h>,
which provides equivalent reporting, with the name of the file and the
line number within of the failure site additionally included.  Remove
FAIL_ERR altogether and include ": %m" explicitly with the format string
supplied to FAIL_EXIT1 as there seems little value to have a separate
macro just for this.

Reviewed-by: DJ Delorie <dj@redhat.com>
4 months agosparc: Regenerate ULPs
Adhemerval Zanella [Thu, 25 Jul 2024 14:06:53 +0000 (11:06 -0300)]
sparc: Regenerate ULPs

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

4 months agoi386: Regenerate ULPs
Adhemerval Zanella [Thu, 25 Jul 2024 13:49:06 +0000 (10:49 -0300)]
i386: Regenerate ULPs

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

4 months agoarm: Regenerate ULPs
Adhemerval Zanella [Thu, 25 Jul 2024 13:41:00 +0000 (10:41 -0300)]
arm: Regenerate ULPs

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

4 months agoaarch64: Regenerate ULPs
Adhemerval Zanella [Thu, 25 Jul 2024 13:40:32 +0000 (10:40 -0300)]
aarch64: Regenerate ULPs

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

4 months agopowerpc: Regenerate ULPs for soft-fp
Adhemerval Zanella [Thu, 25 Jul 2024 13:33:40 +0000 (10:33 -0300)]
powerpc: Regenerate ULPs for soft-fp

From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61.

4 months agopowerpc: Update ulps for fpu
jeevitha [Wed, 24 Jul 2024 05:58:54 +0000 (11:28 +0530)]
powerpc: Update ulps for fpu

Adjust the ULPs for the log2p1 implementation.

4 months agoriscv: Update ulps
Khem Raj [Wed, 24 Jul 2024 04:43:56 +0000 (21:43 -0700)]
riscv: Update ulps

Generated with make regen-ulps using gcc14 on a visionfive2 SBC.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
4 months agos390x: Regenerate ULPs.
Stefan Liebler [Thu, 25 Jul 2024 12:14:22 +0000 (14:14 +0200)]
s390x: Regenerate ULPs.

Needed due to:
"This patch adds larger ulp errors for the log2p1 function."
commit 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61

4 months agox32/cet: Support shadow stack during startup for Linux 6.10
H.J. Lu [Tue, 23 Jul 2024 00:47:22 +0000 (17:47 -0700)]
x32/cet: Support shadow stack during startup for Linux 6.10

Use RXX_LP in RTLD_START_ENABLE_X86_FEATURES.  Support shadow stack during
startup for Linux 6.10:

commit 2883f01ec37dd8668e7222dfdb5980c86fdfe277
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Mar 15 07:04:33 2024 -0700

    x86/shstk: Enable shadow stacks for x32

    1. Add shadow stack support to x32 signal.
    2. Use the 64-bit map_shadow_stack syscall for x32.
    3. Set up shadow stack for x32.

Add the map_shadow_stack system call to <fixup-asm-unistd.h> and regenerate
arch-syscall.h.  Tested on Intel Tiger Lake with CET enabled x32.  There
are no regressions with CET enabled x86-64.  There are no changes in CET
enabled x86-64 _dl_start_user.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
This page took 0.089167 seconds and 5 git commands to generate.