You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
capnproto/c++
Ryan Ofsky 67352719aa PromiseDisposer: Use NOLINT to disable ArrayBound warning
Disable clang-analyzer-security.ArrayBound warning in PromiseDisposer::append
to silence clang-tidy.

A new clang-analyzer-security.ArrayBound "warning: Out of bound access to
memory preceding the region" "note: Access of the region at negative byte
offset -112" started happening when updating from clang-tidy 20 to 21.

The warning doesn't seem to indicate a real problem because ChainPromiseNode
instances which inherit from PromiseArenaMember are constructed starting at the
end of the PromiseArray byte array and a bounds check is done right before
calling the constructor.

More information the warning can be found:

- https://clang.llvm.org/docs/analyzer/checkers.html#security-arraybound-c-c
- https://github.com/bitcoin/bitcoin/pull/33445#issuecomment-3315082319

Error output looks like:

/usr/include/kj/async-inl.h:404:12: warning: Out of bound access to memory preceding the region [clang-analyzer-security.ArrayBound]
  404 |       ctor(*ptr, kj::mv(next), kj::fwd<Params>(params)...);
      |            ^
[...]
/home/admin/actions-runner/_work/_temp/src/ipc/libmultiprocess/include/mp/type-context.h:146:12: note: Calling 'Promise::then'
[...]
/usr/include/kj/async-inl.h:1301:7: note: Calling 'maybeChain<capnp::CallContext<ipc::capnp::messages::BlockTemplate::WaitNextParams, ipc::capnp::messages::BlockTemplate::WaitNextResults>>'
 1301 |       _::maybeChain(kj::mv(intermediate), implicitCast<ResultT*>(nullptr), location));
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/async-inl.h:955:10: note: Calling 'appendPromise<kj::_::ChainPromiseNode, kj::SourceLocation &>'
  955 |   return appendPromise<ChainPromiseNode>(kj::mv(node), location);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/async-inl.h:454:10: note: Calling 'PromiseDisposer::append'
  454 |   return PromiseDisposer::append<T>(kj::mv(next), kj::fwd<Params>(params)...);
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/async-inl.h:389:9: note: Left side of '||' is false
  389 |     if (!canArenaAllocate<T>() || arena == nullptr ||
      |         ^
/usr/include/kj/async-inl.h:389:9: note: Left side of '||' is false
/usr/include/kj/async-inl.h:390:9: note: Assuming the condition is false
  390 |         reinterpret_cast<byte*>(next.get()) - reinterpret_cast<byte*>(arena) < sizeof(T)) {
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/kj/async-inl.h:389:5: note: Taking false branch
  389 |     if (!canArenaAllocate<T>() || arena == nullptr ||
      |     ^
/usr/include/kj/async-inl.h:404:12: note: Access of the region at negative byte offset -112
  404 |       ctor(*ptr, kj::mv(next), kj::fwd<Params>(params)...);
      |            ^~~~
3 weeks ago
..
build Implement brotli-based streams 2 years ago
cmake cmake: CapnProtoConfig.cmake must find_dependency(ZLIB) when WITH_ZLIB=ON 3 years ago
ekam-provider Make GDB work more nicely on Ekam-built binaries. 13 years ago
m4 We now require C++14. 7 years ago
pkgconfig Fixes #1258. 4 years ago
samples Require CMake 3.10. 7 months ago
src PromiseDisposer: Use NOLINT to disable ArrayBound warning 3 weeks ago
.bazelignore [bazel] moving WORKSPACE to c++/ folder 3 years ago
.bazelrc Implement brotli-based streams 2 years ago
.bazelversion Implement brotli-based streams 2 years ago
BUILD.bazel [bazel] compile capnp 3 years ago
CMakeLists.txt Guard against multiple cmake inclusions 3 months ago
LICENSE.txt Improve makefiles to the point that make distcheck works. 12 years ago
MODULE.bazel Add `MODULE.bazel` for bzlmod 6 months ago
Makefile.am KJ: Move cidr to kj-async 3 months ago
Makefile.ekam We now require C++14. 7 years ago
README.txt Update woefully outdated readme for the c++ package. 11 years ago
WORKSPACE Update zlib1.3 to a live fossils link 1 year ago
afl-fuzz.sh fix typo in comment 9 years ago
compile_flags.txt Fix compile_flags.txt. 10 months ago
configure.ac Set mainline version to 1.3-dev. 4 months ago
ekam-build.sh Add various metrics (e.g. allocation and bandwidth) to http-over-capnp benchmark. 3 years ago
regenerate-bootstraps.sh Introduce new 'stream' keyword. 6 years ago
setup-autotools.sh Revert "Replaced fixed -j parm with call to nproc" 11 years ago
setup-ekam.sh Use /usr/bin/env shebang - /bin/bash is not universal 11 years ago
valgrind.supp Suppress bogus valgrind post-exit error. 6 years ago

README.txt

Cap'n Proto - Insanely Fast Data Serialization Format
Copyright 2013-2015 Sandstorm Development Group, Inc.
https://capnproto.org

Cap'n Proto is an insanely fast data interchange format and capability-based
RPC system.  Think JSON, except binary.  Or think of Google's Protocol Buffers
(http://protobuf.googlecode.com), except faster.  In fact, in benchmarks,
Cap'n Proto is INFINITY TIMES faster than Protocol Buffers.

Full installation and usage instructions and other documentation are maintained
on the Cap'n Proto web site:
  http://kentonv.github.io/capnproto/install.html

WARNING: Cap'n Proto requires a modern compiler. See the above link for
detailed requirements.

To build and install (from a release package), simply do:
  ./configure
  make -j4 check
  sudo make install

The -j4 allows the build to use up to four processor cores instead of one.
You can increase this number if you have more cores.  Specifying "check"
says to run tests in addition to building.  This can be omitted to make the
build slightly faster, but running tests and reporting failures back to the
developers helps us out!