Found another deeply hidden open /dev/null O_RDWR which was happening
in awk -safe mode. Reproducer is awk -safe '{ close("/dev/stdin"); }
Rerrange the pledges and unveils to make it work.
ok millert dgl
[Clang] Use stable_sort in VerifyDiagnosticsConsumer. (#187827)
The new code introduced for `-verify-directives` in PR #179835 enforces
that the order of diagnostics matches the order of the directives.
However, before checking this, it sorts the directives by
SourceLocation. Perhaps non-obviously, all directives which appear
inside a single comment are given the same SourceLocation, pointing to
the beginning of the comment. While these are added in order they appear
in the comment, the non-stable std::sort may non-detministically
misorder them. Switching to stable_sort ensures the correct order is
verified.
This was observed as a random test failure on the checks in
clang/test/CXX/drs/cwg25xx.cpp lines 250 and 264, in some builds of
Clang. Note that those lines end in backslashes, and thus, despite
appearances, the directives on the following lines are also within the
same single comment.
release.sh: add chroot cleanup routine
The chroot_cleanup routine handles any cleanup needed post-chroot_setup,
etc. This consists of purely tearing down `${CHROOTDIR}/dev` today, but
might involve additional steps, as needed for custom functions. This
allows end-users to override the various chroot functions without having
to modify code in main() or replicate the unmount procedure in an
equivalent routine setup via the trap builtin.
This change modifies the /dev unmount process to use `umount -f` instead
of `umount`. The latter can result in failures if resources are still
mounted or are running post-build, whereas the former will clean up any
resources still in use by processes running in the chroot at time of
build. Moreover, the `chroot_cleanup` routine is now called when the
script is killed with `SIGINT` and `SIGTERM`, as well as at `EXIT`,
better ensuring that the script's resources are cleaned up in relatively common
scenarios that can be detected/handled.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)
release.sh: document user-overriddable functions
This helps others attempting to customize the behavior of `release.sh`.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55450 (as part of a larger change)
libc: Fix cxa_thread_atexit{,nothr} test.
After patch 9d26b82, we don't provide recursive call protection anymore.
Therefore, to pass the test, we adjust the testcase by protecting on
caller and the testcase is to make sure the dtors is properly handled.
Reported by: siva
Reviewed by: kib
Approved by: markj (mentor)
Fixes: 9d26b82826d9 ("libc: Fix dtor order in __cxa_thread_atexit")
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55893
hwpstate_amd: Refactor the cpufreq code by using delegation pattenr
We separate the code of CPPC and legacy pstate driver to make it easier
to read.
Reviewed by: olce
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D55604