[llvm-rc] Allow '+' in identifiers (#247298)
Unquoted resource names and filenames in Windows resource scripts can
now contain '+' characters (for example, "libc++.dll" in user-defined
resources). Microsoft rc.exe accepts '+' within unquoted resource
identifiers.
Previously, Tokenizer::canContinueIdentifier() did not handle '+',
splitting "libc++.dll" into "libc", '+', '+', ".dll" and failing with
"expected int or identifier, got +".
Allow '+' in Tokenizer::canContinueIdentifier(), matching how '-' and
'/' are already handled.
Assisted-by: Antigravity, especially for tests and review
[libc] Check upper key limit in TSSKeyMgr::is_valid_key (#247857)
`TSSKeyMgr::get_dtor`, `TSSKeyMgr::remove_key`, and `get_tss_value`
check `key >= TSS_KEY_COUNT` before indexing key storage, while
`TSSKeyMgr::is_valid_key` indexed `units[key]` directly. Check `key >=
TSS_KEY_COUNT` in `is_valid_key` as well so `set_tss_value` returns
`false` for keys at or above `TSS_KEY_COUNT`, and add `pthread_tss_test`
covering `pthread_key_*` and `tss_*` key validation.
Assisted-By: Gemini
devel/aphpunit: Upgrade from 2.3 to 2.42.0
Changelog:
Feature: Add optional legacy JUnit XML reports for CI and test-case management systems
Feature: Add --max-forks option to configure the number of parallel tests
Feature: Display test-case discovery and execution progress
Bugfix: Reap all finished child processes when SIGCHLD signals are combined
Bugfix: Report the test case and message and queue sizes when sending an IPC message fails
Bugfix: Add the missing bin/aphpunit executable for Composer installations
Bugfix: Use a separate IPC queue for each APHPUnit instance to support parallel runs
Taken from: https://gitlab.p.variablis.de/open-source/aphpunit/-/releases/2.42.0
Sponsored by: OTTRIA
(cherry picked from commit beecb1c707e52b0b92b3d7195fb82b3a24b32131)
[Clang][AMDGPU] Remove redundant isAMDGCN checks. NFC (#246818)
After the r600 target removal, AMDGPUTargetInfo is only created for
the amdgcn triple, so every `isAMDGCN()` check in it is always true.
Drop those checks and the helpers that only wrapped them.
```
if (hasFMAF())
Builder.defineMacro("__HAS_FMAF__");
-->
Builder.defineMacro("__HAS_FMAF__");
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840
devel/aphpunit: Upgrade from 2.3 to 2.42.0
Changelog:
Feature: Add optional legacy JUnit XML reports for CI and test-case management systems
Feature: Add --max-forks option to configure the number of parallel tests
Feature: Display test-case discovery and execution progress
Bugfix: Reap all finished child processes when SIGCHLD signals are combined
Bugfix: Report the test case and message and queue sizes when sending an IPC message fails
Bugfix: Add the missing bin/aphpunit executable for Composer installations
Bugfix: Use a separate IPC queue for each APHPUnit instance to support parallel runs
Taken from: https://gitlab.p.variablis.de/open-source/aphpunit/-/releases/2.42.0
Sponsored by: OTTRIA
CI: calculate and prioritize fast apt mirrors in QEMU setup
GitHub-hosted ubuntu-24.04 runners land on both Azure and AWS EC2, where
default cloud apt mirrors frequently throttle or stall until the 60
minute Setup QEMU timeout. Probe a random sample of US mirrors in
parallel, rank them fastest-first in /etc/apt/apt-mirrors.txt with short
socket timeouts and the official Ubuntu mirrors as fallbacks, and retry
on the next mirror if apt-get install exceeds 5 minutes.
Also run apt-get update only after the mirrors are ranked, and fix the
quoting of the unneeded package pattern so the preinstalled packages
are actually removed.
Assisted-by: Antigravity
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Ananda Bhattacharya <a3217055 at gmail.com>
Closes #20027
RuntimeLibcalls: Add attributes to ObjC runtime calls (#244695)
Mark the ObjC runtime functions nounwind, and mark the argument of
the functions whose intrinsics mark their argument returned.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
RuntimeLibcalls: Add attributes to operator new and delete (#244712)
Annotate operator new and delete implementation variants. The nothrow
variants are nounwind. No library registers these yet so they don't
appear in the DeclareRuntimeLibcalls tests.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
traceroute6: do not print an ECN report for an echo reply
packet_ok() takes the ECN bits from the IPv6 header quoted by an
ICMPv6 error message. The destination answers an ICMPv6 probe (-I)
with an echo reply, which repeats the ICMPv6 data of the probe but not
its IPv6 header, so for that reply the main loop used whatever an
earlier packet had left in ecn.
With -E the ECN report for the destination therefore repeated the
bits quoted by an earlier ICMPv6 error. If no ICMPv6 error had been
received before, because the destination is one hop away, the first
hops are skipped with -f or the routers on the path are silent, ecn
was still uninitialized:
$ traceroute6 -E -I -n -q 1 ::1
traceroute6 to ::1 (::1) from ::1, 64 hops max, 20 byte packets
1 ::1 0.055 ms (ecn=bleached)
Print the ECN report only when there is a quoted header. Document
[9 lines not shown]
traceroute: do not use a stale or NULL quoted header with -E
packet_ok() points the global hip at the IP header quoted by an ICMP
error message and nothing resets it afterwards. The destination
answers an ICMP probe (-I) with an echo reply, which repeats the ICMP
data of the probe but not its IP header, so for that reply the main
loop used whatever an earlier packet had left in hip.
With -E the ECN report for the destination was therefore read from
the payload of the echo reply. If no ICMP error had been received
before, because the destination is one hop away, the first hops are
skipped with -f or the routers on the path are silent, hip was still
NULL and traceroute crashed:
$ traceroute -E -I 127.0.0.1
traceroute to 127.0.0.1 (127.0.0.1), 64 hops max, 48 byte packets
Segmentation fault
With -D the stale quote was compared with the probe.
[12 lines not shown]
[Clang] Check address space overlap for C-style casts to references
In OpenCL and SYCL, `TryAddressSpaceCast` rejects a pointer cast between
two address spaces that don't overlap, but a C-style cast to a reference
is not checked (there is a FIXME for it). As a result,
`(__local int &)global_var` is accepted and we emit an `addrspacecast`.
This PR checks such reference casts in the same way. We only check the
case where the reference binds to the operand directly, i.e. the two
types are related. Other casts to a reference are not affected.
This PR was assisted by AI but I reviewed all the changes.
mbuf: declare mbuf hash types as distinct types, not flags
This refactors b06db8c9dafb to use language rather then a test case to
enforce correct use mbuf hash types. Also it makes debugger
print readable values, when you look up an mbuf.
Reviewed by: gallatin, kbowling
Differential Revision: https://reviews.freebsd.org/D60987
[Clang] Check address space overlap for C-style casts to references
In OpenCL and SYCL, `TryAddressSpaceCast` rejects a pointer cast between
two address spaces that don't overlap, but a C-style cast to a reference
is not checked (there is a FIXME for it). As a result,
`(__local int &)global_var` is accepted and we emit an `addrspacecast`.
This PR checks such reference casts in the same way. We only check the
case where the reference binds to the operand directly, i.e. the two
types are related. Other casts to a reference are not affected.
This PR was assisted by AI but I reviewed all the changes.
ZTS: clean up everything a test creates
These tests' cleanup leaves some of what the test made or changed, or
stops partway:
- zpool_attach_003_pos: don't stop the cleanup when the pool does not
exist, so that the vdev files are still removed.
- anyraid_tile_layout: remove the file vdevs.
- zed_slow_io, zed_slow_io_many_vdevs, zed_diagnose_multiple: remove
the mount point directory.
- removal_cancel: destroy the pool.
- slog_015_neg: remove the vdev directories.
- zvol_misc_fua: remove the temporary files even when the cleanup
fails partway, and remove each of them once. Restore
zvol_use_blk_mq, which the test left set to 1.
- import_log_missing: remove the backup device directory, in the
zpool_import cleanup that all these tests use.
- mmp tests: remove the vdev directory, not only its files.
- anyraid tests, zpool_add_001_pos, zpool_add_009_neg,
[21 lines not shown]
ZTS: destroy the datasets that tests create
These tests pass but leave datasets, snapshots or bookmarks in their
group's pools, where later tests in the group can trip over them:
- zfs_rename_001_pos, 002_pos, 004_neg, 005_neg: destroy the file
system and container that additional_setup creates.
- zfs_rename_012_neg, libzfs_input, pam_mount_recursively,
pam_recursive, send_encrypted_freeobjects, send_freeobjects: add a
cleanup function, which they did not have.
pam_mount_recursively's and pam_recursive's also delete the user
that the test adds.
- zfs_bookmark_cliargs: put back an empty recv dataset in place of the
received one; zfs_bookmark_recursive: destroy its bookmarks.
- zfs_create_010_neg: destroy the volume if the test created it.
- zfs_destroy_clone_livelist, zfs_mount_remount,
zfs_share_concurrent_shares, zfs_unload-key_recursive,
idmap_mount_005, user_namespace_002, xattr_004_pos,
send_partial_dataset: destroy the datasets that the cleanup missed.
[16 lines not shown]
[MachineLICM] Track peak register pressure when hoisting
The pressure check in MachineLICM only looks at the estimates saved in
BackTrace. These record pressure at block boundaries, so they can miss an
earlier peak in the current BB or an ancestor BB. If pressure falls before the
candidate, the check can allow it to move even though its def then needs to stay
live across that earlier peak. This can push pressure beyond the limit and cause
spills.
This PR adds PeakPressure alongside RegPressure and saves the previous peak with
the existing boundary estimate in BackTrace. The pressure check considers the
current BB's peak and both saved estimates. Normal hoists adjust the current and
saved peaks, and scope exit restores the previous peak. Preheader scanning skips
peak updates and seeds the starting pressure from its final estimate.
Fixes LCOMPILER-3233.
This PR was assisted by AI but I reviewed all the changes.
tcp: update the send/recv pipes in hostcache during connection lifetime
Modern browsers usually open multiple connections to a site and
connections that were created later now can benefit from host cache data
that was gathered by earlier (but still open) connection.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D60733
sockets: garbage collect soopt_mcopyout()
It came from KAME and was a complement of soopt_mcopyin(), that
copied socket options passed by setsockopt(2) to mbufs. It was
unused since f95d46333db63ce9df4e8a2ca8c5c09bc0edfe72 in 2003
also from KAME.
ZTS: detach devices and clear labels that tests leave
- mmp_on_zdb, zdb_004_pos, zdb_006_pos: clear the labels of the pool's
own vdevs. The cleanup ran labelclear on $DEV_RDSKDIR/$DISK, which
misses the labels in a whole disk's partition, so a pool these tests
left exported stayed on the disks. zdb_004_pos does that every time
it runs.
- zpool_expand_001_pos, zpool_expand_003_neg: detach the loop device
without first looking for its name in "losetup -a". Where /dev/loop
is a directory (Alpine), "losetup -a" names it /dev/loop/N, while
"losetup -f", which chose it, names it /dev/loopN, so a loop device
was left attached in each pass.
- zvol_misc_zil: wait for the zvol's device node before writing to it,
so that the test does not create a regular file at its path in
/dev/zvol.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Matthew Ahrens <matt at mahrens.org>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Closes #20082
[tsan] Intercept C11 cnd_* functions on glibc (#247719)
glibc implements the C11 condition variable functions with its internal
pthread_cond functions, so TSan doesn't see a cnd_wait release and
reacquire its mutex and reports false data races (#199585).
Intercept cnd_init, cnd_signal, cnd_broadcast, cnd_wait, cnd_timedwait
and cnd_destroy, forwarding to the real functions and doing what the
pthread_cond interceptors do. The waits reuse cond_wait. C11 condition
variables always have the current pthread_cond_t layout, so they don't
go through init_cond.
Enable c11_cnd.c for TSan on glibc.
Assisted-by: Claude