Remove frame from JSON-RPC error tracebacks
The client-facing error trace included every stack frame's locals
(via get_frame_details, which reprs each local). This can result
in API calls echoing back parameters from the call to the same
API client in the error response. Generally, this information
is not consumed by the truenas API client, jobs framework, or
other internal call sites.
[analyzer] Improve dangling value tracking in DanglingPtrDeref (#211818)
Improve dangling value tracking in the `DanglingPtrDeref` checker by
adding `trackExpressionValue`. The report with this change now tracks
the dangling value and shows where the value originated from. Currently
the checker only points at the destruction and use sites which isn't
always useful for the user.
ZTS: make file_check actually compare the resume test results
file_check guards every comparison with a check that the snapshot
directory exists on both sides, and the resume tests receive with -u,
so the receive side is never mounted and the .zfs snapshot paths never
exist. The function has been quietly comparing nothing in
rsend_019-022, rsend_024, rsend_030 and send-c_resume, so the resume
test family verified that receives succeed but not that the received
data matches.
Mount both sides before diffing (some tests also unmount the send
side), still compare only the snapshots both sides carry since several
tests send just one of them, and fail loudly when nothing at all was
compared so the check cannot rot back into a no-op. Two callers
needed their expectations fixed once the checks came alive: rsend_024
streams from the head rather than a snapshot, so it now diffs the
mounted heads directly, and the first file_check in
send_partial_dataset pointed at a partial dataset with no snapshots,
so it now compares against the dataset the stream came from.
[7 lines not shown]
ZTS: save ZAP_MICRO_MAX_SIZE before the large microzap tests change it
send_large_microzap_incremental and send_large_microzap_transitive set
zap_micro_max_size to 1M and call restore_tunable in cleanup, but
restore_tunable is a silent no-op unless save_tunable stored the old
value first, which neither test ever did. The tunable therefore stays
at 1M until the module is reloaded, and any later run of the rsend
group on the same module fails seven tests (rsend_019-022, rsend_024,
rsend_030 and send-c_resume): their setup creates directories large
enough to become large microzaps, and plain zfs send then refuses the
stream without -L. CI never reruns a group on a loaded module, so
this only bites people iterating locally.
Tests: rsend group run twice back to back on one module load; before
the change the second run fails the seven tests above, after it both
runs pass.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: MorganaFuture <103630661+MorganaFuture at users.noreply.github.com>
Closes #18834
getfhat: Add missing 'const' to path argument
This matches the documented prototype and avoids spurious
-Wincompatible-pointer-types-discards-qualifiers warnings when passing
a constant pathname.
Sponsored by: AFRL, DARPA
[Clang] [Sema] Use getCurFunctionDecl() to get the current function (#211938)
In `BuildReturnStmt()`, use `getCurFunctionDecl()` to get the current
function rather than attempting to cast `CurContext` to a
`FunctionDecl`, which breaks inside an expansion statement because the
current `DeclContext` will be that of the expansion statement, not the
function. `getCurFunctionDecl()` knows how to handle this case and we
already call it earlier in that function, so just reuse the result of
that call.
Fixes #211917.
(cherry picked from commit a891a5c40c7d2ed62d97fc6563cf256e7bab3ffb)
[IR] Slightly optimize getElementAsInteger() (#211550)
This regressed with the introduction of the byte type, because
getElementPointer() calls getElementByteSize() calls
getPrimitiveSizeInBits(), but the switch used getScalarTypeInBits(),
which means we need to do two separate calls for the element size. Use
getElementByteSize() in both places so these can be CSEd.
(cherry picked from commit bb22aa8127450930eb27215eb9f2c70acdee69fc)
Thread Safety Analysis: Don't warn at joins that re-branch on a try-lock result (#209796)
Previously, when the result of a try-lock call is branched on more than
once, the paths between the branches would disagree on whether the
capability is held while remaining consistent at each branch. The analysis
then gave a false positive warning at the intermediate join:
mutex 'lock' is not held on every path through here
Create getTerminatorTrylockCall() helper from getEdgeLockset(); if the terminator
of a block branches on the result of a call to a try_acquire_capability-function
(perhaps negated or stored in a local variable), this helper returns that call and
its callee.
Use this new helper in getTerminatorTrylockCaps(), which will return the
capabilities acquired by a trylock; feed these capabilites to intersectAndWarn()
during a branch join, in order to avoid false positives.
Soundness is preserved because intersectAndWarn() still removes the
[7 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.
AMDGPU: Add -gen-amdgpu-target-def TableGen backend
Currently subtarget information is duplicated between a def file and
the backend. There are also increasingly unwieldy mapping tables
for subarches. Work towards unifying these, starting with r600. This
mirrors aarch64 and riscv's existing custom targetparser backends (i.e.,
the prompt was copy what riscv does).
Co-authored-by: Claude (Claude-Opus-4.8)
[AArch64][GlobalISel] Use integer types for inline assembly lowering (#212214)
If we need to generate a trunc then we can use an integer type for the
lowering.
[LoopUnroll] Make the list of supported recurrence kinds inclusive. (#210957)
This excludes Sub, AddChainWithSubs, FSub and FAddChainWithSubs
recurrence kinds by making the list of supported types opt-in as opposed
to opt-out. This will hopefully mean that as more recurrence kinds are
added in the future, the list supported by the unrolling remains valid.
Fixes #201065
(cherry picked from commit cc1dd6bb25d00b3aa5420f43884bea3f4584cabf)