Find a file
Dimitry Andric ef4d145057 Merge commit 382f70a877f0 from llvm-project (by Louis Dionne):
[libc++][NFC] Rewrite function call on two lines for clarity (#79141)

  Previously, there was a ternary conditional with a less-than comparison
  appearing inside a template argument, which was really confusing because
  of the <...> of the function template. This patch rewrites the same
  statement on two lines for clarity.

Merge commit d129ea8d2fa3 from llvm-project (by Vitaly Buka):

  [libcxx] Align `__recommend() + 1`  by __endian_factor (#90292)

  This is detected by asan after #83774

  Allocation size will be divided by `__endian_factor` before storing. If
  it's not aligned,
  we will not be able to recover allocation size to pass into
  `__alloc_traits::deallocate`.

  we have code like this
  ```
   auto __allocation = std::__allocate_at_least(__alloc(), __recommend(__sz) + 1);
      __p               = __allocation.ptr;
      __set_long_cap(__allocation.count);

  void __set_long_cap(size_type __s) _NOEXCEPT {
      __r_.first().__l.__cap_     = __s / __endian_factor;
      __r_.first().__l.__is_long_ = true;
    }

  size_type __get_long_cap() const _NOEXCEPT {
      return __r_.first().__l.__cap_ * __endian_factor;
    }

  inline ~basic_string() {
      __annotate_delete();
      if (__is_long())
        __alloc_traits::deallocate(__alloc(), __get_long_pointer(), __get_long_cap());
    }
  ```
  1. __recommend() -> even size
  2. `std::__allocate_at_least(__alloc(), __recommend(__sz) + 1)` - > not
  even size
  3. ` __set_long_cap() `- > lose one bit of size for __endian_factor == 2
  (see `/ __endian_factor`)
  4. `__alloc_traits::deallocate(__alloc(), __get_long_pointer(),
  __get_long_cap())` -> uses even size (see `__get_long_cap`)

This should fix incorrect deallocation sizes for some instances of
std::string. Memory profiling or debugging tools like AddressSanitizer,
LeakSanitizer or TCMalloc could then complain about the the size passed
to a deallocation not matching the size originally passed to the
allocation.

Reported by:	Aliaksei Kandratsenka <alkondratenko@gmail.com>
PR:		279560
MFC after:	3 days

(cherry picked from commit ead8e4c081)
2024-06-10 09:29:30 +02:00
.cirrus-ci
.github/workflows .github: Update the path used for the homebrew LLVM install on macOS 2024-05-14 12:56:33 -04:00
bin cat: Check for lack of success rather than a specific failure. 2024-05-14 08:59:12 +02:00
cddl zfs: merge openzfs/zfs@fb6d53206 (zfs-2.1-release) into stable/13 2024-03-01 15:16:06 +01:00
contrib Merge commit 382f70a877f0 from llvm-project (by Louis Dionne): 2024-06-10 09:29:30 +02:00
crypto heimdal: Fix compiling hdb ldap as a module 2024-04-29 05:51:11 -07:00
etc Don't package /var/db/locate.database 2024-06-04 06:11:10 +01:00
gnu Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
include posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NP 2024-03-11 02:29:51 +02:00
kerberos5 Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
lib libusbhid: add missing include guards 2024-06-09 13:02:41 -04:00
libexec tftpd: Add missing -S option to synopsis. 2024-05-14 08:59:12 +02:00
release release: Use the ABI of the target release to fetch packages 2024-04-23 22:04:44 -07:00
rescue rescue: include ping iff at least one of INET & INET6 is enabled 2023-09-24 11:48:33 -04:00
sbin Enable soft updates by default for UFS2 filesystems. 2024-05-22 12:22:14 -07:00
secure caroot: routine update 2024-02-13 13:15:13 -06:00
share ieee80211_vap(9): fix the title 2024-06-06 12:54:35 -03:00
stand loader: For EFI, if we don't have ConOut, try ConIn 2024-02-06 17:12:40 -07:00
sys Adjust comments referencing vm_mem_init() 2024-06-06 12:54:35 -03:00
targets Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2024-01-08 00:04:38 +01:00
tests path_test: fix cap_rights_init usage 2024-03-22 09:35:44 -04:00
tools mwlstats: Fix a typo in an error message 2024-04-25 08:17:38 +02:00
usr.bin diff: honour -B flag with -q 2024-06-07 17:15:57 -04:00
usr.sbin periodic.conf: remove long deprecated security_daily_compat_var() 2024-06-05 10:08:28 +02:00
.arcconfig
.arclint
.cirrus.yml Cirrus-CI: bump Clang versions to 16 and 17 2024-04-24 10:06:09 -04:00
.clang-format Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
.gitattributes
.gitignore gitignore: whack dead architectures 2023-08-06 21:05:36 +02:00
COPYRIGHT
LOCKS Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
MAINTAINERS Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.inc1 Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2024-01-08 00:04:38 +01:00
Makefile.libcompat Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.sys.inc Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
ObsoleteFiles.inc Add a few missed libclang_rt files to ObsoleteFiles.inc 2024-04-24 23:26:28 +02:00
README.md hier(7): remove text describing /usr/src layout 2022-12-05 12:37:07 -04:00
RELNOTES Remove $FreeBSD$: one-line bare tag 2023-08-23 11:43:33 -06:00
UPDATING net80211: deal with lost state transitions 2024-02-19 08:02:01 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

For information on the CPU architectures and platforms supported by FreeBSD, see the FreeBSD website's Platforms page.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING* for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources (see sys/README.md).
targets Support for experimental DIRDEPS_BUILD
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.