<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libc, branch releng/13.5</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=releng%2F13.5'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2025-07-02T05:42:46Z</updated>
<entry>
<title>libc: allow __cxa_atexit handlers to be added during __cxa_finalize</title>
<updated>2025-07-02T05:42:46Z</updated>
<author>
<name>Aurélien Croc de Suray</name>
<email>freebsd@ap2c.com</email>
</author>
<published>2025-04-05T00:47:53Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=f936833911d765c1dc9640913b73acfa1d751742'/>
<id>urn:sha1:f936833911d765c1dc9640913b73acfa1d751742</id>
<content type='text'>
science/dlib-cpp reveals an interesting scenario that works fine on
other platforms but not on FreeBSD; notably, it ends up creating a new
global object from some destructor which is called during
__cxa_finalize.  This breaks when libdlib is dlopen()ed and then
subsequently dlclose()ed, as we never end up invoking the created
object's dtor until program exit when the shlib is already unmapped.

Fix it by noting when we're in the middle of __cxa_finalize for a dso,
and then restarting the search if __cxa_atexit() was called in the
middle somewhere.

We wait until we've processed the initial set before starting over and
processing the newly added handlers as if it were a complete set of
handlers added during runtime.  The alternative is calling them as
they're added to maintain a LIFO in terms of total ordering, but in
theory a constructor could add another global object that also needs to
be destroyed, and that object needs to be destroyed after the one that
constructed it to avoid creating unexpected lifetime issues.

This manifests in the pdlib PHP extension for dlib crashing, see [0].

[0] https://github.com/goodspb/pdlib/issues/39

PR:		285870
Reviewed by:	kevans (also supplied commit message)
Approved by:	so
Security:	FreeBSD-EN-25:09.libc

(cherry picked from commit 23427c8e1fedb9fc68ad0bd27a59c7ffd2b3008c)
(cherry picked from commit 04f7496f89e28057079f3f0b1a02d7d9d874487f)
</content>
</entry>
<entry>
<title>Fix lib/libc/nss/getgr_test with large numbers of groups</title>
<updated>2025-01-20T22:41:52Z</updated>
<author>
<name>Alan Somers</name>
<email>asomers@FreeBSD.org</email>
</author>
<published>2024-12-31T20:41:01Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2'/>
<id>urn:sha1:1486bb0bfcacafe5dd1c2f3add7b92e57f7e1ff2</id>
<content type='text'>
These tests create a linked list with one entry for every group on the
running system.  On a system with about 30,000 groups, the test took 69
seconds to run, and crashed Kyua with the below error:

kyua: E: string or blob too big (sqlite op: sqlite3_bind_blob) (sqlite db: /root/.kyua/store/results.usr_tests.20241231-203317-570235.db).

Fix the test by limiting it to operating on the first 1024 groups.
Apply the same change to getpw_test and getserv_test too, which are
vulnerable to the same problem.

Sponsored by:	ConnectWise
Reviewed by:	markj
Differential Revision: https://reviews.freebsd.org/D48275

(cherry picked from commit d11904b350214943dedb64c7121d4602799d7afd)
</content>
</entry>
<entry>
<title>munmap.2: Remove EINVAL for negative len</title>
<updated>2025-01-20T14:30:43Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-01-15T21:44:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=8883e8de05598e475d2ac129dfefd734e06908ab'/>
<id>urn:sha1:8883e8de05598e475d2ac129dfefd734e06908ab</id>
<content type='text'>
len is unsigned (it is size_t), so cannot be negative.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit fab411c4fd5224e3dd44e0eb288d60b27480e2d1)
(cherry picked from commit e2cbfa1f5045019d34eb0091db7755c151ea06d5)
</content>
</entry>
<entry>
<title>munmap.2: Unaligned addresses do not return error</title>
<updated>2025-01-20T14:30:43Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2025-01-15T16:52:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=a52b922c05a46f594fa604e1af3f17f046aba955'/>
<id>urn:sha1:a52b922c05a46f594fa604e1af3f17f046aba955</id>
<content type='text'>
We previously claimed that non-page-aligned addresses would return
EINVAL, but the address is in fact rounded down to the page boundary.

Reported by:	Harald Eilertsen &lt;haraldei@anduin.net&gt;
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Fixes: dabee6fecc67 ("kern_descrip.c: add fdshare()/fdcopy()")
Differential Revision: https://reviews.freebsd.org/D48465

(cherry picked from commit 9e36aaf0c24cf158e83c69c1d2312c000c3c36f3)
(cherry picked from commit 61c50909354ace6f07d0b2113f10965f4546e0ed)
</content>
</entry>
<entry>
<title>fgets.3: document gets_s() __STDC_WANT_LIB_EXT1__</title>
<updated>2024-12-27T15:49:31Z</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-10-06T22:57:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7c4be554f72adb4bc008aa71c269801c10012d77'/>
<id>urn:sha1:7c4be554f72adb4bc008aa71c269801c10012d77</id>
<content type='text'>
This matches the man page for qsort_s().

PR:		281828
Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit d0a3fd34a05794bc5cbf48709001a78e9f85169a)
</content>
</entry>
<entry>
<title>procctl.2: Editing pass</title>
<updated>2024-12-27T15:47:25Z</updated>
<author>
<name>John Baldwin</name>
<email>jhb@FreeBSD.org</email>
</author>
<published>2024-12-04T14:11:19Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=269e5e7dcbe494beeb2c96badd04737dbfaec0a7'/>
<id>urn:sha1:269e5e7dcbe494beeb2c96badd04737dbfaec0a7</id>
<content type='text'>
- Add some missing .Pp macros after the end of literal blocks and some
  lists to ensure there is a blank line before the following text.

- Use an indent of Ds for nested lists to reduce excessive indentation and
  make the bodies of the nested list items easier to read.

- Various and sundry rewordings and clarifications.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D47782

(cherry picked from commit 8277c790179304159c2e4dcb1d99552518d5be8e)
</content>
</entry>
<entry>
<title>manuals: Misc macro typos</title>
<updated>2024-12-27T15:47:13Z</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-09-12T16:36:42Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=0d17ac9c22028eee7121b25a7039ecec7dbc47f0'/>
<id>urn:sha1:0d17ac9c22028eee7121b25a7039ecec7dbc47f0</id>
<content type='text'>
These were reported by `mandoc -T lint` as
    ERROR: skipping unknown macro
When these pages were rendered with `man`, the "unknown macro" meant
that the entire line was omitted from the output.

Obvious typos in:
lib/libsys/swapon.2
lib/libsys/procctl.2
share/man/man9/firmware.9

lib/libcasper/services/cap_net/cap_net.3: 'mode' describes a function
    argument.

lib/libsys/statfs.2: there's no .Tm command ("trademark?"), and
    .Tn ("tradename") is deprecated, so remove the macro entirely.

usr.sbin/mfiutil/mfiutil.8: man was interpreting '/dev/' as a macro
    (which it didn't recognize).

share/man/man4/qat.4: same issue as above, but with '0'.  In this case,
    given the context of the previous line, rewriting as "Value '0'"
    seemed more appropriate.

usr.sbin/mlx5tool/mlx5tool.8: typo in .Xr

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
Sponsored by:	Tarsnap Backup Inc.
Reviewed by:	concussious, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1417

(cherry picked from commit 2878d99dfcfbdd7a415a7f31cf95fbd53fc8e581)
</content>
</entry>
<entry>
<title>manuals: Fix errors in .2 pages</title>
<updated>2024-12-27T15:46:45Z</updated>
<author>
<name>Graham Percival</name>
<email>gperciva@tarsnap.com</email>
</author>
<published>2024-09-20T01:54:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3aaa2a2694cd26a1706c42465d8a3c96ffd68013'/>
<id>urn:sha1:3aaa2a2694cd26a1706c42465d8a3c96ffd68013</id>
<content type='text'>
These were reported by `mandoc -T lint ...` as errors.

fhlink.2, fhreadlink.2: remove unneeded block closing.

getfh.2, procctl.2: add necessary block closing.

ptrace.2: -width only takes one argument.

swapon.2: &lt;sys/vmparam.h&gt; and &lt;vm/swap_pager.h&gt; weren't being displayed,
    because .It is for a list item whereas .In is for included files.
    Also, we want a blank line between &lt;sys/ &gt; headers and the other
    one.

Signed-off-by:	Graham Percival &lt;gperciva@tarsnap.com&gt;
PR:		281597
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit 650056363baddb83c61c85b0539ee536f3d4b56c)
</content>
</entry>
<entry>
<title>strptime: Fix day-of-week calculation.</title>
<updated>2024-12-16T10:38:57Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2024-12-09T12:37:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=48d21d15a8f22c766f1651c0a244554f6b5d7af7'/>
<id>urn:sha1:48d21d15a8f22c766f1651c0a244554f6b5d7af7</id>
<content type='text'>
The day-of-week calculation used the raw year value without adjusting
for TM_YEAR_BASE, so it was off by one for 300 years out of every 400;
it just happened to be correct for 1901 through 2000.  It also used a
loop where a simple addition would have sufficed.

While here, simplify our version of Gauss's algorithm, and document
that we assume the Gregorian calendar.

MFC after:	1 week
PR:		282916
Reviewed by:	imp, allanjude, philip
Differential Revision:	https://reviews.freebsd.org/D47977

(cherry picked from commit 4285e024baa80f81d13cdcc016fdf0721fe57862)
</content>
</entry>
<entry>
<title>libc: enable initial-exec (IE) as default thread-local storage model on arm</title>
<updated>2024-11-22T15:41:47Z</updated>
<author>
<name>R. Christian McDonald</name>
<email>rcm@rcm.sh</email>
</author>
<published>2023-11-09T20:22:21Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=c364608261d17d2d6aa0ff64085bcf908b8fb5a0'/>
<id>urn:sha1:c364608261d17d2d6aa0ff64085bcf908b8fb5a0</id>
<content type='text'>
As suggested by jrtc27@ in https://reviews.freebsd.org/D42415, this
patch enables IE as default thread-local storage model in libc on arm.

Reviewed by:	kib
Approved by:    kp (mentor)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D42445

(cherry picked from commit 6e5b1ff71e01bd48172483cb6df921f84300ea3a)
</content>
</entry>
</feed>
