Age | Commit message (Collapse) | Author |
|
stdlib.h declares rand_r if __USE_POSIX; i.e., POSIX.1:1990. But
rand_r was added along with threads, so the condition should be
__USE_POSIX199506. This patch corrects the condition.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20074]
* stdlib/stdlib.h (rand_r): Declare if [__USE_POSIX199506], not if
[__USE_POSIX].
* conform/Makefile (test-xfail-XPG4/stdlib.h/conform): Remove
variable.
|
|
UNIX98 and XPG4 have ttyslot in <stdlib.h>. glibc, however, has it in
<unistd.h>, for __USE_MISC || (__USE_XOPEN_EXTENDED && !__USE_UNIX98),
but no supported standard has it in <unistd.h>.
This patch adds a properly conditioned declaration to <stdlib.h> (only
enabled for the relevant standards, not for __USE_MISC or __USE_GNU).
The <unistd.h> declaration is restricted to __USE_MISC. Some relevant
XFAILs are removed.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20051]
* posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98]
(ttyslot): Do not declare.
* stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K]
(ttyslot): New prototype.
* conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove
variable.
(test-xfail-UNIX98/stdlib.h/conform): Likewise.
|
|
The testcase tst-cancel[x]17 ends sometimes with a segmentation fault.
This happens in one of 10000 cases. Then the real testcase has already
exited with success and returned from do_test(). The segmentation fault
occurs after returning from main in _dl_fini().
In those cases, the aio_read(&a) was not canceled because the read
request was already in progress. In the meanwhile aio_write(ap) wrote
something to the pipe and the read request is able to read the
requested byte.
The read request hasn't finished before returning from do_test().
After it finishes, it writes the return value and error code from the
read syscall to the struct aiocb a, which lies on the stack of do_test.
The stack of the subsequent function call of _dl_fini or _dl_sort_fini,
which is inlined in _dl_fini is corrupted.
In case of S390, it reads a zero and decrements it by 1:
unsigned int k = nmaps - 1;
struct link_map **runp = maps[k]->l_initfini;
The load from unmapped memory leads to the segmentation fault.
The stack corruption also happens on other architectures.
I saw them e.g. on x86 and ppc, too.
This patch adds an aio_suspend call to ensure, that the read request
is finished before returning from do_test().
ChangeLog:
* nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a).
|
|
The first SIGUSR1 signal could arrive when sigusr1_sender_pid
was still 0. As a result, kill would send SIGSTOP to the
entire process group. This would cause the test to hang before
printing any output.
This commit also adds a sched_yield to the signal source, so that
it does not flood the parent process with signals it has never a
chance to handle.
Even with these changes, tst-mallocfork2 still fails reliably
after the fix in commit commit 56290d6e762c1194547e73ff0b948cd79d3a1e03
(Increase fork signal safety for single-threaded processes) is
backed out.
|
|
This patch corrects some spurious conformtest stdlib.h expectations
for XPG3 (not based on a full review of the expectations for that
standard, so other issues may remain).
Tested for x86_64 and x86.
* conform/data/stdlib.h-data (a64l): Do not expect for [XPG3].
(ecvt): Likewise.
(fcvt): Likewise.
(gcvt): Likewise.
(getsubopt): Likewise.
(grantpt): Likewise.
(initstate): Likewise.
(l64a): Likewise.
(mktemp): Likewise.
(mkstemp): Likewise.
(ptsname): Likewise.
(random): Likewise.
(realpath): Likewise.
(setstate): Likewise.
(srandom): Likewise.
(ttyslot): Likewise.
(unlockpt): Likewise.
(valloc): Likewise.
|
|
This patch corrects a spurious conformtest expectation of strdup in
string.h for XPG3.
Tested for x86_64 and x86.
* conform/data/string.h-data (strdup): Do not expect for [XPG3].
* conform/Makefile (test-xfail-XPG3/string.h/conform): Remove
variable.
|
|
In static executable, since init_cpu_features is called early from
__libc_start_main, there is no need to call it again in dl_platform_init.
[BZ #20072]
* sysdeps/i386/dl-machine.h (dl_platform_init): Call
init_cpu_features only if SHARED is defined.
* sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise.
|
|
* sysdeps/x86/cacheinfo.c (init_cacheinfo): Check and support
non-inclusive caches on Intel processors.
|
|
This will allow us to change many aspects of the malloc implementation
while preserving compatibility with existing Emacs binaries.
As a result, existing Emacs binaries will have a larger RSS, and Emacs
needs a few more milliseconds to start. This overhead is specific
to Emacs (and will go away once Emacs switches to its internal malloc).
The new checks to make free and realloc compatible with the dumped heap
are confined to the mmap paths, which are already quite slow due to the
munmap overhead.
This commit weakens some security checks, but only for heap pointers
in the dumped main arena. By default, this area is empty, so those
checks are as effective as before.
|
|
This patch corrects spurious conformtest expectations of getdate and
getdate_err for XPG3. (This is not based on a full review of the
expectations, so there may be other issues where the header and tests
agree but are both incorrect.)
Tested for x86_64 and x86.
* conform/data/time.h-data (getdate_err): Do not expect for
[XPG3].
(getdate): Likewise.
* conform/Makefile (test-xfail-XPG3/time.h/conform): Remove
variable.
|
|
The conformtest tests of unistd.h fail for XPG3 because of various
expectations that are incorrect for XPG3. This patch corrects those
bogus expectations, and one bogus expectation for XPG4. (This is not
based on a full review of the standards so there may well still be
other bugs in the expectations for this header.)
Tested for x86_64 and x86.
* conform/data/unistd.h-data (F_LOCK): Do not expect for [XPG3].
(F_ULOCK): Likewise.
(F_TEST): Likewise.
(F_TLOCK): Likewise.
(useconds_t): Likewise.
(intptr_t): Do not expect for [XPG3] or [XPG4].
(brk): Do not expect for [XPG3]
(fchown): Likewise.
(fchdir): Likewise.
(ftruncate): Likewise.
(getdtablesize): Likewise.
(gethostid): Likewise.
(getpagesize): Likewise.
(getpgid): Likewise.
(getsid): Likewise.
(getwd): Likewise.
(lchown): Likewise.
(lockf): Likewise.
(readlink): Likewise.
(sbrk): Likewise.
(setpgrp): Likewise.
(setregid): Likewise.
(setreuid): Likewise.
(symlink): Likewise.
(sync): Likewise.
(truncate): Likewise.
(ualarm): Likewise.
(usleep): Likewise.
(vfork): Likewise.
* conform/Makefile (test-xfail-XPG3/unistd.h/conform): Remove
variable.
|
|
unistd.h declares gethostname for __USE_UNIX98 || __USE_XOPEN2K. But
it's also in XPG4 (XNS volume - C438 - not the main definitions of
system interfaces and headers in C435). This patch corrects the
condition.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20054]
* posix/unistd.h (gethostname): Declare if [__USE_XOPEN_EXTENDED],
not [__USE_UNIX98].
* conform/data/unistd.h-data (gethostname): Do not expect for
[XPG3].
|
|
The conform/ tests for fcntl.h are failing for XPG3 and XPG4 because
of missing S_IFSOCK.
This is a case of a bogus test. The relevant wording requiring such
constants is, in current POSIX (and this requirement dates back as far
as XPG4), "The <fcntl.h> header shall define the symbolic constants
for file modes for use as values of mode_t as described in
<sys/stat.h>.". Note that this is *file modes* not *file types*.
That makes sense, since the point is presumably for use with functions
such as open that are declared in fcntl.h, where file modes are
relevant but file types aren't. So this patch removes all those
spurious S_IF* expectations for fcntl.h (the macros are generally
still *allowed* through the permission to make everything from
sys/stat.h visible).
Tested for x86_64 and x86.
* conform/data/fcntl.h-data [!POSIX] (S_IFMT): Do not expect.
[!POSIX] (S_IFBLK): Likewise.
[!POSIX] (S_IFCHR): Likewise.
[!POSIX] (S_IFIFO): Likewise.
[!POSIX] (S_IFREG): Likewise.
[!POSIX] (S_IFDIR): Likewise.
[!POSIX] (S_IFLNK): Likewise.
[!POSIX] (S_IFSOCK): Likewise.
* conform/Makefile (test-xfail-XPG3/fcntl.h/conform): Remove
variable.
(test-xfail-XPG4/fcntl.h/conform): Likewise.
|
|
small sets of up to 16 bytes, medium of 16..96 bytes which are fully unrolled.
Large memsets of more than 96 bytes align the destination and use an unrolled
loop processing 64 bytes per iteration. Memsets of zero of more than 256 use
the dc zva instruction, and there are faster versions for the common ZVA sizes
64 or 128. STP of Q registers is used to reduce codesize without loss of
performance.
The speedup on test-memset is 1% on Cortex-A57 and 8% on Cortex-A53.
* sysdeps/aarch64/memset.S (__memset):
Rewrite of optimized memset.
|
|
This provides a band-aid and addresses the scenario where fork is
called from a signal handler while the process is in the malloc
subsystem (or has acquired the libio list lock). It does not
address the general issue of async-signal-safety of fork;
multi-threaded processes are not covered, and some glibc
subsystems have fork handlers which are not async-signal-safe.
|
|
|
|
termios.h should declare tcgetsid for XPG4, but only does so for
__USE_UNIX98 || __USE_XOPEN2K8 at present. This patch fixes the
declaration conditions. A spurious conformtest expectation of this
declaration for XPG3 is removed, and two XFAILs that are fixed by
these changes are also removed.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20055]
* termios/termios.h (pid_t): Define for [__USE_XOPEN_EXTENDED]
instead of [__USE_UNIX98].
(tcgetsid): Declare for [__USE_XOPEN_EXTENDED] instead of
[__USE_UNIX98].
* conform/data/termios.h-data (tcgetsid): Do not expect for
[XPG3].
* conform/Makefile (test-xfail-XPG3/termios.h/conform): Remove
variable.
(test-xfail-XPG4/termios.h/conform): Likewise.
|
|
__malloc_initialize_hook is deprecated.
|
|
if glibc is build with -march=z900 | -march=z990,
the startup file gcrt1.o (used if you link with gcc -pg)
contains R_390_GOT12 | R_390_GOT20 relocations.
Thus, an entry in the GOT can be addressed relative to the GOT pointer
with a 12 | 20 bit displacement value.
The startup files should not contain R_390_GOT12,
R_390_GOT20 relocations, but R_390_GOTENT ones.
This patch removes the overrides of pic-ccflag and
the default pic-ccflag = -fPIC in Makeconfig
is used instead to get the R_390_GOTENT relocations in gcrt1.o.
ChangeLog:
* sysdeps/s390/s390-32/Makefile (pic-ccflag): Remove.
* sysdeps/s390/s390-64/Makefile: Likewise.
|
|
Merge x86 ifunc-defines.sym with x86 cpu-features-offsets.sym. Remove
x86 ifunc-defines.sym and rtld-global-offsets.sym. No code changes on
i686 and x86-64.
* sysdeps/i386/i686/multiarch/Makefile (gen-as-const-headers):
Remove ifunc-defines.sym.
* sysdeps/x86_64/multiarch/Makefile (gen-as-const-headers):
Likewise.
* sysdeps/i386/i686/multiarch/ifunc-defines.sym: Removed.
* sysdeps/x86/rtld-global-offsets.sym: Likewise.
* sysdeps/x86_64/multiarch/ifunc-defines.sym: Likewise.
* sysdeps/x86/Makefile (gen-as-const-headers): Remove
rtld-global-offsets.sym.
* sysdeps/x86_64/multiarch/ifunc-defines.sym: Merged with ...
* sysdeps/x86/cpu-features-offsets.sym: This.
* sysdeps/x86/cpu-features.h: Include <cpu-features-offsets.h>
instead of <ifunc-defines.h> and <rtld-global-offsets.h>.
|
|
sys/stat.h declares fchmod if __USE_POSIX (i.e. POSIX.1:1990). But it
was actually added in 1993 and also in XPG4. This patch changes the
conditions to the correct __USE_POSIX199309 || __USE_XOPEN_EXTENDED.
Tested for x86_64 and x86 (testsuite, and that installed shared
libraries are unchanged by the patch).
[BZ #20073]
* io/sys/stat.h (fchmod): Declare for
[__USE_POSIX199309 || __USE_XOPEN_EXTENDED], not [__USE_POSIX].
* conform/Makefile (test-xfail-XPG3/sys/stat.h/conform): Remove
variable.
|
|
This patch fixes various conformtest sys/stat.h expectations that were
incorrect for XPG3 (not based on a full review, so not necessarily an
exhaustive set of such corrections). Most of these corrections fix
spurious failures shown in testing (but that for fchmod introduces a
correct failure, as that function is wrongly declared for XPG3, so
this doesn't eliminate any XFAILs).
Tested for x86_64 and x86.
* conform/data/sys/stat.h-data [XPG3] (S_IFLNK): Do not expect.
[XPG3] (S_IFSOCK): Likewise.
[XPG3] (S_ISVTX): Likewise.
[XPG3] (S_ISLNK): Likewise.
[XPG3] (S_ISSOCK): Likewise.
[XPG3] (fchmod): Likewise.
[XPG3] (lstat): Likewise.
[XPG3] (mknod): Likewise.
|
|
The conformtest expectations expect the struct stat fields st_blksize
and st_blocks to be of types blksize_t and blkcnt_t. But XPG4 does
not have those types, using long instead, and XPG3 does not have these
fields at all. This patch adjusts the expectations for those
standards, XFAILing them for XPG4 to allow for systems where the
typedefs don't correspond to long.
Tested for x86_64 and x86.
* conform/data/sys/stat.h-data (st_blksize): Do not expect for
[XPG3]. Expect type long and XFAIL for [XPG4].
(st_blocks): Likewise.
|
|
For UNIX98 (only), unistd.h should declare pthread_atfork, but that
declaration is missing. This patch adds it.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20044]
* posix/unistd.h [__USE_UNIX98 && !__USE_XOPEN2K]
(pthread_atfork): New prototype.
* conform/Makefile (test-xfail-UNIX98/unistd.h/conform): Remove
variable.
|
|
For UNIX98 and older X/Open standards, unistd.h should have a
declaration of the legacy cuserid function, but such a declaration is
missing. This patch adds that missing declaration.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20043]
* posix/unistd.h [__USE_XOPEN && !__USE_XOPEN2K] (cuserid): New
prototype.
|
|
|
|
|
|
The conformtest tests for sys/types.h for XPG3 and XPG4 fail because
of missing blksize_t. This is a bug in the expectations; that type is
not part of those standards. This patch stops the tests from
expecting it, and some other types that also are not part of XPG3 and
XPG4.
Tested for x86_64 and x86.
* conform/data/sys/types.h-data (blkcnt_t): Do not expect for
[XPG3 || XPG4].
(blksize_t): Likewise.
(clockid_t): Likewise.
* conform/Makefile (test-xfail-XPG3/sys/types.h/conform): Remove
variable.
(test-xfail-XPG4/sys/types.h/conform): Likewise.
|
|
This patch adds support for symbol __kernel_getcpu in vDSO,
which is available with kernel 4.5.
Now sched_getcpu is using this symbol if available in mapped vDSO
by defining macro HAVE_GETCPU_VSYSCALL. If not available at runtime,
the former syscall is used.
|
|
Move sysdeps/x86_64/cacheinfo.c to sysdeps/x86. No code changes on x86
and x86_64.
* sysdeps/i386/cacheinfo.c: Include <sysdeps/x86/cacheinfo.c>
instead of <sysdeps/x86_64/cacheinfo.c>.
* sysdeps/x86_64/cacheinfo.c: Moved to ...
* sysdeps/x86/cacheinfo.c: Here.
|
|
|
|
The letters ΐ/ϊ and ΰ/ϋ are swapped in the EBCDIC 875 map.
Verified against the original IBM spec.
|
|
This reverts commit fd67a9cf7b733da082e4b6a5f25c19ea7921b4cd.
|
|
|
|
* sysdeps/pthread/aio_misc.c (__aio_enqueue_request): Do not write
`running` field of `newp` when a thread was started to process it,
since that thread will not take `__aio_requests_mutex`, and the field
already has the proper value actually.
|
|
The AF_LOCAL and AF_INET/AF_INET6 non-numerci service conversion
did not return EAI_OVERFLOW if the supplied buffer was too small,
silently returning truncated data. In the AF_INET/AF_INET6
numeric cases, the snprintf return value checking was incorrect.
|
|
In the numeric AF_INET/AF_INET6 case, if inet_ntop fails
as the result of a short host buffer, we used to call strnlen
on the uninitialized host buffer.
|
|
|
|
The file sysdeps/powerpc/sysdeps.h defines aliases for condition register
operands. E.g.: 'cr7' means condition register 7. On the one hand, this
increases readability, as it makes it easier for readers to know whether the
operand is a condition register, a general purpose register or an immediate.
On the other hand, this permits that condition registers be written as if they
were general purpose, and vice-versa, thus reducing the readability of the
code.
This commit removes some of these unintentional misuses.
The changes have no effect on the final code. Checked with objdump.
|
|
Instead, we store the data we need from the return value of
readdir in an object of the new type struct readdir_result.
This type is independent of the layout of struct dirent.
|
|
For UNIX98 and older standards, sys/time.h should not define struct
timespec, but does so via the inclusion of sys/select.h (which is a
new header in the 2001 edition of POSIX, and defines struct timespec
because of the declaration of pselect, a new function in the 2001
edition of POSIX). In turn, this affects some other headers that
themselves include sys/time.h.
This patch fixes this by conditioning the __need_timespec definition
in sys/select.h on __USE_XOPEN2K, the same condition used there for
the declaration of pselect (this has no effect on direct uses of
sys/select.h with feature test macros for any standard that includes
that header, since such standards result in __USE_XOPEN2K being
defined).
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20041]
* misc/sys/select.h (__need_timespec): Only define if
[__USE_XOPEN2K].
* conform/Makefile (test-xfail-XPG4/sys/time.h/conform): Remove
variable.
(test-xfail-XPG4/utmpx.h/conform): Likewise.
(test-xfail-UNIX98/sys/time.h/conform): Likewise.
(test-xfail-UNIX98/utmpx.h/conform): Likewise.
|
|
A missing instruction was discovered in the compat version of
swapcontext while running the GCC test suite.
|
|
fcntl.h defines struct timespec if __USE_XOPEN || __USE_XOPEN2K8. But
(a) the subsequent bits/stat.h include only needs it if __USE_XOPEN2K8
and (b) older standards did not allow struct timespec here. (It's
allowed for newer standards by virtue of the permission to include
symbols from sys/stat.h. But sys/stat.h is only required to provide
struct timespec from the 2008 edition of POSIX onwards, and permitted
by the 2004 TC to the 2001 edition in anticipation of the addition of
nanosecond timestamp support to struct stat in the 2008 edition.)
This patch limits the timespec definition to the __USE_XOPEN2K8 case,
that being the only case where it is actually needed for the
<bits/stat.h> include.
Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).
[BZ #20023]
* io/fcntl.h [__USE_XOPEN && !__USE_XOPEN2K8]: Do not include
<time.h>.
* conform/Makefile (test-xfail-UNIX98/fcntl.h/conform): Remove
variable.
(test-xfail-XOPEN2K/fcntl.h/conform): Likewise.
|
|
This patch fixes the clone CLONE_VM change from 0cb313f (BZ#19957)
where the commit changed the register that contains the save flags
argument to compare with (from r28 to r29). This patch changes
back to correct register.
Tested on powerpc32 (thanks to Tulio Magno Quites Machado Filho).
* sysdeps/unix/sysv/linux/powerpc/powerpc32/clone.S (__clone): Fix
flags CLONE_VM compare.
|
|
|
|
The Hesiod implementation imported into glibc was enhanced
to support caller-supplied resolver states. But its only
consumer is nss_hesiod, and it supplies the thread-local
resolver state. Therefore, this commit changes the Hesiod
implementation to use the thread-local resolver state (_res)
directly. This fixes bug 19573 because the Hesiod
implementation no longer has to initialize and free any
resolver state.
To avoid any risk of interposition of ABI-incompatible Hesiod
function implementations, this commit marks the Hesiod functions
as hidden. (They were already hidden using a linker version
script.)
|
|
No functional change because DEF_RHS was already disabled before.
|
|
|
|
Need to also update the database to include the new code.
|
|
|