Overwrite target for x86_64_v2

Update patch-git.lua to handle AlmaLinux branches correctly
This commit is contained in:
Eduard Abdullin 2026-05-10 01:34:30 +00:00 committed by root
commit f9e7e0eaf7
26 changed files with 812 additions and 1 deletions

View File

@ -21,6 +21,8 @@ rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane-tier0.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-fast-lane-tier1.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-slow-lane-tier1.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-power9.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.gate-build-power10.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build.rebuild.validation}
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.glibc-aarch64.tier1.functional}
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.glibc-ppc64le.tier1.functional}

180
glibc-RHEL-149709.patch Normal file
View File

@ -0,0 +1,180 @@
commit d8997716a1ca22cf038eac86ed286830ba9818cc
Author: DJ Delorie <dj@redhat.com>
Date: Wed Apr 1 17:52:25 2026 -0400
nss: fix __get_default_domain logic
Fix logic bug in __nss_get_default_domain that prevents
proper initialization.
Because this function is not exposed, the test case must link
against the object directly.
Bug origin commit: 64d1e08ea822bf47cb2796ad0f727136227f983c
Co-authored-by: Florian Weimer <fweimer@redhat.com>
Reviewed-by: Frédéric Bérat <fberat@redhat.com>
diff --git a/nss/Makefile b/nss/Makefile
index 400ee3d5eefe3bd1..a9d0715d885ddb0d 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -317,6 +317,7 @@ tests := \
test-netdb \
test-rpcent \
testgrp \
+ tst-default-domain \
tst-fgetsgent_r \
tst-getaddrinfo \
tst-getaddrinfo2 \
@@ -510,6 +511,8 @@ endif
$(objpfx)tst-nss-files-alias-leak.out: $(objpfx)libnss_files.so
$(objpfx)tst-nss-files-alias-truncated.out: $(objpfx)libnss_files.so
+$(objpfx)tst-default-domain: $(objpfx)nisdomain.os
+
tst-nss-gai-hv2-canonname-ENV = \
MALLOC_TRACE=$(objpfx)tst-nss-gai-hv2-canonname.mtrace \
LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
diff --git a/nss/nss_compat/nisdomain.c b/nss/nss_compat/nisdomain.c
index 1c9d6423d3dc7e74..90b227f131ac787c 100644
--- a/nss/nss_compat/nisdomain.c
+++ b/nss/nss_compat/nisdomain.c
@@ -36,7 +36,7 @@ __nss_get_default_domain (char **outdomain)
__libc_lock_lock (domainname_lock);
- if (domainname[0] != '\0')
+ if (domainname[0] == '\0')
{
if (getdomainname (domainname, MAXDOMAINNAMELEN) < 0)
result = errno;
diff --git a/nss/tst-default-domain.c b/nss/tst-default-domain.c
new file mode 100644
index 0000000000000000..2fa9153d8802d4c3
--- /dev/null
+++ b/nss/tst-default-domain.c
@@ -0,0 +1,123 @@
+/* Basic test of __nss_get_default_domain
+ Copyright (C) 2026 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 <unistd.h>
+#include <string.h>
+#include <dlfcn.h>
+
+#include "nss_compat/nisdomain.h"
+
+#include <support/test-driver.h>
+#include <support/support.h>
+#include <support/namespace.h>
+#include <support/check.h>
+
+char unset_domain[] = "unset_domain";
+char new_domain[] = "new_domain";
+
+/* This function checks the __nss_get_default_domain() function in
+ nss_compat/nssdomain.c. Because this is an internal function to
+ libnss_compat.so, the Makefile will link that object to this test
+ case directly. */
+
+static int
+do_test (void)
+{
+ char *domain_name;
+ char buf[1024];
+
+ /* We need to be in a network namespace so we can change the domain
+ name without interfering with the host system. */
+ support_become_root ();
+ support_enter_network_namespace ();
+ if (!support_in_uts_namespace ())
+ return EXIT_UNSUPPORTED;
+
+ /* First pass: set an empty domain and make sure it's returned
+ correctly. This should not be cached. */
+
+ /* Set the domain name to a known value. */
+ TEST_VERIFY (setdomainname ("", 0) == 0);
+
+ /* Make sure it got set. */
+ TEST_VERIFY (getdomainname (buf, sizeof(buf)) == 0);
+ TEST_COMPARE_STRING (buf, "");
+
+ /* Set this to a known "unknown" value so we can detect if it's not
+ changed. */
+ domain_name = unset_domain;
+
+ /* This is the function we're testing. */
+ TEST_VERIFY (__nss_get_default_domain (& domain_name) == 0);
+
+ /* Make sure the correct domain name is returned. */
+ TEST_VERIFY (domain_name != NULL);
+ TEST_COMPARE_STRING (domain_name, "");
+
+ /* Second pass: set a non-empty domain and make sure it's returned
+ correctly. This works because the empty domain is not
+ cached. */
+
+ /* Set the domain name to a known value. */
+ TEST_VERIFY (setdomainname (new_domain, strlen (new_domain)) == 0);
+
+ /* Make sure it got set. */
+ TEST_VERIFY (getdomainname (buf, sizeof(buf)) == 0);
+ TEST_COMPARE_STRING (buf, new_domain);
+
+ /* Set this to a known "unknown" value so we can detect if it's not
+ changed. */
+ domain_name = unset_domain;
+
+ /* This is the function we're testing. */
+ TEST_VERIFY (__nss_get_default_domain (& domain_name) == 0);
+
+ /* Make sure the correct domain name is returned. */
+ TEST_VERIFY (domain_name != NULL);
+ TEST_COMPARE_STRING (domain_name, new_domain);
+
+ /* The function caches the name, so check it twice. */
+ TEST_VERIFY (__nss_get_default_domain (& domain_name) == 0);
+
+ TEST_VERIFY (domain_name != NULL);
+ TEST_COMPARE_STRING (domain_name, new_domain);
+
+ /* Third pass: set an empty domain again but expect the cached
+ value. */
+
+ /* Set the domain name to a known value. */
+ TEST_VERIFY (setdomainname ("", 0) == 0);
+
+ /* Make sure it got set. */
+ TEST_VERIFY (getdomainname (buf, sizeof(buf)) == 0);
+ TEST_COMPARE_STRING (buf, "");
+
+ /* Set this to a known "unknown" value so we can detect if it's not
+ changed. */
+ domain_name = unset_domain;
+
+ /* This is the function we're testing. */
+ TEST_VERIFY (__nss_get_default_domain (& domain_name) == 0);
+
+ TEST_VERIFY (domain_name != NULL);
+ TEST_COMPARE_STRING (domain_name, new_domain);
+
+ return 0;
+}
+
+#include <support/test-driver.c>

321
glibc-RHEL-162885.patch Normal file
View File

@ -0,0 +1,321 @@
commit d6f08d1cf027f4eb2ba289a6cc66853722d4badc
Author: Florian Weimer <fweimer@redhat.com>
Date: Thu Apr 16 19:13:43 2026 +0200
Use pending character state in IBM1390, IBM1399 character sets (CVE-2026-4046)
Follow the example in iso-2022-jp-3.c and use the __count state
variable to store the pending character. This avoids restarting
the conversion if the output buffer ends between two 4-byte UCS-4
code points, so that the assert reported in the bug can no longer
happen.
Even though the fix is applied to ibm1364.c, the change is only
effective for the two HAS_COMBINED codecs for IBM1390, IBM1399.
The test case was mostly auto-generated using
claude-4.6-opus-high-thinking, and composer-2-fast shows up in the
log as well. During review, gpt-5.4-xhigh flagged that the original
version of the test case was not exercising the new character
flush logic.
This fixes bug 33980.
Assisted-by: LLM
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
diff --git a/iconvdata/Makefile b/iconvdata/Makefile
index 7196a8744bb66e8c..090ba929b1ec646e 100644
--- a/iconvdata/Makefile
+++ b/iconvdata/Makefile
@@ -76,7 +76,7 @@ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
bug-iconv13 bug-iconv14 bug-iconv15 \
- tst-iconv-iso-2022-cn-ext
+ tst-iconv-iso-2022-cn-ext tst-bug33980
ifeq ($(have-thread-library),yes)
tests += bug-iconv3
endif
@@ -333,6 +333,8 @@ $(objpfx)bug-iconv15.out: $(addprefix $(objpfx), $(gconv-modules)) \
$(addprefix $(objpfx),$(modules.so))
$(objpfx)tst-iconv-iso-2022-cn-ext.out: $(addprefix $(objpfx), $(gconv-modules)) \
$(addprefix $(objpfx),$(modules.so))
+$(objpfx)tst-bug33980.out: $(addprefix $(objpfx), $(gconv-modules)) \
+ $(addprefix $(objpfx),$(modules.so))
$(objpfx)iconv-test.out: run-iconv-test.sh \
$(addprefix $(objpfx), $(gconv-modules)) \
diff --git a/iconvdata/ibm1364.c b/iconvdata/ibm1364.c
index d6c8ce7f682aa64d..47970008f7ef31ec 100644
--- a/iconvdata/ibm1364.c
+++ b/iconvdata/ibm1364.c
@@ -67,12 +67,29 @@
/* Since this is a stateful encoding we have to provide code which resets
the output state to the initial state. This has to be done during the
- flushing. */
+ flushing. For the to-internal direction (FROM_DIRECTION is true),
+ there may be a pending character that needs flushing. */
#define EMIT_SHIFT_TO_INIT \
if ((data->__statep->__count & ~7) != sb) \
{ \
if (FROM_DIRECTION) \
- data->__statep->__count &= 7; \
+ { \
+ uint32_t ch = data->__statep->__count >> 7; \
+ if (__glibc_unlikely (ch != 0)) \
+ { \
+ if (__glibc_unlikely (outend - outbuf < 4)) \
+ status = __GCONV_FULL_OUTPUT; \
+ else \
+ { \
+ put32 (outbuf, ch); \
+ outbuf += 4; \
+ /* Clear character and db bit. */ \
+ data->__statep->__count &= 7; \
+ } \
+ } \
+ else \
+ data->__statep->__count &= 7; \
+ } \
else \
{ \
/* We are not in the initial state. To switch back we have \
@@ -99,11 +116,13 @@
*curcsp = save_curcs
-/* Current codeset type. */
+/* Current codeset type. The bit is stored in the __count variable of
+ the conversion state. If the db bit is set, bit 7 and above store
+ a pending UCS-4 code point if non-zero. */
enum
{
- sb = 0,
- db = 64
+ sb = 0, /* Single byte mode. */
+ db = 64 /* Double byte mode. */
};
@@ -119,21 +138,29 @@ enum
} \
else \
{ \
- /* This is a combined character. Make sure we have room. */ \
- if (__glibc_unlikely (outptr + 8 > outend)) \
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- \
const struct divide *cmbp \
= &DB_TO_UCS4_COMB[ch - __TO_UCS4_COMBINED_MIN]; \
assert (cmbp->res1 != 0 && cmbp->res2 != 0); \
\
put32 (outptr, cmbp->res1); \
outptr += 4; \
- put32 (outptr, cmbp->res2); \
- outptr += 4; \
+ \
+ /* See whether we have room for the second character. */ \
+ if (outend - outptr >= 4) \
+ { \
+ put32 (outptr, cmbp->res2); \
+ outptr += 4; \
+ } \
+ else \
+ { \
+ /* Otherwise store only the first character now, and \
+ put the second one into the queue. */ \
+ curcs |= cmbp->res2 << 7; \
+ inptr += 2; \
+ /* Tell the caller why we terminate the loop. */ \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
} \
}
#else
@@ -153,7 +180,20 @@ enum
#define LOOPFCT FROM_LOOP
#define BODY \
{ \
- uint32_t ch = *inptr; \
+ uint32_t ch; \
+ \
+ ch = curcs >> 7; \
+ if (__glibc_unlikely (ch != 0)) \
+ { \
+ put32 (outptr, ch); \
+ outptr += 4; \
+ /* Remove the pending character, but preserve state bits. */ \
+ curcs &= (1 << 7) - 1; \
+ continue; \
+ } \
+ \
+ /* Otherwise read the next input byte. */ \
+ ch = *inptr; \
\
if (__builtin_expect (ch, 0) == SO) \
{ \
diff --git a/iconvdata/tst-bug33980.c b/iconvdata/tst-bug33980.c
new file mode 100644
index 0000000000000000..c9693e0efebe4eae
--- /dev/null
+++ b/iconvdata/tst-bug33980.c
@@ -0,0 +1,153 @@
+/* Test for bug 33980: combining characters in IBM1390/IBM1399.
+ Copyright (C) 2026 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 <alloc_buffer.h>
+#include <errno.h>
+#include <iconv.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include <support/check.h>
+#include <support/next_to_fault.h>
+#include <support/support.h>
+
+/* Run iconv in a loop with a small output buffer of OUTBUFSIZE bytes
+ starting at OUTBUF. OUTBUF should be right before an unmapped page
+ so that writing past the end will fault. Skip SHIFT bytes at the
+ start of the input and output, to exercise different buffer
+ alignment. TRUNCATE indicates skipped bytes at the end of
+ input (0 and 1 a valid). */
+static void
+test_one (const char *encoding, unsigned int shift, unsigned int truncate,
+ char *outbuf, size_t outbufsize)
+{
+ /* In IBM1390 and IBM1399, the DBCS code 0xECB5 expands to two
+ Unicode code points when translated. */
+ static char input[] =
+ {
+ /* 8 letters X. */
+ 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
+ /* SO, 0xECB5, SI: shift to DBCS, special character, shift back. */
+ 0x0e, 0xec, 0xb5, 0x0f
+ };
+
+ /* Expected output after UTF-8 conversion. */
+ static char expected[] =
+ {
+ 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X',
+ /* U+304B (HIRAGANA LETTER KA). */
+ 0xe3, 0x81, 0x8b,
+ /* U+309A (COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK). */
+ 0xe3, 0x82, 0x9a
+ };
+
+ iconv_t cd = iconv_open ("UTF-8", encoding);
+ TEST_VERIFY_EXIT (cd != (iconv_t) -1);
+
+ char result_storage[64];
+ struct alloc_buffer result_buf
+ = alloc_buffer_create (result_storage, sizeof (result_storage));
+
+ char *inptr = &input[shift];
+ size_t inleft = sizeof (input) - shift - truncate;
+
+ while (inleft > 0)
+ {
+ char *outptr = outbuf;
+ size_t outleft = outbufsize;
+ size_t inleft_before = inleft;
+
+ size_t ret = iconv (cd, &inptr, &inleft, &outptr, &outleft);
+ size_t produced = outptr - outbuf;
+ alloc_buffer_copy_bytes (&result_buf, outbuf, produced);
+
+ if (ret == (size_t) -1 && errno == E2BIG)
+ {
+ if (produced == 0 && inleft == inleft_before)
+ {
+ /* Output buffer too small to make progress. This is
+ expected for very small output buffer sizes. */
+ TEST_VERIFY_EXIT (outbufsize < 3);
+ break;
+ }
+ continue;
+ }
+ if (ret == (size_t) -1)
+ FAIL_EXIT1 ("%s (outbufsize %zu): iconv: %m", encoding, outbufsize);
+ break;
+ }
+
+ /* Flush any pending state (e.g. a buffered combined character).
+ With outbufsize < 3, we could not store the first character, so
+ the second character did not become pending, and there is nothing
+ to flush. */
+ {
+ char *outptr = outbuf;
+ size_t outleft = outbufsize;
+
+ size_t ret = iconv (cd, NULL, NULL, &outptr, &outleft);
+ TEST_VERIFY_EXIT (ret == 0);
+ size_t produced = outptr - outbuf;
+ alloc_buffer_copy_bytes (&result_buf, outbuf, produced);
+
+ /* Second flush does not provide more data. */
+ outptr = outbuf;
+ outleft = outbufsize;
+ ret = iconv (cd, NULL, NULL, &outptr, &outleft);
+ TEST_VERIFY_EXIT (ret == 0);
+ TEST_VERIFY (outptr == outbuf);
+ }
+
+ TEST_VERIFY_EXIT (!alloc_buffer_has_failed (&result_buf));
+ size_t result_used
+ = sizeof (result_storage) - alloc_buffer_size (&result_buf);
+
+ if (outbufsize >= 3)
+ {
+ TEST_COMPARE (inleft, 0);
+ TEST_COMPARE (result_used, sizeof (expected) - shift);
+ TEST_COMPARE_BLOB (result_storage, result_used,
+ &expected[shift], sizeof (expected) - shift);
+ }
+ else
+ /* If the buffer is too small, only the leading X could be converted. */
+ TEST_COMPARE (result_used, 8 - shift);
+
+ TEST_VERIFY_EXIT (iconv_close (cd) == 0);
+}
+
+static int
+do_test (void)
+{
+ struct support_next_to_fault ntf
+ = support_next_to_fault_allocate (8);
+
+ for (int shift = 0; shift <= 8; ++shift)
+ for (int truncate = 0; truncate < 2; ++truncate)
+ for (size_t outbufsize = 1; outbufsize <= 8; outbufsize++)
+ {
+ char *outbuf = ntf.buffer + ntf.length - outbufsize;
+ test_one ("IBM1390", shift, truncate, outbuf, outbufsize);
+ test_one ("IBM1399", shift, truncate, outbuf, outbufsize);
+ }
+
+ support_next_to_fault_free (&ntf);
+ return 0;
+}
+
+#include <support/test-driver.c>

View File

@ -2357,7 +2357,7 @@ update_gconv_modules_cache ()
%endif
%changelog
* Thu Apr 09 2026 Eduard Abdullin <eabdullin@almalinux.org> - 2.39-121.alma.1
* Sun May 10 2026 Eduard Abdullin <eabdullin@almalinux.org> - 2.39-123.alma.1
- Overwrite target for x86_64_v2
- Update patch-git.lua to handle AlmaLinux branches correctly

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,27 @@
summary: Verify perror translations for ESTALE and EAGAIN across locales.
description: ''
contact: Sergey Kolosov <skolosov@redhat.com>
component:
- glibc
adjust:
- enabled: false
when: distro < rhel-8.9
- enabled: false
when: distro == rhel-9 and distro < rhel-9.3
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,64 @@
#!/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"
TEST_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 $TEST_LANGS
do
rlPhaseStartTest estale-test-$L
rlRun -c "LANG=$L ./${TESTPROG} 2> out_$L"
rlAssertNotDiffer out_$L orig_$L
rlLogInfo "out_$L:\n$(cat out_$L)"
rlPhaseEnd
done
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

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,18 @@
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,61 @@
#!/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
rlRun -l "rpm -ql glibc-debuginfo|sort|grep ld-linux-" 1
rlRun -l "rpm -ql glibc-debuginfo|sort|grep libc.so.6-" 0
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TESTTMPDIR"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd