Merge remote-tracking branch 'up/main' into main-riscv64

Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
This commit is contained in:
David Abdurachmanov 2024-11-30 15:00:39 +02:00
commit 176969ead3
Signed by: davidlt
GPG Key ID: 7A5F42FAF91FACC3
89 changed files with 3209 additions and 717 deletions

211
glibc-nolink-libc.patch Normal file
View File

@ -0,0 +1,211 @@
commit 624acf596c5074ffc63ff697850cad4c8ef2e7ff
Author: Florian Weimer <fweimer@redhat.com>
Date: Tue Nov 12 20:09:33 2024 +0100
elf: Second ld.so relocation only if libc.so has been loaded
Commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf:
rtld_multiple_ref is always true”) removed some code that happened
to enable compatibility with programs that do not link against
libc.so. Such programs cannot call dlopen or any dynamic linker
functions (except __tls_get_addr), so this is not really useful.
Still ld.so should not crash with a null-pointer dereference
or undefined symbol reference in these cases.
Perform the final relocation for ld.so right before relocating
libc.so (which seems more correct anyway), but only if libc.so
has been loaded. In the main relocation loop, call
_dl_relocate_object unconditionally because it already checks
if the object has been relocated. Only call __rtld_mutex_init
and __rtld_malloc_init_real if libc.so has been loaded. Otherwise,
the full implementations are not available.
The previous concern regarding GOT updates through self-relocation
no longer applies because function pointers are updated
explicitly through __rtld_mutex_init and __rtld_malloc_init_real,
and not through relocation.
Fixes commit 8f8dd904c4a2207699bb666f30acceb5209c8d3f (“elf:
rtld_multiple_ref is always true”).
diff --git a/elf/Makefile b/elf/Makefile
index 3a1cb72955dc0eec..b044a2c2fa974905 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -3169,3 +3169,20 @@ tst-rtld-no-malloc-audit-ENV = LD_AUDIT=$(objpfx)tst-auditmod1.so
# Any shared object should do.
tst-rtld-no-malloc-preload-ENV = LD_PRELOAD=$(objpfx)tst-auditmod1.so
+
+# These rules link and run the special elf/tst-nolink-libc-* tests if
+# a port adds them to the tests variables. Neither test variant is
+# linked against libc.so, but tst-nolink-libc-1 is linked against
+# ld.so. The test is always run directly, not under the dynamic
+# linker.
+CFLAGS-tst-nolink-libc.c += $(no-stack-protector)
+$(objpfx)tst-nolink-libc-1: $(objpfx)tst-nolink-libc.o $(objpfx)ld.so
+ $(LINK.o) -nostdlib -nostartfiles -o $@ $< \
+ -Wl,--dynamic-linker=$(objpfx)ld.so,--no-as-needed $(objpfx)ld.so
+$(objpfx)tst-nolink-libc-1.out: $(objpfx)tst-nolink-libc-1 $(objpfx)ld.so
+ $< > $@ 2>&1; $(evaluate-test)
+$(objpfx)tst-nolink-libc-2: $(objpfx)tst-nolink-libc.o
+ $(LINK.o) -nostdlib -nostartfiles -o $@ $< \
+ -Wl,--dynamic-linker=$(objpfx)ld.so
+$(objpfx)tst-nolink-libc-2.out: $(objpfx)tst-nolink-libc-2 $(objpfx)ld.so
+ $< > $@ 2>&1; $(evaluate-test)
diff --git a/elf/rtld.c b/elf/rtld.c
index b8cc3f605f9e053c..f54b1829af20881a 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2243,15 +2243,7 @@ dl_main (const ElfW(Phdr) *phdr,
_rtld_main_check (main_map, _dl_argv[0]);
- /* Now we have all the objects loaded. Relocate them all except for
- the dynamic linker itself. We do this in reverse order so that copy
- relocs of earlier objects overwrite the data written by later
- objects. We do not re-relocate the dynamic linker itself in this
- loop because that could result in the GOT entries for functions we
- call being changed, and that would break us. It is safe to relocate
- the dynamic linker out of order because it has no copy relocations.
- Likewise for libc, which is relocated early to ensure that IFUNC
- resolvers in libc work. */
+ /* Now we have all the objects loaded. */
int consider_profiling = GLRO(dl_profile) != NULL;
@@ -2259,9 +2251,19 @@ dl_main (const ElfW(Phdr) *phdr,
GLRO(dl_lazy) |= consider_profiling;
if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL)
- _dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map,
- GL(dl_ns)[LM_ID_BASE].libc_map->l_scope,
- GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling);
+ {
+ /* If libc.so has been loaded, relocate it early, after the
+ dynamic loader itself. */
+ RTLD_TIMING_VAR (start);
+ rtld_timer_start (&start);
+
+ _dl_relocate_object_no_relro (&GL(dl_rtld_map), main_map->l_scope, 0, 0);
+ _dl_relocate_object (GL(dl_ns)[LM_ID_BASE].libc_map,
+ GL(dl_ns)[LM_ID_BASE].libc_map->l_scope,
+ GLRO(dl_lazy) ? RTLD_LAZY : 0, consider_profiling);
+
+ rtld_timer_accum (&relocate_time, start);
+ }
RTLD_TIMING_VAR (start);
rtld_timer_start (&start);
@@ -2284,9 +2286,8 @@ dl_main (const ElfW(Phdr) *phdr,
/* Also allocated with the fake malloc(). */
l->l_free_initfini = 0;
- if (l != &GL(dl_rtld_map))
- _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
- consider_profiling);
+ _dl_relocate_object (l, l->l_scope, GLRO(dl_lazy) ? RTLD_LAZY : 0,
+ consider_profiling);
/* Add object to slot information data if necessasy. */
if (l->l_tls_blocksize != 0 && __rtld_tls_init_tp_called)
@@ -2324,27 +2325,18 @@ dl_main (const ElfW(Phdr) *phdr,
/* Set up the object lookup structures. */
_dl_find_object_init ();
- /* Likewise for the locking implementation. */
- __rtld_mutex_init ();
-
- /* Re-relocate ourselves with user-controlled symbol definitions. */
-
- {
- RTLD_TIMING_VAR (start);
- rtld_timer_start (&start);
-
- _dl_relocate_object_no_relro (&GL(dl_rtld_map), main_map->l_scope, 0, 0);
-
- /* The malloc implementation has been relocated, so resolving
- its symbols (and potentially calling IFUNC resolvers) is safe
- at this point. */
- __rtld_malloc_init_real (main_map);
-
- if (GL(dl_rtld_map).l_relro_size != 0)
- _dl_protect_relro (&GL(dl_rtld_map));
+ /* If libc.so was loaded, ld.so has been fully relocated along with
+ it. Complete ld.so initialization with mutex symbols from
+ libc.so and malloc symbols from the global scope. */
+ if (GL(dl_ns)[LM_ID_BASE].libc_map != NULL)
+ {
+ __rtld_mutex_init ();
+ __rtld_malloc_init_real (main_map);
+ }
- rtld_timer_accum (&relocate_time, start);
- }
+ /* All ld.so initialization is complete. Apply RELRO. */
+ if (GL(dl_rtld_map).l_relro_size != 0)
+ _dl_protect_relro (&GL(dl_rtld_map));
/* Relocation is complete. Perform early libc initialization. This
is the initial libc, even if audit modules have been loaded with
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 527c7a5ae898acea..a3f7fc4054f5d54d 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -652,7 +652,12 @@ install-bin += \
# install-bin
$(objpfx)pldd: $(objpfx)xmalloc.o
+
+test-internal-extras += tst-nolink-libc
+ifeq ($(run-built-tests),yes)
+tests-special += $(objpfx)tst-nolink-libc-1.out $(objpfx)tst-nolink-libc-2.out
endif
+endif # $(subdir) == elf
ifeq ($(subdir),rt)
CFLAGS-mq_send.c += -fexceptions
diff --git a/sysdeps/unix/sysv/linux/arm/Makefile b/sysdeps/unix/sysv/linux/arm/Makefile
index a73c897f43c9a206..e73ce4f81114e789 100644
--- a/sysdeps/unix/sysv/linux/arm/Makefile
+++ b/sysdeps/unix/sysv/linux/arm/Makefile
@@ -1,5 +1,8 @@
ifeq ($(subdir),elf)
sysdep-rtld-routines += aeabi_read_tp libc-do-syscall
+# The test uses INTERNAL_SYSCALL_CALL. In thumb mode, this uses
+# an undefined reference to __libc_do_syscall.
+CFLAGS-tst-nolink-libc.c += -marm
endif
ifeq ($(subdir),misc)
diff --git a/sysdeps/unix/sysv/linux/tst-nolink-libc.c b/sysdeps/unix/sysv/linux/tst-nolink-libc.c
new file mode 100644
index 0000000000000000..817f37784b4080f9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-nolink-libc.c
@@ -0,0 +1,25 @@
+/* Test program not linked against libc.so and not using any glibc functions.
+ Copyright (C) 2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+void
+_start (void)
+{
+ INTERNAL_SYSCALL_CALL (exit_group, 0);
+}

158
glibc-rh2327564-1.patch Normal file
View File

@ -0,0 +1,158 @@
commit d115e98ad627fae62679bc18e3bf062a898860cb
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Nov 20 19:21:45 2024 +0100
Revert "AArch64: Remove memset-reg.h"
This reverts commit 8ecb477ea16a387a44ace5bf59d39a7e270b238b.
diff --git a/sysdeps/aarch64/memset-reg.h b/sysdeps/aarch64/memset-reg.h
new file mode 100644
index 0000000000000000..6c7f60b37edf3b11
--- /dev/null
+++ b/sysdeps/aarch64/memset-reg.h
@@ -0,0 +1,30 @@
+/* Register aliases for memset to be used across implementations.
+ Copyright (C) 2017-2024 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <https://www.gnu.org/licenses/>. */
+
+#define dstin x0
+#define val x1
+#define valw w1
+#define count x2
+#define dst x3
+#define dstend x4
+#define tmp1 x5
+#define tmp1w w5
+#define tmp2 x6
+#define tmp2w w6
+#define zva_len x7
+#define zva_lenw w7
diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S
index b76dde1557ed8fb1..caafb019e2b6217b 100644
--- a/sysdeps/aarch64/memset.S
+++ b/sysdeps/aarch64/memset.S
@@ -30,6 +30,7 @@
*/
#define dstin x0
+#define val x1
#define valw w1
#define count x2
#define dst x3
diff --git a/sysdeps/aarch64/multiarch/memset_a64fx.S b/sysdeps/aarch64/multiarch/memset_a64fx.S
index f665b5a891433c1c..2e6d882fc931a882 100644
--- a/sysdeps/aarch64/multiarch/memset_a64fx.S
+++ b/sysdeps/aarch64/multiarch/memset_a64fx.S
@@ -18,6 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <sysdeps/aarch64/memset-reg.h>
/* Assumptions:
*
@@ -35,14 +36,6 @@
.arch armv8.2-a+sve
-#define dstin x0
-#define valw w1
-#define count x2
-#define dst x3
-#define dstend x4
-#define tmp1 x5
-#define tmp2 x6
-
.macro st1b_unroll first=0, last=7
st1b z0.b, p0, [dst, \first, mul vl]
.if \last-\first
diff --git a/sysdeps/aarch64/multiarch/memset_emag.S b/sysdeps/aarch64/multiarch/memset_emag.S
index cf1b25f2edf64900..6d714ed0e1b396ef 100644
--- a/sysdeps/aarch64/multiarch/memset_emag.S
+++ b/sysdeps/aarch64/multiarch/memset_emag.S
@@ -18,6 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include "memset-reg.h"
/* Assumptions:
*
@@ -25,13 +26,6 @@
*
*/
-#define dstin x0
-#define val x1
-#define valw w1
-#define count x2
-#define dst x3
-#define dstend x4
-
ENTRY (__memset_emag)
PTR_ARG (0)
diff --git a/sysdeps/aarch64/multiarch/memset_kunpeng.S b/sysdeps/aarch64/multiarch/memset_kunpeng.S
index f815c20b0383f057..7b215501376cbe03 100644
--- a/sysdeps/aarch64/multiarch/memset_kunpeng.S
+++ b/sysdeps/aarch64/multiarch/memset_kunpeng.S
@@ -18,6 +18,7 @@
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include <sysdeps/aarch64/memset-reg.h>
/* Assumptions:
*
@@ -25,12 +26,6 @@
*
*/
-#define dstin x0
-#define valw w1
-#define count x2
-#define dst x3
-#define dstend x4
-
ENTRY (__memset_kunpeng)
PTR_ARG (0)
diff --git a/sysdeps/aarch64/multiarch/memset_oryon1.S b/sysdeps/aarch64/multiarch/memset_oryon1.S
index 6fa28a9bd030a705..b43a43b54e1b3439 100644
--- a/sysdeps/aarch64/multiarch/memset_oryon1.S
+++ b/sysdeps/aarch64/multiarch/memset_oryon1.S
@@ -19,18 +19,12 @@
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include "memset-reg.h"
/* Assumptions:
ARMv8-a, AArch64, unaligned accesses
*/
-#define dstin x0
-#define val x1
-#define valw w1
-#define count x2
-#define dst x3
-#define dstend x4
-
ENTRY (__memset_oryon1)
PTR_ARG (0)

276
glibc-rh2327564-2.patch Normal file
View File

@ -0,0 +1,276 @@
commit b26c53ecc4dd3bc48b11e09f6ddc7c1441e126c2
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Nov 20 19:21:48 2024 +0100
Revert "AArch64: Optimize memset"
This reverts commit cec3aef32412779e207f825db0d057ebb4628ae8.
diff --git a/sysdeps/aarch64/memset.S b/sysdeps/aarch64/memset.S
index caafb019e2b6217b..7ef77ee8c926de21 100644
--- a/sysdeps/aarch64/memset.S
+++ b/sysdeps/aarch64/memset.S
@@ -1,5 +1,4 @@
-/* Generic optimized memset using SIMD.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+/* Copyright (C) 2012-2024 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -18,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <sysdep.h>
+#include "memset-reg.h"
#ifndef MEMSET
# define MEMSET memset
@@ -25,132 +25,130 @@
/* Assumptions:
*
- * ARMv8-a, AArch64, Advanced SIMD, unaligned accesses.
+ * ARMv8-a, AArch64, unaligned accesses
*
*/
-#define dstin x0
-#define val x1
-#define valw w1
-#define count x2
-#define dst x3
-#define dstend x4
-#define zva_val x5
-#define off x3
-#define dstend2 x5
-
ENTRY (MEMSET)
+
PTR_ARG (0)
SIZE_ARG (2)
dup v0.16B, valw
- cmp count, 16
- b.lo L(set_small)
-
add dstend, dstin, count
- cmp count, 64
- b.hs L(set_128)
- /* Set 16..63 bytes. */
- mov off, 16
- and off, off, count, lsr 1
- sub dstend2, dstend, off
- str q0, [dstin]
- str q0, [dstin, off]
- str q0, [dstend2, -16]
- str q0, [dstend, -16]
- ret
+ cmp count, 96
+ b.hi L(set_long)
+ cmp count, 16
+ b.hs L(set_medium)
+ mov val, v0.D[0]
- .p2align 4
/* Set 0..15 bytes. */
-L(set_small):
- add dstend, dstin, count
- cmp count, 4
- b.lo 2f
- lsr off, count, 3
- sub dstend2, dstend, off, lsl 2
- str s0, [dstin]
- str s0, [dstin, off, lsl 2]
- str s0, [dstend2, -4]
- str s0, [dstend, -4]
+ tbz count, 3, 1f
+ str val, [dstin]
+ str val, [dstend, -8]
+ ret
+ nop
+1: tbz count, 2, 2f
+ str valw, [dstin]
+ str valw, [dstend, -4]
ret
-
- /* Set 0..3 bytes. */
2: cbz count, 3f
- lsr off, count, 1
strb valw, [dstin]
- strb valw, [dstin, off]
- strb valw, [dstend, -1]
+ tbz count, 1, 3f
+ strh valw, [dstend, -2]
3: ret
+ /* Set 17..96 bytes. */
+L(set_medium):
+ str q0, [dstin]
+ tbnz count, 6, L(set96)
+ str q0, [dstend, -16]
+ tbz count, 5, 1f
+ str q0, [dstin, 16]
+ str q0, [dstend, -32]
+1: ret
+
.p2align 4
-L(set_128):
- bic dst, dstin, 15
- cmp count, 128
- b.hi L(set_long)
- stp q0, q0, [dstin]
+ /* Set 64..96 bytes. Write 64 bytes from the start and
+ 32 bytes from the end. */
+L(set96):
+ str q0, [dstin, 16]
stp q0, q0, [dstin, 32]
- stp q0, q0, [dstend, -64]
stp q0, q0, [dstend, -32]
ret
- .p2align 4
+ .p2align 3
+ nop
L(set_long):
+ and valw, valw, 255
+ bic dst, dstin, 15
str q0, [dstin]
- str q0, [dst, 16]
- tst valw, 255
- b.ne L(no_zva)
-#ifndef ZVA64_ONLY
- mrs zva_val, dczid_el0
- and zva_val, zva_val, 31
- cmp zva_val, 4 /* ZVA size is 64 bytes. */
- b.ne L(zva_128)
-#endif
- stp q0, q0, [dst, 32]
- bic dst, dstin, 63
- sub count, dstend, dst /* Count is now 64 too large. */
- sub count, count, 64 + 64 /* Adjust count and bias for loop. */
-
- /* Write last bytes before ZVA loop. */
- stp q0, q0, [dstend, -64]
- stp q0, q0, [dstend, -32]
-
- .p2align 4
-L(zva64_loop):
- add dst, dst, 64
- dc zva, dst
+ cmp count, 256
+ ccmp valw, 0, 0, cs
+ b.eq L(try_zva)
+L(no_zva):
+ sub count, dstend, dst /* Count is 16 too large. */
+ sub dst, dst, 16 /* Dst is biased by -32. */
+ sub count, count, 64 + 16 /* Adjust count and bias for loop. */
+1: stp q0, q0, [dst, 32]
+ stp q0, q0, [dst, 64]!
+L(tail64):
subs count, count, 64
- b.hi L(zva64_loop)
+ b.hi 1b
+2: stp q0, q0, [dstend, -64]
+ stp q0, q0, [dstend, -32]
ret
+L(try_zva):
+#ifndef ZVA64_ONLY
.p2align 3
-L(no_zva):
- sub count, dstend, dst /* Count is 32 too large. */
- sub count, count, 64 + 32 /* Adjust count and bias for loop. */
-L(no_zva_loop):
+ mrs tmp1, dczid_el0
+ tbnz tmp1w, 4, L(no_zva)
+ and tmp1w, tmp1w, 15
+ cmp tmp1w, 4 /* ZVA size is 64 bytes. */
+ b.ne L(zva_128)
+ nop
+#endif
+ /* Write the first and last 64 byte aligned block using stp rather
+ than using DC ZVA. This is faster on some cores.
+ */
+ .p2align 4
+L(zva_64):
+ str q0, [dst, 16]
stp q0, q0, [dst, 32]
+ bic dst, dst, 63
stp q0, q0, [dst, 64]
+ stp q0, q0, [dst, 96]
+ sub count, dstend, dst /* Count is now 128 too large. */
+ sub count, count, 128+64+64 /* Adjust count and bias for loop. */
+ add dst, dst, 128
+1: dc zva, dst
add dst, dst, 64
subs count, count, 64
- b.hi L(no_zva_loop)
+ b.hi 1b
+ stp q0, q0, [dst, 0]
+ stp q0, q0, [dst, 32]
stp q0, q0, [dstend, -64]
stp q0, q0, [dstend, -32]
ret
#ifndef ZVA64_ONLY
- .p2align 4
+ .p2align 3
L(zva_128):
- cmp zva_val, 5 /* ZVA size is 128 bytes. */
- b.ne L(no_zva)
+ cmp tmp1w, 5 /* ZVA size is 128 bytes. */
+ b.ne L(zva_other)
+ str q0, [dst, 16]
stp q0, q0, [dst, 32]
stp q0, q0, [dst, 64]
stp q0, q0, [dst, 96]
bic dst, dst, 127
sub count, dstend, dst /* Count is now 128 too large. */
- sub count, count, 128 + 128 /* Adjust count and bias for loop. */
-1: add dst, dst, 128
- dc zva, dst
+ sub count, count, 128+128 /* Adjust count and bias for loop. */
+ add dst, dst, 128
+1: dc zva, dst
+ add dst, dst, 128
subs count, count, 128
b.hi 1b
stp q0, q0, [dstend, -128]
@@ -158,6 +156,35 @@ L(zva_128):
stp q0, q0, [dstend, -64]
stp q0, q0, [dstend, -32]
ret
+
+L(zva_other):
+ mov tmp2w, 4
+ lsl zva_lenw, tmp2w, tmp1w
+ add tmp1, zva_len, 64 /* Max alignment bytes written. */
+ cmp count, tmp1
+ blo L(no_zva)
+
+ sub tmp2, zva_len, 1
+ add tmp1, dst, zva_len
+ add dst, dst, 16
+ subs count, tmp1, dst /* Actual alignment bytes to write. */
+ bic tmp1, tmp1, tmp2 /* Aligned dc zva start address. */
+ beq 2f
+1: stp q0, q0, [dst], 64
+ stp q0, q0, [dst, -32]
+ subs count, count, 64
+ b.hi 1b
+2: mov dst, tmp1
+ sub count, dstend, tmp1 /* Remaining bytes to write. */
+ subs count, count, zva_len
+ b.lo 4f
+3: dc zva, dst
+ add dst, dst, zva_len
+ subs count, count, zva_len
+ b.hs 3b
+4: add count, count, zva_len
+ sub dst, dst, 32 /* Bias dst for tail loop. */
+ b L(tail64)
#endif
END (MEMSET)

View File

@ -1,37 +0,0 @@
Short description: Fix newlocale error return.
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
Origin: PATCH
Bug-RHEL: #832516
Bug-Fedora: #827510
Bug-Upstream: #14247
Upstream status: not-submitted
This needs to go upstream right away to fix the error case for
newlocale not correctly returning an error.
2012-06-14 Jeff Law <law@redhat.com>
* locale/loadlocale.c (_nl_load_locale): Delay setting
file->decided until we have successfully loaded the file's
data.
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index e3fa187..9fd9216 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -169,7 +169,6 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
int save_err;
int alloc = ld_mapped;
- file->decided = 1;
file->data = NULL;
fd = __open_nocancel (file->filename, O_RDONLY | O_CLOEXEC);
@@ -278,6 +277,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
newdata->alloc = alloc;
file->data = newdata;
+ file->decided = 1;
}
void

2158
glibc.spec

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
SHA512 (glibc-2.38.9000-530-gddf542da94.tar.xz) = d6e19bbc1eaa22833124d2068570f0943fa3bac130ecc433875514e281fdabfcb976f67cf33c052d06a8ce7ab91134622e2d4df143d4efb1b4627b4c342960a7
SHA512 (glibc-2.40.9000-399-ge2436d6f5a.tar.xz) = f50cb28fd54bc7dd77903e939e43aedff63e3ac7896b6c4a1e1938fea4c190512857d7a954971e9037b85a727795bb3c5692f4d85848ceaa9cd47fdb1c96aac2

View File

@ -0,0 +1,63 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7
# Description: What the test does
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2023 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE estale-test.c refs
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Sergey Kolosov <skolosov@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: What the test does" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: gcc glibc-devel glibc-langpack-es glibc-langpack-ja glibc-langpack-fr glibc-langpack-de glibc-langpack-it glibc-langpack-ko glibc-langpack-pt glibc-langpack-ru glibc-langpack-zh" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Releases: -RHEL6 -RHEL7" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,3 @@
PURPOSE of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7
Description: What the test does
Author: Sergey Kolosov <skolosov@redhat.com>

View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include <locale.h>
#include <errno.h>
int
main (void)
{
setlocale (LC_ALL, "");
errno = ESTALE;
perror ("ESTALE");
errno = EAGAIN;
perror ("EAGAIN");
return 0;
}

View File

@ -0,0 +1,25 @@
summary: What the test does
description: ''
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-8.9
test: ./runtest.sh
framework: beakerlib
recommend:
- gcc
- glibc-devel
- glibc-langpack-es
- glibc-langpack-ja
- glibc-langpack-fr
- glibc-langpack-de
- glibc-langpack-it
- glibc-langpack-ko
- glibc-langpack-pt
- glibc-langpack-ru
- glibc-langpack-zh
duration: 10m
extra-summary: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7
extra-task: /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7

View File

@ -0,0 +1,2 @@
ESTALE: Veraltete Dateizugriffsnummer (file handle)
EAGAIN: Die Ressource ist zur Zeit nicht verfügbar

View File

@ -0,0 +1,2 @@
ESTALE: Veraltete Dateizugriffsnummer (file handle)
EAGAIN: Die Ressource ist zur Zeit nicht verfügbar

View File

@ -0,0 +1,2 @@
ESTALE: Stale file handle
EAGAIN: Resource temporarily unavailable

View File

@ -0,0 +1,2 @@
ESTALE: `handle' de fichero en desuso
EAGAIN: Recurso no disponible temporalmente

View File

@ -0,0 +1,2 @@
ESTALE: Panne d'accès au fichier
EAGAIN: Ressource temporairement non disponible

View File

@ -0,0 +1,2 @@
ESTALE: Panne d'accès au fichier
EAGAIN: Ressource temporairement non disponible

View File

@ -0,0 +1,2 @@
ESTALE: Riferimento al file obsoleto
EAGAIN: Risorsa temporaneamente non disponibile

View File

@ -0,0 +1,2 @@
ESTALE: 古いファイルハンドルです
EAGAIN: リソースが一時的に利用できません

View File

@ -0,0 +1,2 @@
ESTALE: 古いファイルハンドルです
EAGAIN: リソースが一時的に利用できません

View File

@ -0,0 +1,2 @@
ESTALE: 끊어진 파일 핸들
EAGAIN: 자원이 일시적으로 사용 불가능함

View File

@ -0,0 +1,2 @@
ESTALE: Manipulador de arquivo corrompido
EAGAIN: Recurso temporariamente indisponível

View File

@ -0,0 +1,2 @@
ESTALE: Устаревший дескриптор файла
EAGAIN: Ресурс временно недоступен

View File

@ -0,0 +1,2 @@
ESTALE: 过旧的文件句柄
EAGAIN: 资源暂时不可用

View File

@ -0,0 +1,2 @@
ESTALE: 过旧的文件控柄
EAGAIN: 资源暂时不可用

View File

@ -0,0 +1,2 @@
ESTALE: 過舊的檔案控柄
EAGAIN: 資源暫時無法取得

View File

@ -0,0 +1,69 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Regression/ESTALE-error-message-translation-regression-from-RHEL7
# Description: What the test does
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2023 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="glibc"
TESTPROG="estale-test"
TESTED_LANGS="de_AT de_DE en_US es_ES fr_FR fr_FR.utf8 it_IT ja_JP ja_JP.utf8 ko_KR.utf8 pt_BR.utf8 ru_UA.utf8 zh_CN.utf8 zh_TW.utf8"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
PACKNVR=$(rpm -q ${PACKAGE}.`arch`)
rlRun "TESTTMPDIR=$(mktemp -d)"
rlRun "cp ${TESTPROG}.c $TESTTMPDIR"
rlRun "cp refs/orig_* $TESTTMPDIR"
rlRun "pushd $TESTTMPDIR"
rlPhaseEnd
rlPhaseStartTest prepare
rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG"
rlAssertExists "$TESTPROG"
rlPhaseEnd
for L in $TESTED_LANGS
do
rlPhaseStartTest estale-test-$L
rlRun -c "LANG=$L ./${TESTPROG} 2> out_$L"
if rlIsRHEL "<=9" && [ -f orig_${L}_rhel ]
then
rlAssertNotDiffer out_$L orig_${L}_rhel
else
rlAssertNotDiffer out_$L orig_$L
fi
rlLogInfo "out_$L:\n$(cat out_$L)"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc
# Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Sergey Kolosov <skolosov@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 2h" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: glibc rpm-build" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1430477" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL5 -RHEL6" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,8 @@
PURPOSE of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc
Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)
Author: Sergey Kolosov <skolosov@redhat.com>
Bug summary: glibc: Missing else branch in __libc_calloc
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1430477
The test builds glibc, then does malloc.o recompilation and does checking that
there are no missing initializations for oldtop and oldtopsize variables.

View File

@ -0,0 +1,23 @@
summary: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)
description: |
Bug summary: glibc: Missing else branch in __libc_calloc
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1430477
The test builds glibc, then does malloc.o recompilation and does checking
that there are no missing initializations for oldtop and oldtopsize
variables.
contact: Sergey Kolosov <skolosov@redhat.com>
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1430477
component:
- glibc
test: ./runtest.sh
framework: beakerlib
recommend:
- glibc
- rpm-build
duration: 2h
extra-summary:
/tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc
extra-task:
/tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc

View File

@ -0,0 +1,104 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Regression/bz1430477-glibc-Missing-else-branch-in-libc-calloc
# Description: Test for BZ#1430477 (glibc Missing else branch in __libc_calloc)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2017 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="glibc"
rlJournalStart
rlPhaseStartSetup
PRARCH="$(rlGetPrimaryArch)"
BUILDDIR="$(rpm -E '%{_builddir}')"
SPECDIR="$(rpm -E '%{_specdir}')"
rlAssertRpm $PACKAGE
rlLog "Build directory: $BUILDDIR"
rlLog "Spec directory: $SPECDIR"
rlLog "Architecture : $PRARCH"
rlLog "Cleaning build and spec directories of glibc files"
rlRun "rm -rf $BUILDDIR/glibc*" 0 "Cleaning $BUILDDIR/glibc*"
rlRun "rm -rf $SPECDIR/glibc*.spec" 0 "Cleaning $SPECDIR/glibc*.spec"
rlRun "rm -rf glibc*.src.rpm" 0 "Removing any present glibc src.rpm"
rlLog "Installing glibc srpm"
rlFetchSrcForInstalled $PACKAGE
rlRun "rpm -Uhv $PACKAGE*.src.rpm"
rlAssertExists $SPECDIR/$PACKAGE.spec
rlRun "yum-builddep -y $PACKAGE-*.src.rpm" 0 "Installing dependences"
rlPhaseEnd
rlPhaseStartTest "Building glibc"
rlRun "rpmbuild -bc ${SPECDIR}/${PACKAGE}.spec &> glibc_build_log.txt" 0 "Unpacking $PACKAGE"
ISSUCCESS=$?
if [ $ISSUCCESS -ne 0 ]
then
rlFileSubmit glibc_build_log.txt
rlFail "Glibc compilation error"
fi
if rlIsRHEL "==10"; then
BUILDS="$BUILDDIR/glibc-2.39/build*"
elif rlIsFedora ">=41"; then
BUILDS="$BUILDDIR/glibc*build/glibc*/build*"
else
BUILDS="$BUILDDIR/glibc*/build*"
fi
rlLog "Found builds at:"
for build in $BUILDS; do
rlLog "$build"
done; unset build
rlPhaseEnd
rlPhaseStartTest "Check for uninitialized values"
for CURBUILD in $BUILDS
do
rlRun -c "pushd $CURBUILD"
rlRun -c "rm malloc/malloc.o"
rlRun -c "make -r PARALLELMFLAGS="" -C .. -C malloc objdir=`pwd` subdir=malloc &> malloc_build_log.txt"
rlAssertExists malloc_build_log.txt
rlAssertNotGrep "oldtop may be used uninitialized in this function" malloc_build_log.txt
rlAssertNotGrep "oldtopsize may be used uninitialized in this function" malloc_build_log.txt
rlFileSubmit malloc_build_log.txt ${CURBUILD}_malloc_build_log
rlRun -c "popd"
done
rlPhaseEnd
rlPhaseStartCleanup
if [ -n "$KEEP_GLIBC_RESULTS" ]; then
rlLog "$(pwd) contains:"
rlLog "$(ls $(pwd))"
rlLog "Build Directory at: $(ls $BUILDDIR)"
rlLog "Spec File at: $(ls $SPECDIR/glibc*.spec)"
else
rlRun "rm glibc*.src.rpm"
rlRun "rm -rf $BUILDDIR/glibc* $SPECDIR/glibc*.spec"
fi
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -53,7 +53,7 @@ $(METADATA): Makefile
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 30m" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: glibc-devel glibc-debuginfo glibc-debuginfo-common gdb" >> $(METADATA)
@echo "Requires: glibc-devel glibc-debuginfo gdb" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)

View File

@ -11,11 +11,11 @@ component:
- glibc
test: ./runtest.sh
framework: beakerlib
recommend:
require:
- glibc-devel
- glibc-debuginfo
- glibc-debuginfo-common
- gdb
- gcc
duration: 30m
extra-summary:
/tools/glibc/Regression/bz1563046-getlogin-r-return-early-when-linux-sentinel-value

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define BUFSIZE 1024
int main(int argc, char *argv[]) {
int r=0,i,attempts=0;

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports
# Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)
# Author: Alexandra Hájková <ahajkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Alexandra Hájková <ahajkova@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 1h" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: glibc elfutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 1577212" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL5 -RHEL6 -RHEL7" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,9 @@
PURPOSE of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports
Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)
Author: Alexandra Hájková <ahajkova@redhat.com>
Bug summary: glibc: Remove stray Sun RPC exports
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1577212
Remove stray Sun RPC exports: In this context, “remove“ means that the default symbol version (the @@ part)
is gone, and there is only a compat symbol (with a single @). We cannot remove the compat symbols for
backwards compatibility reasons.

View File

@ -0,0 +1,24 @@
summary: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)
description: |
Bug summary: glibc: Remove stray Sun RPC exports
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=1577212
Remove stray Sun RPC exports: In this context, “remove“ means that the
default symbol version (the @@ part) is gone, and there is only a compat
symbol (with a single @). We cannot remove the compat symbols for backwards
compatibility reasons.
contact: Alexandra Hájková <ahajkova@redhat.com>
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=1577212
component:
- glibc
test: ./runtest.sh
framework: beakerlib
recommend:
- glibc
- elfutils
duration: 1h
extra-summary:
/tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports
extra-task:
/tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports

View File

@ -0,0 +1,54 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Regression/bz1577212-glibc-Remove-stray-Sun-RPC-exports
# Description: Test for BZ#1577212 (glibc Remove stray Sun RPC exports)
# Author: Alexandra Hájková <ahajkova@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2019 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="glibc"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest
rlRun "eu-readelf --symbols=.dynsym /usr/lib64/libc.so.6 > log"
rlAssertNotGrep "svcauthdes_stats@@" log
rlAssertNotGrep "svc_pollfd@@" log
rlAssertNotGrep "rpc_createerr@@" log
rlAssertNotGrep "svc_fdset@@" log
rlAssertNotGrep "svc_max_pollfd@@" log
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -53,7 +53,7 @@ $(METADATA): Makefile
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 20m" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: glibc glibc-debuginfo glibc-debuginfo-common glibc-common-debuginfo binutils" >> $(METADATA)
@echo "Requires: glibc glibc-debuginfo glibc-common-debuginfo binutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)

View File

@ -9,10 +9,9 @@ component:
- glibc
test: ./runtest.sh
framework: beakerlib
recommend:
require:
- glibc
- glibc-debuginfo
- glibc-debuginfo-common
- glibc-common-debuginfo
- binutils
duration: 20m

View File

@ -14,5 +14,6 @@ recommend:
- glibc
- gdb
duration: 15m
order: 1000
extra-summary: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries
extra-task: /tools/glibc/Regression/bz1661513-glibc-Adjust-to-rpms-find-debuginfo-sh-changes-to-keep-stripping-binaries

View File

@ -48,7 +48,7 @@ rlJournalStart
rlAssertGrep "ldconfig.*, stripped" output.log
rlAssertGrep "iconvconfig.*, stripped" output.log
rlAssertGrep "localedef.*, stripped" output.log
rlAssertGrep "ld-.*, not stripped" output.log
rlAssertGrep "$(readlink -f /usr/bin/ld.so).*, not stripped" output.log
rlLogInfo "Content of output.log:\n$(cat output.log)"
# some debugging info (e.g. pthread struct) should be accessible even without installed debuginfo packages

View File

@ -7,6 +7,9 @@ link:
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-9
test: ./runtest.sh
framework: beakerlib
recommend:

View File

@ -5,6 +5,9 @@ description: |
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-9
test: ./runtest.sh
framework: beakerlib
recommend:

View File

@ -7,6 +7,9 @@ link:
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-9
test: ./runtest.sh
framework: beakerlib
recommend:

View File

@ -7,6 +7,9 @@ link:
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-9
test: ./runtest.sh
framework: beakerlib
recommend:

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when
# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE tst-mktime.c
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Sergey Kolosov <skolosov@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: glibc glibc-devel gcc" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 2110357" >> $(METADATA)
@echo "Releases: -RHEL4 -RHEL6 -RHELClient5 -RHELServer5" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,5 @@
PURPOSE of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when
Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)
Author: Sergey Kolosov <skolosov@redhat.com>
Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357

View File

@ -0,0 +1,18 @@
summary: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)
description: |
Bug summary: glibc: mktime() fails with -EOVERFLOW when tm_isdst=1 and a neighboring DST boundary is far from tm_year
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2110357
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2110357
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
test: ./runtest.sh
framework: beakerlib
recommend:
- glibc
- glibc-devel
- gcc
duration: 10m
extra-summary: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when
extra-task: /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when

View File

@ -0,0 +1,54 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Regression/bz2110357-glibc-mktime-fails-with-EOVERFLOW-when
# Description: Test for BZ#2110357 (glibc mktime() fails with -EOVERFLOW when)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="glibc"
TESTPROG="tst-mktime"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
PACKNVR=$(rpm -q ${PACKAGE}.`arch`)
rlRun "TESTTMPDIR=$(mktemp -d)"
rlRun "cp ${TESTPROG}.c $TESTTMPDIR"
rlRun "pushd $TESTTMPDIR"
rlPhaseEnd
rlPhaseStartTest
rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG"
rlAssertExists "$TESTPROG"
rlRun -c "./${TESTPROG}"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -0,0 +1,24 @@
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
time_t t;
struct tm tm;
setenv("TZ", "Asia/Tokyo", 1);
memset(&tm, 0, sizeof(tm));
tm.tm_mday = 1;
tm.tm_mon = 1;
tm.tm_year = 2023;
tm.tm_isdst = 1;
t = mktime(&tm);
printf("mktime(&tm) = %d\n", t);
if (t < 0)
exit(1);
return 0;
}

View File

@ -0,0 +1,64 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in
# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Sergey Kolosov <skolosov@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)" >> $(METADATA)
@echo "Type: Regression" >> $(METADATA)
@echo "TestTime: 20m" >> $(METADATA)
@echo "RunFor: glibc" >> $(METADATA)
@echo "Requires: elfutils glibc glibc-debuginfo" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2+" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 2115831" >> $(METADATA)
@echo "Releases: RHEL8 RHEL9" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -0,0 +1,5 @@
PURPOSE of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in
Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)
Author: Sergey Kolosov <skolosov@redhat.com>
Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831

View File

@ -0,0 +1,19 @@
enabled: false
summary: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)
description: |
Bug summary: glibc: missing .gnu_debuglink section in libc.so.6, redundant annobin symbols and debufginfo for ld.so
Bugzilla link: https://bugzilla.redhat.com/show_bug.cgi?id=2115831
link:
- relates: https://bugzilla.redhat.com/show_bug.cgi?id=2115831
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
test: ./runtest.sh
framework: beakerlib
require:
- elfutils
- glibc
- glibc-debuginfo
duration: 20m
extra-summary: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in
extra-task: /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in

View File

@ -0,0 +1,68 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /tools/glibc/Regression/bz2115831-glibc-missing-gnu-debuglink-section-in
# Description: Test for BZ#2115831 (glibc missing .gnu_debuglink section in libc.so.6,)
# Author: Sergey Kolosov <skolosov@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2022 Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include Beaker environment
. /usr/share/beakerlib/beakerlib.sh || exit 1
PACKAGE="glibc"
LIBC_SO_6_LIBS=$(find /usr/lib/ /usr/lib64/ -name libc.so.6)
TESTL2="/usr/bin/ld.so"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
PACKNVR=$(rpm -q ${PACKAGE}.`arch`)
rlRun "TESTTMPDIR=$(mktemp -d)"
rlRun "pushd $TESTTMPDIR"
rlPhaseEnd
rlPhaseStartTest
rlRun -l "rpm -ql glibc-debuginfo"
for LIB in $LIBC_SO_6_LIBS; do
rlRun -l "eu-readelf -S $LIB | grep -q .debug_" 1
rlRun -l "eu-readelf -S $LIB | grep -q .gnu_debuglink" 0
done
rlRun -l "eu-readelf -S $TESTL2 | grep -q .debug_" 0
rlRun -l "eu-readelf -S $TESTL2 | grep -q .gnu_debuglink" 1
rlRun -l "eu-readelf -s $TESTL2 | grep -q annobin" 1
if rlIsRHEL "8"; then
rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/ld-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 1
rlRun -l "rpm -ql glibc-debuginfo|sort|grep '/libc-$(rpm -q --qf "%{VERSION}" ${PACKAGE}.`arch`)'" 0
elif rlIsRHEL ">=9" || rlIsFedora; then
rlRun -l "rpm -ql glibc-debuginfo|sort|grep ld-linux-" 1
rlRun -l "rpm -ql glibc-debuginfo|sort|grep libc.so.6-" 0
else
rlFail "Test does not support current distro (yet?)!"
fi
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View File

@ -13,8 +13,9 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 2
framework: beakerlib
recommend:
require:
- glibc
- gcc
tag:

View File

@ -40,7 +40,7 @@ rlJournalStart
rlPhaseEnd
rlPhaseStartTest
rlRun -c "gcc ${TESTPROG}.c -o $TESTPROG"
rlRun -c "gcc -pthread ${TESTPROG}.c -o $TESTPROG"
rlAssertExists "$TESTPROG"
rlRun -c "./${TESTPROG}"
rlPhaseEnd

View File

@ -77,6 +77,7 @@ test: ./runtest.sh
framework: beakerlib
recommend:
- glibc
- gcc
tag:
- simple
- tier1_mfranc

View File

@ -1,5 +1,6 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int
main (void)

View File

@ -34,7 +34,7 @@ PACKAGE="glibc"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun 'gcc optinit.c -o optinit' 0 "Compiling the testcase"
rlRun 'gcc -D_GNU_SOURCE optinit.c -o optinit' 0 "Compiling the testcase"
rlPhaseEnd
rlPhaseStartTest

View File

@ -149,6 +149,7 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 2
framework: beakerlib
require:
- gcc

View File

@ -5,6 +5,7 @@
#include <time.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
void func(sem_t *semp)
{

View File

@ -92,6 +92,7 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 2
framework: beakerlib
require:
- make

View File

@ -50,8 +50,9 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
- libgomp

View File

@ -127,6 +127,7 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
require:
- gcc

View File

@ -10,8 +10,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
tag:

View File

@ -45,8 +45,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
tag:
- simple

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
- glibc-devel

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- binutils
tag:

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
tag:

View File

@ -6,11 +6,11 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- glibc-devel
- glibc-headers
- gcc
- coreutils
tag:

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
tag:

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- gcc
tag:

View File

@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <wchar.h>
int main(int argc, char** argv)
{

View File

@ -6,6 +6,7 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
- glibc

View File

@ -1,5 +1,8 @@
summary: Tests if 'getaddrinfo' returns FQDN in ai_canonname.
description: ''
adjust:
- enabled: false
when: distro > rhel-9
contact: Arjun Shankar <ashankar@redhat.com>
component:
- glibc

View File

@ -1,6 +1,7 @@
#include <unistd.h>
#include <stdio.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
unsigned int *chunk;
@ -17,8 +18,8 @@ int main(void) {
*/
chunk[0] = -0x10; /* prev_size */
chunk[1] = 0x8; /* size */
chunk[2] = shellcode; /* fd */
chunk[3] = shellcode; /* bk */
chunk[2] = (int) shellcode; /* fd */
chunk[3] = (int) shellcode; /* bk */
/* set fd to the adres of the return address - 3
the minus 3 is needed because fd[3] will become bk

View File

@ -1,4 +1,7 @@
main()
#include <stdlib.h>
#include <stdio.h>
int main()
{
int *a,*b,*c,*d,*e;
b=malloc(8);

View File

@ -5,8 +5,9 @@ contact: Petr Muller <pmuller@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 2
framework: beakerlib
recommend:
require:
- glibc
- glibc-devel
- gcc

View File

@ -5,8 +5,9 @@ contact: David Malcolm <dmalcolm@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 2
framework: beakerlib
recommend:
require:
- glibc
- gcc-c++
tag:

View File

@ -15,7 +15,7 @@ int main(){
two[3] = '\0';
fprintf(fp, "Two: %s, length %d\n", two, strlen(two));
close(fp);
fclose(fp);
free(two);
return 0;
}

View File

@ -8,6 +8,6 @@ int main(){
fprintf(fp, "SIN: %0.2f\n", 1.0);
close(fp);
fclose(fp);
return 0;
}

View File

@ -41,6 +41,6 @@ int main(){
pthread_join(tw, NULL);
pthread_join(on, NULL);
close(fp);
fclose(fp);
return 0;
}

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <sys/mman.h>
#include <fcntl.h>
int main(){
@ -16,6 +17,6 @@ int main(){
else
fprintf(fp, "shm_unlink successful\n");
close(fp);
fclose(fp);
return 0;
}

View File

@ -7,6 +7,9 @@ link:
contact: Martin Coufal <mcoufal@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-8.6
test: ./runtest.sh
framework: beakerlib
recommend:

View File

@ -1,3 +1,5 @@
#include <unistd.h>
#define MESG "you are not suppposed to see this\n"
int main()

View File

@ -6,8 +6,9 @@ contact: Miroslav Franc <mfranc@redhat.com>
component:
- glibc
test: ./runtest.sh
tier: 1
framework: beakerlib
recommend:
require:
- glibc
- glibc-static
- glibc-common

View File

@ -18,7 +18,13 @@ set -ex
workdir="$(mktemp -d -t find_debuginfo.XXXXXX)"
ldso_tmp="$workdir/ld.so"
libc_tmp="$workdir/libc.so"
libc_tmp_dir="$workdir/"
# Return the path where a libc should be saved temporarily. This path is
# based on its original path received in $1.
libc_tmp_path() {
echo "$libc_tmp_dir"`dirname "$1"`"/libc.so"
}
# Prefer a separately installed debugedit over the RPM-integrated one.
if command -v debugedit >/dev/null ; then
@ -34,54 +40,65 @@ trap cleanup 0
sysroot_path="$1"
shift
# Resolve symbolic link, so that the activities below only alter the
# file it points to.
ldso_path="$(readlink -f "$sysroot_path/$1")"
shift
script_path="$1"
shift
# See ldso_path setting in glibc.spec.
ldso_path=
for ldso_candidate in `find "$sysroot_path" -maxdepth 2 \
-regextype posix-extended -regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f` ; do
if test -z "$ldso_path" ; then
ldso_path="$ldso_candidate"
else
echo "error: multiple ld.so candidates: $ldso_path, $ldso_candidate"
exit 1
fi
done
# libc.so.6 always uses this name, so it is simpler to locate.
libc_path=
for libc_candidate in `find "$sysroot_path" -maxdepth 2 -name libc.so.6`; do
if test -z "$libc_path" ; then
libc_path="$libc_candidate"
else
echo "error: multiple libc.so.6 candidates: $libc_path, $libc_candidate"
exit 1
fi
done
# This can result in multiple paths, hence the loop below.
libc_path=`find "$sysroot_path" -name libc.so.6`
# Preserve the original files.
cp "$ldso_path" "$ldso_tmp"
cp "$libc_path" "$libc_tmp"
for lib in $libc_path ; do
libtmp=`libc_tmp_path $lib`
mkdir -p `dirname "$libtmp"`
cp "$lib" "$libtmp"
done
# Run the debuginfo extraction.
"$script_path" "$@"
# libc.so.6: Extract the .gnu_debuglink section
objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \
-O binary "$libc_path" "$libc_tmp.debuglink"
for lib in $libc_path ; do
libtmp=`libc_tmp_path "$lib"`
# libc.so.6: Extract the .gnu_debuglink section
objcopy -j.gnu_debuglink --set-section-flags .gnu_debuglink=alloc \
-O binary "$lib" "$libtmp.debuglink"
# Restore the original files.
cp "$libtmp" "$lib"
# Restore the original files.
# Reduce the size of libc notes. Primarily for annobin.
objcopy --merge-notes "$lib"
# libc.so.6: Restore the .gnu_debuglink section
objcopy --add-section .gnu_debuglink="$libtmp.debuglink" "$lib"
# libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
# annobin symbols, and symbols used by the glibc build to implement
# hidden aliases (__EI_*). We would also like to remove __GI_*
# symbols, but even listing them explicitly (as in -K __GI_strlen)
# still causes strip to remove them, so there is no filtering of
# __GI_* here. (Debuginfo is gone after this, so no need to optimize
# it.)
strip -w \
-K '*' \
-K '!*.c' \
-K '!*.os' \
-K '!.annobin_*' \
-K '!__EI_*' \
-K '!__PRETTY_FUNCTION__*' \
"$lib"
done
# Restore the original ld.so.
cp "$ldso_tmp" "$ldso_path"
cp "$libc_tmp" "$libc_path"
# Reduce the size of notes. Primarily for annobin.
objcopy --merge-notes "$ldso_path"
objcopy --merge-notes "$libc_path"
# libc.so.6: Restore the .gnu_debuglink section
objcopy --add-section .gnu_debuglink="$libc_tmp.debuglink" "$libc_path"
# ld.so does not have separated debuginfo and so the debuginfo file
# generated by find-debuginfo is redundant. Therefore, remove it.
@ -98,22 +115,6 @@ for ldso_debug_candidate in `find "$sysroot_path" -maxdepth 2 \
done
rm -f "$ldso_debug"
# libc.so.6: Reduce to valuable symbols. Eliminate file symbols,
# annobin symbols, and symbols used by the glibc build to implement
# hidden aliases (__EI_*). We would also like to remove __GI_*
# symbols, but even listing them explicitly (as in -K __GI_strlen)
# still causes strip to remove them, so there is no filtering of
# __GI_* here. (Debuginfo is gone after this, so no need to optimize
# it.)
strip -w \
-K '*' \
-K '!*.c' \
-K '!*.os' \
-K '!.annobin_*' \
-K '!__EI_*' \
-K '!__PRETTY_FUNCTION__*' \
"$libc_path"
# ld.so: Rewrite the source file paths to match the extracted
# locations. First compute the arguments for invoking debugedit.
# See find-debuginfo.sh.
@ -137,7 +138,7 @@ done
debug_base_name=${last_arg:-$RPM_BUILD_ROOT}
$debugedit -b "$debug_base_name" -d "$debug_dest_name" -n $ldso_path
# Remove the .annobin* symbols (and only them).
if nm --format=just-symbols "$ldso_path" \
if nm --format=posix "$ldso_path" | cut -d' ' -f1 \
| grep '^\.annobin' > "$ldso_tmp.annobin-symbols"; then
objcopy --strip-symbols="$ldso_tmp.annobin-symbols" "$ldso_path"
fi