<feed xmlns='http://www.w3.org/2005/Atom'>
<title>glibc/stdlib, branch master</title>
<subtitle>Fork of glibc for development</subtitle>
<id>https://git.zx2c4.com/glibc/atom/stdlib?h=master</id>
<link rel='self' href='https://git.zx2c4.com/glibc/atom/stdlib?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/'/>
<updated>2024-07-19T14:10:17Z</updated>
<entry>
<title>Fix usage of _STACK_GROWS_DOWN and _STACK_GROWS_UP defines [BZ 31989]</title>
<updated>2024-07-19T14:10:17Z</updated>
<author>
<name>John David Anglin</name>
<email>danglin@gcc.gnu.org</email>
</author>
<published>2024-07-19T14:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=8cfa4ecff21adf226984f135aa576dd8063bbba3'/>
<id>urn:sha1:8cfa4ecff21adf226984f135aa576dd8063bbba3</id>
<content type='text'>
Signed-off-by: John David Anglin &lt;dave.anglin@bell.net&gt;
Reviewed-By: Andreas K. Hüttel &lt;dilfridge@gentoo.org&gt;
</content>
</entry>
<entry>
<title>stdlib: fix arc4random fallback to /dev/urandom (BZ 31612)</title>
<updated>2024-07-08T13:05:10Z</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2024-04-05T13:27:29Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=184b9e530e6326e668709826903b6d30dc6cac3f'/>
<id>urn:sha1:184b9e530e6326e668709826903b6d30dc6cac3f</id>
<content type='text'>
The __getrandom_nocancel used by __arc4random_buf uses
INLINE_SYSCALL_CALL (which returns -1/errno) and the loop checks for
the return value instead of errno to fallback to /dev/urandom.

The malloc code now uses __getrandom_nocancel_nostatus, which uses
INTERNAL_SYSCALL_CALL, so there is no need to use the variant that does
not set errno (BZ#29624).

Checked on x86_64-linux-gnu.

Reviewed-by: Xi Ruoyao &lt;xry111@xry111.site&gt;
</content>
</entry>
<entry>
<title>stdlib: Describe __cxa_finalize usage in function comment</title>
<updated>2024-06-03T17:04:58Z</updated>
<author>
<name>Florian Weimer</name>
<email>fweimer@redhat.com</email>
</author>
<published>2024-06-03T17:04:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=992daa0b4b5fa8a9f403c9575638cec288e12bfa'/>
<id>urn:sha1:992daa0b4b5fa8a9f403c9575638cec288e12bfa</id>
<content type='text'>
Reviewed-by: Jonathan Wakely &lt;jwakely@redhat.com&gt;
</content>
</entry>
<entry>
<title>stdlib: Fix tst-makecontext2 log when swapcontext fails</title>
<updated>2024-03-23T08:36:28Z</updated>
<author>
<name>Stafford Horne</name>
<email>shorne@gmail.com</email>
</author>
<published>2023-03-03T17:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=4a13b3ef46fc10e695630d4774af7fe4944f64ca'/>
<id>urn:sha1:4a13b3ef46fc10e695630d4774af7fe4944f64ca</id>
<content type='text'>
The log incorrectly prints, setcontext failed.  Update this to indicate
that actually swapcontext failed.

Signed-off-by: Stafford Horne &lt;shorne@gmail.com&gt;
Reviewed-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
</content>
</entry>
<entry>
<title>stdlib: Improve fortify with clang</title>
<updated>2024-02-27T13:52:58Z</updated>
<author>
<name>Adhemerval Zanella</name>
<email>adhemerval.zanella@linaro.org</email>
</author>
<published>2024-02-08T18:46:16Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=d39a893ed6de8e63ffbfbcc4b7176a2fa852f8a8'/>
<id>urn:sha1:d39a893ed6de8e63ffbfbcc4b7176a2fa852f8a8</id>
<content type='text'>
It improve fortify checks for realpath, ptsname_r, wctomb, mbstowcs,
and wcstombs.  The runtime and compile checks have similar coverage as
with GCC.

Checked on aarch64, armhf, x86_64, and i686.
Tested-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
Reviewed-by: Carlos O'Donell &lt;carlos@redhat.com&gt;
</content>
</entry>
<entry>
<title>localedata: hr_HR: change currency to EUR/€</title>
<updated>2024-02-08T07:13:37Z</updated>
<author>
<name>Dragan Stanojević (Nevidljivi)</name>
<email>neville.ravenwood@gmail.com</email>
</author>
<published>2024-02-07T15:31:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=559010e471acb3cb292615b71b248aba73e5c2fe'/>
<id>urn:sha1:559010e471acb3cb292615b71b248aba73e5c2fe</id>
<content type='text'>
Resolves: BZ # 29845
</content>
</entry>
<entry>
<title>Rename c2x / gnu2x tests to c23 / gnu23</title>
<updated>2024-02-01T17:55:57Z</updated>
<author>
<name>Joseph Myers</name>
<email>josmyers@redhat.com</email>
</author>
<published>2024-02-01T17:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=83d8d289b295406e30bc8a079286b093d552c3a5'/>
<id>urn:sha1:83d8d289b295406e30bc8a079286b093d552c3a5</id>
<content type='text'>
Complete the internal renaming from "C2X" and related names in GCC by
renaming *-c2x and *-gnu2x tests to *-c23 and *-gnu23.

Tested for x86_64, and with build-many-glibcs.py for powerpc64le.
</content>
</entry>
<entry>
<title>Refer to C23 in place of C2X in glibc</title>
<updated>2024-02-01T11:02:01Z</updated>
<author>
<name>Joseph Myers</name>
<email>josmyers@redhat.com</email>
</author>
<published>2024-02-01T11:02:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=42cc619dfbc44e263239c2de870bae11ad65810a'/>
<id>urn:sha1:42cc619dfbc44e263239c2de870bae11ad65810a</id>
<content type='text'>
WG14 decided to use the name C23 as the informal name of the next
revision of the C standard (notwithstanding the publication date in
2024).  Update references to C2X in glibc to use the C23 name.

This is intended to update everything *except* where it involves
renaming files (the changes involving renaming tests are intended to
be done separately).  In the case of the _ISOC2X_SOURCE feature test
macro - the only user-visible interface involved - support for that
macro is kept for backwards compatibility, while adding
_ISOC23_SOURCE.

Tested for x86_64.
</content>
</entry>
<entry>
<title>Use gcc __builtin_stdc_* builtins in stdbit.h if possible</title>
<updated>2024-01-31T18:17:27Z</updated>
<author>
<name>Jakub Jelinek</name>
<email>jakub@redhat.com</email>
</author>
<published>2024-01-31T18:17:27Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=da89496337b97e6a2aaf1e81d55cf998f6db1070'/>
<id>urn:sha1:da89496337b97e6a2aaf1e81d55cf998f6db1070</id>
<content type='text'>
The following patch uses the GCC 14 __builtin_stdc_* builtins in stdbit.h
for the type-generic macros, so that when compiled with GCC 14 or later,
it supports not just 8/16/32/64-bit unsigned integers, but also 128-bit
(if target supports them) and unsigned _BitInt (any supported precision).
And so that the macros don't expand arguments multiple times and can be
evaluated in constant expressions.

The new testcase is gcc's gcc/testsuite/gcc.dg/builtin-stdc-bit-1.c
adjusted to test stdbit.h and the type-generic macros in there instead
of the builtins and adjusted to use glibc test framework rather than
gcc style tests with __builtin_abort ().

Signed-off-by: Jakub Jelinek &lt;jakub@redhat.com&gt;
Reviewed-by: Joseph Myers &lt;josmyers@redhat.com&gt;
</content>
</entry>
<entry>
<title>qsort: Fix a typo causing unnecessary malloc/free (BZ 31276)</title>
<updated>2024-01-23T13:17:31Z</updated>
<author>
<name>Xi Ruoyao</name>
<email>xry111@xry111.site</email>
</author>
<published>2024-01-22T20:29:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/glibc/commit/?id=dfa3394a605c8f6f25e4f827789bc89eca1d206c'/>
<id>urn:sha1:dfa3394a605c8f6f25e4f827789bc89eca1d206c</id>
<content type='text'>
In qsort_r we allocate a buffer sized QSORT_STACK_SIZE (1024) on stack
and we intend to use it if all elements can fit into it.  But there is a
typo:

    if (total_size &lt; sizeof buf)
      buf = tmp;
    else
      /* allocate a buffer on heap and use it ... */

Here "buf" is a pointer, thus sizeof buf is just 4 or 8, instead of
1024.  There is also a minor issue that we should use "&lt;=" instead of
"&lt;".

This bug is detected debugging some strange heap corruption running the
Ruby-3.3.0 test suite (on an experimental Linux From Scratch build using
Binutils-2.41.90 and Glibc trunk, and also Fedora Rawhide [1]).  It
seems Ruby is doing some wild "optimization" by jumping into somewhere
in qsort_r instead of calling it normally, resulting in a double free of
buf if we allocate it on heap.  The issue can be reproduced
deterministically with:

    LD_PRELOAD=/usr/lib/libc_malloc_debug.so MALLOC_CHECK_=3 \
    LD_LIBRARY_PATH=. ./ruby test/runner.rb test/ruby/test_enum.rb

in Ruby-3.3.0 tree after building it.  This change would hide the issue
for Ruby, but Ruby is likely still buggy (if using this "optimization"
sorting larger arrays).

[1]:https://kojipkgs.fedoraproject.org/work/tasks/9729/111889729/build.log

Signed-off-by: Xi Ruoyao &lt;xry111@xry111.site&gt;
</content>
</entry>
</feed>
