Read the clock of a libkernel condition attribute, returning
SCE_KERNEL_ERROR_EINVAL for a null or destroyed attribute as
scePthreadCondattrSetclock does, after FreeBSD 11.4 libthr's
_pthread_condattr_getclock. A null clock pointer throws.
On a PS4 Pro with firmware 10.71 a successful sceJpegEncEncode returns the
size of the JPEG it wrote, the same value it stores in the output info,
and it does so when the output info pointer is null too. AnyPS5 returned
0, so a title that takes the size from the return value got an empty
image. The guest test now checks the returned size against the output
info.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The initial user reported keyboard type 0, which the converter maps to IME type 0
and then rejects, so a title reading the layout still could not use it. Report 20
for sceUserServiceGetKeyboardType, which the owner's table maps to IME keyboard
type 4 (English, US); the Japanese and Traditional Chinese input variants stay 0.
Tests and both debt entries updated.
On macOS, shutdown(SHUT_RD) on a UDP socket that was never bound does not
wake a thread blocked in recv on it, so sceNetShutdown left the receiver
hanging. Use the receive wait that Windows already has: block on the
socket table until the socket gets a local port or is shut, then poll.
On macOS an unbound socket reports port 0 from getsockname, so the check
looks at the port instead of the Winsock error.
Ported from #8658.
Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
All four exports threw. The ownership calls follow fchown: owner and
group 0 and the unchanged value are accepted and any other value
throws. The path is looked up first with stat, lstat or fstatat, as
FreeBSD 11's kern_fchownat does, so a lookup error is returned before
the owner is checked. fchownat rejects flags other than
AT_SYMLINK_NOFOLLOW with EINVAL. linkat passes AT_FDCWD and absolute
paths to link and rejects flags other than AT_SYMLINK_FOLLOW with
EINVAL; a relative path with a directory descriptor and a symbolic
link source without AT_SYMLINK_FOLLOW throw. On Windows a symbolic
link source is detected with the file attributes, since libstdc++
there reports it as a regular file.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Review of #9572 found three gaps:
- PeModule.name() checked that an RVA was in some code section, then
bisected one list of every symbol, so an address in a later code
section before that section's first symbol took the last symbol of an
earlier section. Each code section now keeps its own sorted list.
- Address files keep both counters ('module offset self inclusive'):
the inclusive count is kept and subtracted by --since, and the summary
lists functions by inclusive samples as well, summed over each
function's addresses (an upper bound when a function is on one stack
more than once). The total comes from the '# N samples' line or from
the 'thread <id> samples <n>' headings of APS5_SAMPLE_THREADS, which
the loader previously misread as a stack line; --thread keeps one
thread.
- The address writers of both samplers wrote no '# module' records, so
those files skipped the size and timestamp check. Both now write them
(through the helper the collapsed-stack writer uses), and the tool
leaves a module unsymbolized when the samples have no record for it,
unless --unverified is given.
Five new cases cover a second code section, inclusive totals, --since
on an address file, thread headings with --thread, and the missing
record with and without --unverified.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Windows samplers (APS5_SAMPLE_WORKER, APS5_SAMPLE_COMMITTER and
APS5_SAMPLE_THREADS) write every frame as module+0xRVA, and BUILD.md left
naming them to the reader ("for example with nm on the .prx"). Doing that
by hand means finding each module's image base, choosing between COFF
symbols and the export table, and keeping the files cumulative totals in
mind.
tools/symbolize_samples.py reads a collapsed-stack file or the address
file, opens each module it finds in --libs as a PE32+ image, and names
every frame module!function:
- From the COFF symbol table that the MinGW-built .prx and .dll keep:
external and static symbols in code sections, at the section's RVA
plus the symbol value. Addresses outside a code section, or before the
first symbol, stay module+0xRVA.
- From the export table, prefixed with "~", for a module without
symbols, such as the runtime DLLs.
- A module whose SizeOfImage or TimeDateStamp differs from the sampler's
"# module" line is left unsymbolized, with a warning: its addresses
would name the wrong functions.
--since subtracts an earlier copy of the same file, which keeps only the
samples taken between the two copies (the files hold totals since
start-up). --out writes the named stacks for speedscope or flamegraph.pl.
--demangle uses c++filt when it is on PATH. It needs no binutils
otherwise.
test_symbolize_samples (registered with CTest) builds small PE32+ images
with COFF symbols and with an export table, and covers short, string-table
and static names, the ignored section and data symbols, addresses outside
code, the export fallback, the size and timestamp check, --since with
--out, the address-file format and rejected lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A device loss on NVIDIA reports only VK_ERROR_DEVICE_LOST, and
VK_EXT_device_fault often gives no address. Nsight Aftermath can write a
crash dump that names the faulting shader and the kind of fault, but
only when the device was created with VK_NV_device_diagnostics_config.
APS5_NV_DIAGNOSTICS (presence) now creates the device with that
extension (shader debug info, resource tracking, automatic checkpoints,
shader error reporting) and with VK_NV_device_diagnostic_checkpoints
when the device supports them. Unset, or on a device without the
extension, the device is created as before; the latter prints a notice.
ChooseDeviceDiagnostics holds the choice so the test can check it.
AI-assisted: yes
getpeername on a socketpair end returned the unnamed AF_UNIX address
even after the other end was closed. In FreeBSD 11, closing an end runs
uipc_detach, whose unp_disconnect and unp_drop clear SS_ISCONNECTED on
both stream and datagram ends, and kern_getpeername then fails with
ENOTCONN. Each end now keeps a weak reference to its peer's socket,
which expires when the peer's last descriptor, duplicates included, is
closed. shutdown leaves the ends connected, as soshutdown does.
FreeBSD 11.4's lookup() (sys/kern/vfs_lookup.c) fails with ENOTDIR when
a path with a trailing slash ends at something that is not a directory.
On Windows a mount alias dropped the slash, and the host calls do not
report ENOTDIR for "file\", so unlink, rename and open acted on the file
or failed with EINVAL. Guest path resolution now rejects an existing
non-directory named with a trailing slash with ENOTDIR on every host, and
a mount alias keeps the slash on Windows as it does on Linux and macOS.