about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
...
* misc: Add internal __getauxval2 functionFlorian Weimer2020-10-272-6/+32
| | | | | | | | The explicit error return value (without in-band signaling) avoids complicated steps to detect errors based on whether errno has been updated. Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
* Remove NEWS entry about ftime removalAdhemerval Zanella2020-10-271-5/+0
| | | | Now that it was reinstate with 30a0b167d3.
* time: Add 64-bit time_t support for ftimeAdhemerval Zanella2020-10-277-16/+70
| | | | | | | | | It basically calls the 64-bit __clock_gettime64 and adds the overflow check. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Reinstate ftime and add deprecate message on ftime usageAdhemerval Zanella2020-10-276-45/+65
| | | | | | | This patch revert "Move ftime to a compatibility symbol" (commit 14633d3e568eb9770a7e5046eff257113e0453fb). Checked on x86_64-linux-gnu and i686-linux-gnu.
* Update kernel version to 5.9 in tst-mman-consts.py.Joseph Myers2020-10-261-1/+1
| | | | | | | | This patch updates the kernel version in the test tst-mman-consts.py to 5.9. (There are no new MAP_* constants covered by this test in 5.9 that need any other header changes.) Tested with build-many-glibcs.py.
* Amend grammar and add a descriptionJonny Grant2020-10-261-3/+4
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Fix typo in NEWS fileJonathan Wakely2020-10-261-1/+1
|
* Remove timing related checks of time/tst-cpuclock1Stefan Liebler2020-10-261-59/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting with the commit 04deeaa9ea74b0679dfc9d9155a37b6425f19a9f "Fix time/tst-cpuclock1 intermitent failures" (2020-07-11), this test fails quite often on s390x/s390 with one/multiple of those: "before - after" / "nanosleep time" / "dead - after" ourside reasonable range. On a zVM/kvm guest the CPUs are shared between multiple guests. And even on the lpar (kvm host) the CPUs are usually shared between multiple lpars. The defined CPUs for a lpar/zVM-system could also have lower weights compared to other lpars which let the steal time further grow. Usually I build (-j$(nproc)) and test (PARALLELMFLAGS="-j$(nproc)") glibc multiple times, e.g. with different GCCs, on various lpars or zVM guests at the same time. During this time, I've run the test for 13500 times and obvserved the following fails: ~600x "before - after" ~60x "nanosleep time" ~70x "dead - after" I've also observed a lot of "before - after" fails on a intel kvm-guest while building/testing glibc on it. The mentioned commit has tighten the limits of valid tv_nsec ranges: "before - after" (expected: 500000000): - 100000000 ... 600000000 + 450000000 ... 550000000 "nanosleep time" (expected: 100000000): - 100000000 ... 200000000 + 090000000 ... 120000000 "dead - after" (expected: 100000000): - ... 200000000 + 090000000 ... 120000000 The test itself forks a child process which chew_cpu (user- and kernel-space). The parent process sleeps with nanosleep(0.5s) and measures the child_clock time: diff = after - before With much workload on the machine, the child won't make much progess and it can fall much beyond the minimum limit. Afterwards the parent process sleeps with clock_nanosleep (child_clock, 0.1s): diff = afterns - after The test currently also allows 0.9 * 0.1s which would be an error. Depending on the workload, the maximum limit can exceed the 1.2 * 0.1s. For "dead - after", the parent process kills the child process and waits long enough to let the child finish dying. Then it gets the time of the child: diff = dead - after Note that diff also contains the time for the previous clock_nanosleep. Thus you'll often see both fails at the same time. After discussion on the mailing list, we've decided to keep the functional checks for the clock* functions and remove the timing related checks as those are prone to false positives. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update syscall lists for Linux 5.9.Joseph Myers2020-10-2326-2/+28
| | | | | | | | Linux 5.9 has one new syscall, close_range. Update syscall-names.list and regenerate the arch-syscall.h headers with build-many-glibcs.py update-syscalls. Tested with build-many-glibcs.py.
* Use Linux 5.9 in build-many-glibcs.py.Joseph Myers2020-10-221-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 5.9. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Reword description of SXID_* tunable propertiesSiddhesh Poyarekar2020-10-222-10/+12
| | | | | | | | | | | | | The SXID_* tunable properties only influence processes that are AT_SECURE, so make that a bit more explicit in the documentation and comment. Revisiting the code after a few years I managed to confuse myself, so I imagine there could be others who may have incorrectly assumed like I did that the SXID_ERASE tunables are not inherited by children of non-AT_SECURE processes. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* New benchtest: pthread locksDJ Delorie2020-10-212-1/+556
| | | | | | | | Performance benchmarks for various posix locks: mutex, rwlock, spinlock, condvar, and semaphore. Each test is performed with an empty loop body or with a computationally "interesting" (i.e. difficult to optimize away, and used just to allow lock code to be "hidden" in the filler's CPU cycles).
* y2038: nptl: Provide __futex_clock_wait_bitset64 to support 64 bit bitsetLukasz Majewski2020-10-213-2/+53
| | | | | | | | | | | | | | | The commit: "y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bit" SHA1: 29e9874a048f47e2d46c40253036c8d2de921548 introduced support for 64 bit timeouts. Unfortunately, it was missing the code for bitset - i.e. lll_futex_clock_wait_bitset C preprocessor macro was used. As a result the 64 bit struct __timespec64 was coerced to 32 bit struct timespec and regression visible as timeout was observed (nptl/tst-robust10 on s390). Reported-by: Stefan Liebler <stli@linux.ibm.com> Tested-by: Stefan Liebler <stli@linux.ibm.com>
* C-SKY: Make dynamic linker's name compitable with the older gcc.Cooper Qu2020-10-211-9/+26
| | | | | | | | | | | | | | __CSKY_HARD_FLOAT_ABI__ was added on gcc 11 to specify whether -mfloat-abi=hard is set. On older gcc, the float ABI is defined solely with __CSKY_HARD_FLOAT__. If __CSKY_HARD_FLOAT__ is set, it can be either a hard-float ABI (gcc older than 11, or gcc11 -mfloat-abi=hard (__CSKY_HARD_FLOAT_ABI__ is set) or -mfloat-abi=softfp (__CSKY_HARD_FLOAT_ABI__ is not set). To be compatible with older gcc, use __CSKY_HARD_FLOAT_FPU_SF__ identify if -mfloat-abi is supported, because it is added to gcc at the same time as -mfloat-abi. Reviewed-by: Mao Han <han_mao@linux.alibaba.com> Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
* Revert "C-SKY:Fix dynamic linker's name when mfloat-abi=softfp."Mao Han2020-10-201-1/+1
| | | | This reverts commit 7449320983b664aba506d7674ea0ce142dd3d4ed.
* Move vtimes to a compatibility symbolAdhemerval Zanella2020-10-197-135/+48
| | | | | | | | | | | | | | I couldn't pinpoint which standard has added it, but no other POSIX system supports it and/or no longer provide it. The 'struct vtimes' also has a lot of drawbacks due its limited internal type size. I couldn't also see find any project that actually uses this symbol, either in some dignostic way (such as sanitizer). So I think it should be safer to just move to compat symbol, instead of deprecated. The idea it to avoid new ports to export such broken interface (riscv32 for instance). Checked on x86_64-linux-gnu and i686-linux-gnu.
* y2038: linux: Provide __time64 implementationLukasz Majewski2020-10-194-3/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the glibc the time function can use vDSO (on power and x86 the USE_IFUNC_TIME is defined), time syscall or 'default' time() from ./time/time.c (as a fallback). In this patch the last function (time) has been refactored and moved to ./sysdeps/unix/sysv/linux/time.c to be Linux specific. The new __time64 explicit 64 bit function for providing 64 bit value of seconds after epoch (by internally calling __clock_gettime64) has been introduced. Moreover, a 32 bit version - __time has been refactored to internally use __time64. The __time is now supposed to be used on systems still supporting 32 bit time (__TIMESIZE != 64) - hence the necessary check for time_t potential overflow. The iFUNC vDSO direct call optimization has been removed from both i686 and powerpc32 (USE_IFUNC_TIME is not defined for those architectures anymore). The Linux kernel does not provide a y2038 safe implementation of time neither it plans to provide it in the future, __clock_gettime64 should be used instead. Keeping support for this optimization would require to handle another build permutation (!__ASSUME_TIME64_SYSCALLS && USE_IFUNC_TIME which adds more complexity and has limited use (since the idea is to eventually have a y2038 safe glibc build). Build tests: ./src/scripts/build-many-glibcs.py glibcs Run-time tests: - Run specific tests on ARM/x86 32bit systems (qemu): https://github.com/lmajewski/meta-y2038 and run tests: https://github.com/lmajewski/y2038-tests/commits/master Above tests were performed with Y2038 redirection applied as well as without to test proper usage of both __time64 and __time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* rt: Fix typos in comments in <aio.h>Jonny Grant2020-10-191-7/+6
|
* C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.Cooper Qu2020-10-191-1/+1
| | | | | | | | The dynamic linker should be chosen according to float abi, the predefined macro __CSKY_HARD_FLOAT__ stand for architecure not abi. Reviewed-by: Mao Han <han_mao@linux.alibaba.com>
* x86: Initialize CPU info via IFUNC relocation [BZ 26203]H.J. Lu2020-10-169-865/+949
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | X86 CPU features in ld.so are initialized by init_cpu_features, which is invoked by DL_PLATFORM_INIT from _dl_sysdep_start. But when ld.so is loaded by static executable, DL_PLATFORM_INIT is never called. Also x86 cache info in libc.o and libc.a is initialized by a constructor which may be called too late. Since some fields in _rtld_global_ro in ld.so are initialized by dynamic relocation, we can also initialize x86 CPU features in _rtld_global_ro in ld.so and cache info in libc.so by initializing dummy function pointers in ld.so and libc.so via IFUNC relocation. Key points: 1. IFUNC is always supported, independent of --enable-multi-arch or --disable-multi-arch. Linker generates IFUNC relocations from input IFUNC objects and ld.so performs IFUNC relocations. 2. There are no IFUNC dependencies in ld.so before dynamic relocation have been performed, 3. The x86 CPU features in ld.so is initialized by DL_PLATFORM_INIT in dynamic executable and by IFUNC relocation in dlopen in static executable. 4. The x86 cache info in libc.o is initialized by IFUNC relocation. 5. In libc.a, both x86 CPU features and cache info are initialized from ARCH_INIT_CPU_FEATURES, not by IFUNC relocation, before __libc_early_init is called. Note: _dl_x86_init_cpu_features can be called more than once from DL_PLATFORM_INIT and during relocation in ld.so.
* Add NEWS entry for ftime compatibility moveAdhemerval Zanella2020-10-161-0/+5
|
* support: Add create_temp_file_in_dirAdhemerval Zanella2020-10-162-4/+15
| | | | It allows created a temporary file in a specified directory.
* linux: Add __readdir_unlockedAdhemerval Zanella2020-10-163-67/+30
| | | | | | And use it on readdir_r implementation. Checked on i686-linux-gnu.
* linux: Simplify opendir buffer allocationAdhemerval Zanella2020-10-162-34/+20
| | | | | | | | | The fallback allocation is removed, so the possible size constraint should be analyzed just once; __alloc_dir assumes that 'statp' argument is non-null, and the max_buffer_size move to close its used. Checked on x86_64-linux-gnu and i686-linux-gnu.
* linux: Move posix dir implementations to LinuxAdhemerval Zanella2020-10-1614-309/+462
| | | | | | | | | | | | | This generic implementation already expects a getdents API which is Linux specific. It also allows simplify it by assuming _DIRENT_HAVE_D_RECLEN and _DIRENT_HAVE_D_OFF support. The readdir are also expanded on each required implementation, futher fixes and improvements will make parametrize the implementation more complex. Checked on x86_64-linux-gnu, i686-linux-gnu, and with a build for all affected ABIs.
* linux: Add 64-bit time_t support for wait3Adhemerval Zanella2020-10-162-0/+48
| | | | | | | | It basically calls the 64-bit time_t wait4 internal symbol. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* Move ftime to a compatibility symbolAdhemerval Zanella2020-10-166-79/+50
| | | | | | | | | | It was made deprecated on 2.31, so it moves to compat symbol after two releases. It was also removed from exported symbol for riscv32 (since ABI will be supported on for 2.33). Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Fix time64 support for futimesatAdhemerval Zanella2020-10-162-54/+6
| | | | | | | | | | | | The generic implementation does not support time64 and the default one return overflow for invalid tv_sec with UTIME_NOW / UTIME_OMIT (which is valid since tv_sec in such cases is ignored by the kernel). Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Use INTERNAL_SYSCALL on fstatat{64}Adhemerval Zanella2020-10-164-28/+34
| | | | | | | | | | | | | | | | | | | Although not required by the standards, some code expects that a successful stat call should not set errno. However since aa03f722f3b99 'linux: Add {f}stat{at} y2038 support', on 32-bit systems with 32-bit time_t supporrt, stat implementation will first issues __NR_statx and if it fails with ENOSYS issue the system stat syscall. On architecture running on kernel without __NR_statx support the first call will set the errno to ENOSYS, even when the following stat syscall might not fail. This patch fixes by using INTERNAL_SYSCALL and only setting the errno value when function returns. Checked on i686-linux-gnu, x86_64-linux-gnu, sparc64-linux-gnu, sparcv9-linux-gnu, powerpc64-linux-gnu, powerpc64le-linux-gnu, arm-linux-gnueabihf, and aarch64-linux-gnu.
* shm tests: Append PID to names passed to shm_open [BZ #26737]H.J. Lu2020-10-152-11/+35
| | | | | | | | | | | | Append PID to names passed to shm_open in shm tests to avoid random FAIL: rt/tst-shm-cancel FAIL: rt/tst-shm due to the same name passed to shm_open and shm_unlink when more than one "make check" running in parallel on the same machine. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysvipc: Fix tst-sysvshm-linux on x32Adhemerval Zanella2020-10-151-4/+5
| | | | | | | | | The Linux shminfo fields are '__syscall_ulong_t' (which is 64-bit for x32). This patch fixes the test to compare againt the correct type and to only clamp the value if '__syscall_ulong_t' is the same size of 'unsigned long int'. Checked on x86_64-linux-gnu-x32.
* x86/CET: Update vfork to prevent child returnH.J. Lu2020-10-154-71/+113
| | | | | | | | | Child of vfork should either call _exit or one of the exec family of functions. But normally there is nothing to prevent child of vfork from return of the vfork-calling function. Simpilfy x86 vfork when shadow stack is in use to introduce mismatched shadow stack in child of vfork to trigger SIGSEGV when the child returns from the function in which vfork was called.
* resolv: Serialize processing in resolv/tst-resolv-txnid-collisionFlorian Weimer2020-10-151-0/+5
| | | | | | | | | | | When switching name servers, response processing by two server threads clobbers the global test state. (There is still some risk that this test is negatively impact by packet drops and packet reordering, but this applies to many of the resolver tests and is difficult to avoid.) Fixes commit f1f00c072138af90ae6da180f260111f09afe7a3 ("resolv: Handle transaction ID collisions in parallel queries (bug 26600)").
* statfs: add missing f_flags assignmentChen Li2020-10-151-0/+1
| | | | | | f_flags is added into struct statfs since Linux 2.6.36, which is lacked in glibc's statfs64.c until now. So mount flags is uninitialized on platforms having no statfs64 syscall in kernel, e.g., alpha and its derivation
* y2038: Remove not used __fstatat_time64 defineLukasz Majewski2020-10-151-1/+0
| | | | | This define is only present in the ./include/sys/stat.h file. As it is not used in any other place it is eligible to be removed.
* y2038: nptl: Convert pthread_mutex_{clock|timed}lock to support 64 bitLukasz Majewski2020-10-1510-31/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_mutex_clocklock and pthread_mutex_timedlock have been converted to support 64 bit time. This change uses: - New __futex_clocklock_wait64 (instead of lll_timedwait) from ./sysdeps/nptl/futex-helpers.c and - New __futex_clocklock64 function (instead of lll_clocklock) - New futex_lock_pi64 defined in sysdeps/nptl/futex-internal.h The pthread_mutex_{clock|timed}lock only accepts absolute time. Moreover, there is no need to check for NULL passed as *abstime pointer to the syscalls as those calls have exported symbols marked with __nonull attribute for abstime. Some architectures - namely x86, powerpc and s390 - do support lock elision. For those - adjustments have been made in arch specific elision-*.c files to use __futex_clocklock64 instead of lll_clocklock. The __lll_lock_elision (aliased to __lll_clocklock_elision in e.g. sysdeps/unix/sysv/linux/s390/elision-timed.c) just uses, in this patch provided, __futex_clocklock64. For systems with __TIMESIZE != 64 && __WORDSIZE == 32: - Conversions between 64 bit time to 32 bit are necessary - Redirection to pthread_mutex_{clock|timed}lock will provide support for 64 bit time Build tests: ./src/scripts/build-many-glibcs.py glibcs Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* sysvipc: Return EINVAL for invalid shmctl commandsAdhemerval Zanella2020-10-143-13/+69
| | | | | | | | It avoids regressions on possible future commands that might require additional libc support. The downside is new commands added by newer kernels will need further glibc support. Checked on x86_64-linux-gnu and i686-linux-gnu (Linux v4.15 and v5.4).
* sysvipc: Fix IPC_INFO and SHM_INFO handling [BZ #26636]Adhemerval Zanella2020-10-143-7/+204
| | | | | | | | | | | | | | | Both commands are Linux extensions where the third argument is either a 'struct shminfo' (IPC_INFO) or a 'struct shm_info' (SHM_INFO) instead of 'struct shmid_ds'. And their information does not contain any time related fields, so there is no need to extra conversion for __IPC_TIME64. The regression testcase checks for Linux specifix SysV ipc message control extension. For SHM_INFO it tries to match the values against the tunable /proc values and for MSG_STAT/MSG_STAT_ANY it check if the create\ shared memory is within the global list returned by the kernel. Checked on x86_64-linux-gnu and on i686-linux-gnu (Linux v5.4 and on Linux v4.15).
* AArch64: Use __memcpy_simd on Neoverse N2/V1Wilco Dijkstra2020-10-143-2/+8
| | | | | | | Add CPU detection of Neoverse N2 and Neoverse V1, and select __memcpy_simd as the memcpy/memmove ifunc. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* resolv: Handle transaction ID collisions in parallel queries (bug 26600)Florian Weimer2020-10-143-20/+356
| | | | | | If the transaction IDs are equal, the old check attributed both responses to the first query, not recognizing the second response. This fixes bug 26600.
* support: Provide a way to clear the RA bit in DNS server responsesFlorian Weimer2020-10-142-1/+7
|
* support: Provide a way to reorder responses within the DNS test serverFlorian Weimer2020-10-145-28/+135
|
* Add missing stat/mknod symbol on libc.abilist some ABIsAdhemerval Zanella2020-10-136-0/+36
| | | | | | It adds the missing new symbols from 8ed005daf0 and 589260cef8 (which added versioned symbols for {f,l}stat{at}{64} and mknod{a}t) on some libc.abilist ABIs.
* manual: correct the spelling of "MALLOC_PERTURB_" [BZ #23015]Benno Schulenberg2020-10-131-1/+1
| | | | Reported-by: Martin Dorey <martin.dorey@hds.com>
* manual: replace an obsolete collation example with a valid oneBenno Schulenberg2020-10-131-3/+3
| | | | | | | | | | | | | In the Spanish language, the digraph "ll" has not been considered a separate letter since 1994: https://www.rae.es/consultas/exclusion-de-ch-y-ll-del-abecedario Since January 1998 (commit 49891c106244888123557fca7fddda4fa1f96b1d), glibc's locale data no longer specifies "ch" and "ll" as separate collation elements. So, it's better to not use "ll" in an example. Also, the Czech "ch" is a better example as it collates in a more surprising place.
* rtld: fix typo in commentRolf Eike Beer2020-10-131-1/+1
|
* elf: Add missing <dl-procinfo.h> header to elf/dl-usage.cMatheus Castanho2020-10-121-0/+1
|
* hurd: support clock_gettime(CLOCK_PROCESS/THREAD_CPUTIME_ID)Samuel Thibault2020-10-111-14/+74
| | | | | * sysdeps/mach/clock_gettime.c (__clock_gettime): Add support for CLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID.
* linux: Move xmknod{at} to compat symbolsAdhemerval Zanella2020-10-098-40/+101
| | | | | | | | | | | It also decouple mknod{at} from xmknod{at}. The riscv32 ABI was added on 2.33, so it is safe to remove the old __xmknot{at} symbols and just provide the newer mknod{at} ones. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>
* linux: Add {f}stat{at} y2038 supportAdhemerval Zanella2020-10-0914-47/+354
| | | | | | | | | | | | | | | | | | | | A new struct __stat{64}_t64 type is added with the required __timespec64 time definition. Only LFS is added, 64-bit time with 32-bit offsets is not supposed to be supported (no existing glibc configuration supports such a combination). It is done with an extra __NR_statx call plus a conversion to the new __stat{64}_t64 type. The statx call is done only for 32-bit time_t ABIs. Internally some extra routines to copy from/to struct stat{64} to struct __stat{64} used on multiple implementations (stat, fstat, lstat, and fstatat) are added on a extra implementation (stat_t64_cp.c). Alse some extra routines to copy from statx to __stat{64} is added on statx_cp.c. Checked with a build for all affected ABIs. I also checked on x86_64, i686, powerpc, powerpc64le, sparcv9, sparc64, s390, and s390x. Reviewed-by: Lukasz Majewski <lukma@denx.de>