[llvm-profdata] Propagate Error in loadInput and mergeWriterContexts
Propagate Error from loadInput and mergeWriterContexts in mergeInstrProfile,
supplementInstrProfile, and overlapInstrProfile. In mergeInstrProfile's
ThreadPool, catch errors from worker threads, stop scheduling new jobs,
and return the first encountered fatal error.
Ensure ~WriterContext() consumes any pending unhandled errors in
WriterContext::Errors upon destruction.
Not NFC as destructors are run on the stack and ThreadPool workers exit
earlier on error.
With all subcommands propagating llvm::Error to main, exitWithError,
exitWithErrorCode, and the LSan leak suppression workaround are no
longer needed.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in merge subcommand (#228157)
Change merge_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[compiler-rt] Remove dlsym interceptor and support `-shared-libsan` for CSan
Summary:
Follow the UBSan offload runtime. Offload now resolves HSA through the
global scope, so the `dlsym` interceptor is no longer needed. The real
HSA entry points are still taken from the loaded HSA library rather than
`RTLD_NEXT`, since every DSO with a static runtime exports the same
wrappers and they would otherwise chain back into each other.
Build `libclang_rt.csan.so` with the offload objects folded in. The
exported HSA wrappers report failure when HSA is absent and warn when HSA
was loaded ahead of the runtime. The preinit hook moves to a separate
`csan_offload-preinit` archive for executables.
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]
[Clang] Support `-shared-libsan` for offload CSan
Summary:
Follow the UBSan handling. The shared runtime embeds the HSA
interceptors, so `csan_offload` is only linked with static runtimes and
executables pull in `csan_offload-preinit` to initialize early.
[Clang] Add support for the `-fsanitize=concurrency` runtime
Summary:
Add the frontend sanitizer kind, function attributes, pass pipeline
integration, predefined macro, driver handling, and documentation for
ConcurrencySanitizer.
[LLVM] Add a ConcurrencySanitizer LLVM pass
Summary:
Add an LLVM ConcurrencySanitizer pass to instrument memory and atomic
operations for a sampling race detector. Fundamentally the pass iterates
through every candidate memory operation and adds a check above it.
Unlike TSAN, we do not replace any operations, which heavily simplifies
the instrumentation.
We do not re-use the TSAN instrumentaiton because the appraoches are
different enough and the passes simple enough that the extra code is not
a large concern. More differences will be added in the future, so
keeping them separate is easlier.
[IR] Add the sanitize_concurrency function attribute
This introduces a new concurrency sanitizer attribute to be used with
the runtime of the same name. This has no major change and simply
updates the IR to handle it properly. This attribute is invalid when
combined with the thread sanitizer one as they are mutually exclusive.
[ELF] Initialize LLVM targets before parsing -mllvm (#228314)
readConfigs parses -mllvm before initLLVM initializes the targets, so an
option that a target registers at initialization (currently only Sparc
#227977)
is rejected as unknown.
Call initLLVM first, as the COFF, MachO, and wasm ports do. This will be
covered once a -mllvm used by lld/test/ELF/lto tests migrates.
fifo: Followups to fix previous fifo_vnops.c change.
1. Fix open so with O_RDONLY and not O_NONBLOCK, it will block as
POSIX specifies until there are writers -- not until there are
writers _or_ a read is possible without blocking (which is always
immediately true because read will immediately report EOF).
This was a regression in the previous change which I failed to
catch because I committed the change a few days ago to hg and
forgot that I hadn't yet run all the applicable tests when I
exported it to CVS today -- I had only done the background
research and thought about the semantics.
2. Clear xfail on various tests that were fixed by the change.
PR kern/59056: poll POLLHUP bugs
PR kern/60789: read on fifo without writer may block
www/caddy-custom: Fix build with BUILD_AS_NON_ROOT=yes
Two fixes:
1. Establish a GOCACHE and GOPATH for BUILD_AS_NON_ROOT so it doesn't
try to use /nonexistant/go (patch by Brad Ackerman).
2. Reset PORTREVISION (Vick Khera). I added a note in caddy/Makefile
so maybe I'll remember in the future.
PR: 295182
www/caddy: Update to 2.11.6
Changes: https://github.com/caddyserver/caddy/releases/tag/v2.11.6
There are some breaking changes in this release, so you should read
that list. They are primarily security-tightening changes and should
be invisible to most users. If you were relying on uploading files in
headers rather than the body, you'll want to make some changes.
[compiler-rt] Add more common HSA utilities for memory and symbolization (#228297) (#228312)
Summary:
Adds memory pool management for different kinds of allocation. Intended
to be used for the in-progress concurrency sanitizer.
RFC:
discourse.llvm.org/t/rfc-a-thread-concurrency-sanitizer-for-gpus-in-compiler-rt/91113
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[compiler-rt] Add more common HSA utilities for memory and symbolization (#228297) (#228312)
Summary:
Adds memory pool management for different kinds of allocation. Intended
to be used for the in-progress concurrency sanitizer.
RFC:
discourse.llvm.org/t/rfc-a-thread-concurrency-sanitizer-for-gpus-in-compiler-rt/91113
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>