ZTS: mmp_on_off must not leave a suspended pool behind
mmp_on_off runs with zfs_multihost_interval=100 and the default ten
fail intervals, so MMP suspends the pool when no MMP write has
succeeded for one second. In CI one MMP write took 1.25 s:
WARNING: MMP writes to pool 'testpool' have not succeeded in
over 1109 ms; suspending pool
A pool suspended by MMP can't be cleared on its own host (#19033), so
cleanup failed ("pool is imported on a different host") and left it
imported. The tests after it failed on their zpool create, and
mmp_on_zdb's cleanup destroyed it: zpool destroy -f unmounts the root
dataset, and the unmount waits in zil_commit() for the suspended pool
forever, so the CI job ran into its 300 minute timeout.
mmp_clear_suspended() should have stopped that destroy, but it asks
zpool for the pool's health, and once a cleanup has removed the
hostid, zpool reports the hostid mismatch (ONLINE), not the
[12 lines not shown]
[bazel] Enable include scanning (#248169)
This scans source files to determine what headers need to be inputs to
their compilation actions. This massively reduces network traffic when
using remote execution. In my testing a full build without remote
execution transfers ~12gb of source files, and with include scanning it
transfers ~1gb
This is only enabled for first party code. If a file isn't included
because of its include not being regexable, for example if it's
included via a define:
```
#define FOO "bar.h"
#include FOO
```
It can be added to `additional_compiler_inputs` in order to get scanned.
If there's a larger problem individual targets can set `features =
["-cc_include_scanning"]`
[WPD] Don't treat a call that passes a vtable slot as a virtual call (#245870)
findCallsAtConstantOffset recorded every call or invoke that used the
function pointer loaded from a vtable slot, including one that only
passes it as an argument. Devirtualizing such a call hit the
"devirtualizing direct call?" assertion in applySingleImplDevirt or,
without assertions, rewrote the callee or folded the result of an
unrelated direct call.
This happens when hot/cold splitting outlines the indirect call into a
function that takes the loaded slot as an argument; the WPD run for
-fdevirtualize-speculatively comes after it.
Record only calls whose callee is the slot pointer, and treat any other
call use as a non-call use.
Assisted-by: Claude Code
[flang-rt][cuda] Add reduce.cpp to the supported files (#248183)
Add `reduce.cpp` to the list of supported files for the CUDA build so we
can support `reduce` in compute region.
```
!$acc parallel loop copyin(a) copyout(r)
do i = 1, 8
r(i) = reduce(a(:, i), iadd)
end do
```
NAS-145419 / 28.0.0-BETA.1 / Update `/etc/hosts` on hostname change (#20303)
Fixing https://github.com/truenas/middleware/pull/20180 exposed this
latent bug.
While I am here, increase tests coverage.
NAS-145549 / 28.0.0-BETA.1 / Fix infinite loop in path_in_ctldir() on paths starting with // (#20354)
`path_in_ctldir()` can enter an infinite loop when a path starts with
exactly two slashes, such as `//mnt/tank/share`. This can happen when a
user accidentally enters an extra leading slash in an SMB share path or
supplies such a path through the API. Linux treats `//` like `/`,
allowing the path to pass the earlier existence checks.
The loop assumes that the root is always `/`, but `pathlib` preserves
exactly two leading slashes. Since the parent of `//` is itself,
terminate the loop when `path == path.parent` instead of comparing
against `/`.
Added a regression test, reproduced the hang against master and verified
the fix on a TrueNAS VM.
[clang][deps] Add dependency scanning support for #embed
Teach the dependency directive lexer to scan #embed like we do for #include,
and the dependency scanner to record the dependencies from #embed and
__has_embed. Modules work by virtue of the embedded files being input files to
the scanner pcms. Incidentally fix the strict context hash to include embed
directories.
Claude Opuse helped with the tests.
[mlir][mem2reg][NFCI] Only scan blocks that interact with the promoted slot (#244298)
`promoteInBlock` walks every operation of every block in the slot's
region, once per promoted slot, so promotion cost grows with slots times
operations even when each slot is used in a few blocks.
Only blocks holding a blocking use or a region to promote can read or
redefine the slot. `promoteSlot` now collects those blocks, and
`promoteInBlock` forwards the reaching definition through any other
block without visiting its operations. The interface docs now state two
properties every in-tree implementation already has and this relies on:
`storesTo` implies a blocking use, and `setupPromotion` does not move
operations across blocks.
`mlir-opt --mem2reg`, one function with 6,000 allocas over 3,000
diamonds (9,001 blocks), median of 5 runs, byte-identical output:
| Input | Before | After |
|--------------|---------|--------|
[4 lines not shown]
[clang] Rebuild implicit modules when #embed files change
Files embedded are intentionally not sloc entries, so explicitly track the
embedded files and add them to the AST's input files in ASTWriter. This
ensures implicit modules are rebuilt correctly when they change.
Claude Opus helped with the tests.
[lldb][Windows] Invalidate the ARM64 register cache when a thread runs (#248084)
Since #197385, `NativeRegisterContextWindows_arm64` caches the thread's
`CONTEXT`.
Stops and register writes drop the cache but not resumes. Therefore,
exception handlers in `NativeProcessWindows` that read registers before
calling `StopThread()` get stale values.
This patch drops the cache when a thread resumes, and when a debug
exception arrives for it.
This fixes the flakes in `TestMultipleBreakpoints`.
NAS-145549 / 28.0.0-BETA.1 / Fix infinite loop in path_in_ctldir() on paths starting with // (#20354)
### Motivation
`path_in_ctldir()` can enter an infinite loop when a path starts with
exactly two slashes, such as `//mnt/tank/share`. This can happen when a
user accidentally enters an extra leading slash in an SMB share path or
supplies such a path through the API. Linux treats `//` like `/`,
allowing the path to pass the earlier existence checks.
### Description
The loop assumes that the root is always `/`, but `pathlib` preserves
exactly two leading slashes. Since the parent of `//` is itself,
terminate the loop when `path == path.parent` instead of comparing
against `/`.
### Testing
Added a regression test, reproduced the hang against master and verified
the fix on a TrueNAS VM.
[Internalize] Internalize GlobalIFunc symbols (#247949)
InternalizePass previously iterated over functions, globals, and
aliases, leaving GlobalIFunc symbols exported even when not in the
public API list. This broke the internal sanitizer symbolizer build on
https://lab.llvm.org/buildbot/#/builders/sanitizer-x86_64-linux after
#215813 added std::__new_at_least as a gnu::ifunc in libc++.
Assisted-by: Gemini
luanti: update to 5.18.1
Packaging Updates:
- fixed bug on NetBSD systems with many wsmouse(4) inputs with
absolute mode
Upstream Updates:
- Fix client hang on invalid particles, and wrong "sheet_2d"
synchronization
- Fix crash caused by invalid "plantlike_rooted" node registrations
- Update build system dependencies to fix CVEs
devel/ddd -- update to v3.5.0
DDD-3.5.0 (Fiordland)
=====================
New Features
------------
Added data display with a pixel inspector powered by Gnuplot.
Supports OpenCV, CImg, dlib, Eigen, Armadillo, ImageLib, and user-defined
image structures.
Improve graph scaling and add mini-map for navigation.
Add high resolution icons and source code glyphs.
Add source view syntax highlighting and coloring.
Add source code tabs.
Add command line option (--dlog) to generate log file.
[234 lines not shown]
libc: memstream tests: also assert in the wmemstream test
This should have been done in the previous commit, but whoops. While
we're here- there can be garbage after the buffer, so only print the
valid portion.
Fixes: dc34894d410 ("libc: memstream tests: convert [...]")
Sponsored by: Klara, Inc.
[DAGCombiner] Don't fold fsub of identical fmul operands into FMA (#247293)
visitFSUBForFMACombine has no guard for identical operands, unlike
visitFADDForFMACombine. When the target enables aggressive FMA fusion
(e.g. AArch64 A64FX, ThunderX2/3, Apple A14), fsub(m, m) with m = fmul
x, y is folded to fma(x, y, -m), i.e. fmul + fnmsub. The fused form
computes the rounding error of the product instead of 0.0, and it is
never beneficial: the fmul must still be computed for the addend, and
the fsub is replaced by a more complex instruction with higher latency
and register pressure.
Skip the fold when both operands are the same node.
[SampleProf] Address review feedback
- Move DataAccessProf.h include from SampleProf.h to
SampleProfReader.h and SampleProfWriter.h.
- Expand DataAccessProfData::merge documentation and
add readability improvements.
- Add comments to RUN groups in
sample-data-access-profile.test.
Fix infinite loop in path_in_ctldir() on paths starting with //
path_in_ctldir() walked up from the given path until it reached '/'.
pathlib keeps a leading '//' as the root, because POSIX leaves its
meaning to the implementation, and the parent of '//' is '//', so for
such a path the loop never ended. filesystem.stat, filesystem.listdir
and SMB share validation, which stat the requested path, could hang
on a path such as //mnt/tank/share.
Stop at the root, the path that is its own parent. Paths that start
with a single '/' are walked as before.
[lld][MachO] Error out on string tables over 4 GiB
Symbol string table offsets (`n_strx`) and the table's size (`strsize`) are
32 bits wide, but `StringTableSection` tracks its size in a `size_t` and
silently truncates offsets past 4 GiB, producing a corrupt symbol table.
This PR reports an error once all strings have been added instead. The test
reaches 4 GiB cheaply by linking one object with a 1 MiB local symbol name
4096 times under `-no-deduplicate-symbol-strings`.
Assisted by Claude.
pkg: Fix two issues with -r
* Since we pass the -r option and its argument unmodified to the real
pkg, we shouldn't chdir before executing it. It is unnecessary if the
argument is absolute, and harmful if it is relative as a second chdir
will fail.
* Unlike -j, we can't assume that the target environment for -r is
executable; we might be cross-building an image, for instance.
Therefore, we should execute the pkg binary from our own environment,
not the one we just bootstrapped.
Fixes: cad99ff75342 ("pkg: Add -j and -r options")
Sponsored by: Klara, Inc.
Sponsored by: The FreeBSD Foundation
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D62268