[lldb] Distinguish DWARF binary type-check error messages (#209644)
CheckScalarOperandsHaveSameType reported every operand-check failure
with the same "requires operands to have the same type" message, even
though it rejects operands for three different reasons: mismatched type
kind, mismatched size, and mismatched signedness. That made a failed
check hard to diagnose from the error alone.
Parameterize the message so each check names what actually differs
(type, size, or signedness).
Follow-up to Augusto's review of #209641.
[analyzer] Disable lock order reversal check by default in PthreadLoc… (#202452)
…kChecker
Lock order reversal is a real source of deadlocks, but the current
single-path intraprocedural analysis is a single-path analysis, and it
cannot reason about potentially overlapping executions.This makes this
part of the checker too imprecise for default-on.
Add a WarnOnLockOrderReversal option (default: false) for the previous
behavior.
Inject mknod for privileged Allow-All containers
## Problem
A privileged container with `capabilities_policy` "ALLOW" keeps every capability in the bounding set, but libvirt only widens the LXC cgroup device ACL when an explicit `<mknod state='on'/>` child is emitted. As a result "Allow All" can't create device nodes, so Docker fails to extract images whose layers contain overlay whiteouts (character 0:0 nodes made via mknod) even though CAP_MKNOD is present.
## Solution
For privileged containers (idmap None) under an ALLOW policy, inject the mknod capability unless the user set it explicitly, so libvirt emits `<mknod state='on'/>` and widens the device ACL — making "Allow All" actually allow device-node creation. Adds an api2 integration test that pulls and runs a complex image inside such a container.
Harmonize the cross repo advice.
The other committer's guide was written years before the cross repo
commit bit stuff. Harmonize and expand a little the advice given to make
it also match the tone of the new policy and our usual practices being a
little more relaxed than what was documented previously.
Sponsored by: Netflix
Feedback by: jhb
Differential Revision: https://reviews.freebsd.org/D58007
[lldb/script] Improve `scripting extension list` output and filtering (#209400)
This patch improves `scripting extension list` in three ways.
First, it groups the output by `ScriptedExtension`: instead of one row
per registered plugin instance, one entry per extension is printed with
a combined `Language` field.
Second, it colorizes and visually separates the output. Each entry is
preceded by a dimmed dashed separator; field labels are printed in bold
green, the extension name value in bold cyan as a mini-heading, and
`None` usage values are dimmed, all via the same
`ansi::FormatAnsiTerminalCodes(..., use_color)` idiom
`Breakpoint::GetDescription` uses elsewhere, gracefully no-op when color
is disabled or unsupported. `ScriptedInterfaceUsages::Dump` takes an
optional `use_color` parameter so its own `API Usages:` / `Command
Interpreter Usages:` labels can match.
Third, it adds `-j`/`--json` to emit a JSON array of `{name,
[14 lines not shown]
Thread Safety Analysis: Handle statement expressions in try-lock conditions (#209330)
Previously, statement expressions (`({ bool b = mu.TryLock(); b; })`)
used as try-lock conditions were not supported. Handle StmtExpr in
getTrylockCallExpr() by recursively analyzing the last statement of the
statement expression.
[lldb][bazel] Add ScriptedFrameProvider plugin to the Bazel overlay (#209634)
Adds the PluginScriptedFrameProvider cc_library for the new
SyntheticFrameProvider/ScriptedFrameProvider category and registers it
in DEFAULT_PLUGINS. Deps mirror the plugin's CMakeLists.txt (lldbCore,
lldbInterpreter, lldbTarget, lldbUtility, Support) plus the
:PluginScriptedProcess plugin dep it uses.
The ScriptedFrameProvider plugin was added upstream in PR #161870
("[lldb] Introduce ScriptedFrameProvider for real threads"), relanded as
PR #170236; this wires it into the Bazel overlay build.
bazel rule creation assisted with: claude
Can confirm this rule translates into a valid buck2 rule for Meta to
build internally, but no bazel build locally; will await CI testing.
[NVPTX] Promote internal function alignments in IR pass (#208040)
During lowering NVPTX will update the alignment of parameters and return
values if the function is internal and has only compatible direct calls.
Previously this happened within the alignment helper functions during
ISel and assembly printing making it opaque and unreliable. This change
moves that logic to an IR pass so that it can be inspected and disabled
more easily.
[lldb] Allow generic operands in DWARF binary type check (#209641)
fc298ccbc52a's CheckScalarOperandsHaveSameType also rejects legitimate
generic-typed operands, breaking breakpad STACK WIN / raSearch unwinding
on 32-bit targets. For `DW_OP_breg7 +0, DW_OP_consts +80, DW_OP_plus`,
DW_OP_breg yields a register-sized (8-byte) scalar while DW_OP_const*
yields an address-sized (4-byte) generic one. The strict size gate ran
before the genericness escape, and the escape only checked the left
operand, so the CFA expression was rejected and the unwind failed.
Reorder so two integers that are each at least as wide as the generic
type are accepted before the size/signedness gate. The commit's own
type-check unit tests still pass.
Also fix a latent crash the failure exposed: ReadFrameAddress and
GetReturnAddressHint only consumed the error inside an UNWIND_LOG
argument, which is skipped when the log is off, so the errored Expected
was destroyed unchecked and aborted. Consume it via LLDB_LOG_ERROR /
LLDB_LOG_ERRORV instead.
[mlir][sparse] Handle dense iterators in sparse iteration lowering (#208963)
Fixes #205980.
`lower-sparse-iteration-to-scf` always called `linkNewScope()` when
lowering
iterators handled by `scf.for`. Dense levels are random-access
iterators, and
`linkNewScope()` asserts for random-access iterators because those
should be
traversed by coordinate.
Use `locate()` for random-access iterators and keep `linkNewScope()` for
non-random-access iterators.
Verification:
- `cmake --build /tmp/mlir-208198 --target mlir-opt`
- `/tmp/mlir-208198/bin/mlir-opt -lower-sparse-iteration-to-scf
/tmp/issue-
[4 lines not shown]
NAS-141786 / 26.0.0-RC.1 / Merge catalog update onto current config before persisting (by Qubad786) (#19318)
## Problem
`catalog.update` wrote the raw partial request straight to the datastore
and validated it directly. Because `CatalogUpdate` is a for-update
model, a call that omits `preferred_trains` left the field as the
`undefined` sentinel — so on ENTERPRISE systems
`OFFICIAL_ENTERPRISE_TRAIN not in data.preferred_trains` raised a
TypeError, and any partial write could drop the existing trains.
## Solution
Read the current config, merge the incoming update onto it, then
validate and persist the merged result so partial updates keep untouched
fields. Only `preferred_trains` is written back, since it's the sole
stored column.
Original PR: https://github.com/truenas/middleware/pull/19314
Co-authored-by: M. Rehan <mrehanlm93 at gmail.com>
[flang][OpenMP] Check the context of the declare_simd directive (#209318)
OpenMP 6.0, 9.8 "declare_simd Directive", restricts the placement of the
directive:
Any declare_simd directive must appear in the specification part of a
subroutine subprogram, function subprogram, or interface body to which
it applies.
Flang did not enforce this, and accepted the directive in the
specification part of a module, submodule, main program or block data.
Note: the restriction requiring the argument to name the procedure to
which the directive applies is not implemented here.
Fixes #205478
NAS-141780 / 26.0.0-BETA.3 / Use get_clones() for clone destruction during rollback (by anodos325) (#19316)
Use the built-in method for snapshot objects `get_clones()` rather than
trying to read and parse the libzfs dataset clones property.
Original PR: https://github.com/truenas/middleware/pull/19315
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>
NAS-141780 / 26.0.0-RC.1 / Use get_clones() for clone destruction during rollback (by anodos325) (#19317)
Use the built-in method for snapshot objects `get_clones()` rather than
trying to read and parse the libzfs dataset clones property.
Original PR: https://github.com/truenas/middleware/pull/19315
Co-authored-by: Andrew Walker <andrew.walker at truenas.com>