about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* Turn on -Wimplicit-fallthrough by default if availableFlorian Weimer2024-08-093-1/+36
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* LoongArch: Add cfi instructions for _dl_tlsdesc_dynamicmengqinggang2024-08-095-373/+258
| | | | | | | | | | | | | | 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.
* LoongArch: Regenerate ULPscaiyinyu2024-08-091-32/+32
| | | | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
* RISC-V: Regenerate ULPsJulian Zhu2024-08-081-32/+32
| | | | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* MIPS: Regenerate ULPsJulian Zhu2024-08-082-51/+51
| | | | | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f. Signed-off-by: Julian Zhu <jz531210@gmail.com> Reviewed-by: Florian Weimer <fweimer@redhat.com>
* powerpc64le: Update ulpsFlorian Weimer2024-08-081-12/+12
| | | | Based on results from a POWER8 system with a GCC 8 build.
* elf: Remove struct dl_init_args from elf/dl-open.cFlorian Weimer2024-08-081-23/+3
| | | | It is completely redundant with struct dl_open_args.
* s390x: Update ulpsFlorian Weimer2024-08-081-32/+32
| | | | Based on results from a z16 system with a GCC 8 build.
* nptl: Fix stray process left by tst-cancel7 blocking testingMaciej W. Rozycki2024-08-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* nptl: Reorder semaphore release in tst-cancel7Maciej W. Rozycki2024-08-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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>
* powerpc: Regenerate ULPs for soft-fpAdhemerval Zanella2024-08-071-27/+27
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* powerpc: Update soft-fp ulpsAdhemerval Zanella2024-08-071-30/+30
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* sparc: Regenerate ULPsAdhemerval Zanella2024-08-071-31/+31
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* i386: Regenerate ULPsAdhemerval Zanella2024-08-072-73/+73
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* arm: Regenerate ULPsAdhemerval Zanella2024-08-071-20/+20
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* aarch64: Regenerate ULPsAdhemerval Zanella2024-08-071-32/+32
| | | | From new tests added by 07972839108495245d8b93ca546462b3f4dad47f.
* sysdeps: Re-flow and sort multiline gnu/Makefile definitionsAdhemerval Zanella2024-08-071-12/+42
|
* login: Re-flow and sort multiline Makefile definitionsAdhemerval Zanella2024-08-071-11/+53
|
* benchtests: Add random memset benchmarkWilco Dijkstra2024-08-072-0/+186
| | | | | | | | | 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>
* AArch64: Improve generic strlenWilco Dijkstra2024-08-071-12/+27
| | | | | | | | | 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>
* nss: Fix incorrect switch fall-through in tst-nss-gai-actionsFlorian Weimer2024-08-071-0/+1
| | | | | | This only happened on test failure. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* added inputs giving large errors on x86_64 for new C23 functionsPaul Zimmermann2024-08-075-44/+5475
| | | | | | | | | | | 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>
* stdlib: Link tst-concurrent-quick_exit with $(shared-thread-library)Adhemerval Zanella2024-08-061-0/+1
| | | | | This avoids a Hurd build failure. Fixes commit c6af8a9a3c ("stdlib: Allow concurrent quick_exit (BZ 31997)").
* Use binutils 2.43 branch in build-many-glibcs.pyJoseph Myers2024-08-061-1/+1
| | | | | | | This patch makes build-many-glibcs.py use binutils 2.43 branch. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* rtld: Add test case for '--' optionHenrik Lindström2024-08-062-0/+48
| | | | Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rtld: Fix handling of '--' optionHenrik Lindström2024-08-061-6/+10
| | | | | It always resulted in the error `unrecognized option '--'` previously. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* manual/stdio: Further clarify putc, putwc, getc, and getwcArjun Shankar2024-08-061-17/+10
| | | | | | | | | | | 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>
* LoongArch: Update Ulps.caiyinyu2024-08-061-4/+4
| | | | | | From new tests added by 4dc22baa84bdb4111c0ac0db7139bf9ab953bf61. Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
* stdlib: Allow concurrent quick_exit (BZ 31997)Adhemerval Zanella2024-08-055-146/+196
| | | | | | | | | | | | | | | | | | | | | 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>
* elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717)Florian Weimer2024-08-0512-44/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* elf: Clarify and invert second argument of _dl_allocate_tls_initFlorian Weimer2024-08-054-9/+12
| | | | | | | Also remove an outdated comment: _dl_allocate_tls_init is called as part of pthread_create. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix name space violation in fortify wrappers (bug 32052)Andreas Schwab2024-08-054-63/+63
| | | | | | Rename the identifier sz to __sz everywhere. Fixes: a643f60c53 ("Make sure that the fortified function conditionals are constant")
* iconv: Fix matching of multi-character transliterations (bug 31859)Andreas Schwab2024-08-055-1/+125
| | | | | | 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.
* x86: Tunables may incorrectly set Prefer_PMINUB_for_stringop (bug 32047)Florian Weimer2024-08-021-0/+1
| | | | | | | Fixes commit 5bcf6265f215326d14dfacdce8532792c2c7f8f8 ("x86: Disable non-temporal memset on Skylake Server"). Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* x86: Add missing switch/case fall-through markers to init_cpu_featuresFlorian Weimer2024-08-021-0/+2
| | | | | | | The commits introducing these fall-throughs intended them to happen. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* stdlib: Link tst-concurrent-exit with $(shared-thread-library)Florian Weimer2024-08-021-0/+1
| | | | | This avoids a Hurd build failure. Fixes commit f6ba993e0cda0ca ("stdlib: Allow concurrent exit (BZ 31997)").
* hurd: Fix missing pthread_ compat symbol in libcSamuel Thibault2024-08-0112-10/+80
| | | | | | | | | | | | | | | | 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
* resolv: Fix tst-resolv-short-response for older GCC (bug 32042)Florian Weimer2024-08-011-2/+4
| | | | | | | Previous GCC versions do not support the C23 change that allows labels on declarations. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Add mremap testsH.J. Lu2024-08-017-0/+221
| | | | | | | | 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>
* mremap: Update manual entryH.J. Lu2024-08-011-7/+35
| | | | | | | | | | 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>
* linux: Update the mremap C implementation [BZ #31968]H.J. Lu2024-08-011-1/+13
| | | | | | | | | | | | | 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>
* Enhanced test coverage for strncmp, wcsncmpFlorian Weimer2024-08-015-1/+200
| | | | | | | | | | | 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>
* Enhance test coverage for strnlen, wcsnlenFlorian Weimer2024-08-015-0/+144
| | | | | | | This commit adds string/test-strnlen-nonarray and wcsmbs/test-wcsnlen-nonarray. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
* stdlib: Mark `abort` as `cold`Noah Goldstein2024-07-311-1/+1
| | | | | | | | | | 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>
* x86_64 hurd: ensure we have a large enough buffer to receive exception_raise ↵Flavio Cruz2024-07-301-1/+8
| | | | | | requests. Message-ID: <gtxd6s4s7fi7hdrlb7zayq3akij7x6jqawwq3zfl3v4nqspulo@euucuzeonrl6>
* stdlib: Allow concurrent exit (BZ 31997)Adhemerval Zanella2024-07-303-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add F_DUPFD_QUERY from Linux 6.10 to bits/fcntl-linux.hAdhemerval Zanella2024-07-301-0/+1
| | | | | | | | 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>
* Add STATX_SUBVOL from Linux 6.10 to bits/statx-generic.hAdhemerval Zanella2024-07-301-0/+1
| | | | | Tested for aarch64-linux-gnu. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Update kernel version to 6.10 in header constant testsAdhemerval Zanella2024-07-303-4/+4
| | | | | | | | | | 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>
* Update syscall lists for Linux 6.10Adhemerval Zanella2024-07-3027-3/+32
| | | | | | | | | | | | | | | 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>