[all-commits] [llvm/llvm-project] abbf1f: [Support] Fix Process::PreventCoreFiles() when cor...

Vitaly Buka via All-commits all-commits at lists.llvm.org
Sat Mar 9 00:41:27 PST 2024


  Branch: refs/heads/users/vitalybuka/spr/clang-add-optional-pass-to-remove-ubsan-traps-using-pgo
  Home:   https://github.com/llvm/llvm-project
  Commit: abbf1f18825440338f6e08c94c54d8c8b4fe57d4
      https://github.com/llvm/llvm-project/commit/abbf1f18825440338f6e08c94c54d8c8b4fe57d4
  Author: Alexander Richardson <alexrichardson at google.com>
  Date:   2024-03-08 (Fri, 08 Mar 2024)

  Changed paths:
    M llvm/lib/Support/Unix/Process.inc

  Log Message:
  -----------
  [Support] Fix Process::PreventCoreFiles() when coredumps are piped

On many current Linux systems, coredumps are no longer dumped in the CWD
but instead piped to a utility such as systemd-coredumpd that stores
them in a deterministic location. This can be done by setting the
kernel.core_pattern sysctl to start with a '|'. However, when using such
a setup the kernel ignores a coredump limit of 0 (since there is no file
being written) and we can end up piping many gigabytes of data to
systemd-coredumpd which causes the test suite to freeze for a long time.
While most piped coredump handlers do respect the crashing processes'
RLIMIT_CORE, this is notable not the case for Debian's systemd-coredump
due to a local patch that changes sysctl.d/50-coredump.conf to ignore
the specified limit and instead use RLIM_INFINITY
(https://salsa.debian.org/systemd-team/systemd/-/commit/64599ffe44f0d).

Fortunately there is a workaround: the kernel recognizes the magic value
of 1 for RLIMIT_CORE to disable coredumps when piping. One byte is also
too small to generate any coredump, so it effectively behaves as if we
had set the value to zero.

The alternative to using RLIMIT_CORE=1 would be to use prctl() with the
PR_SET_DUMPABLE flag, however that also prevents ptrace(), so makes it
impossible to attach a debugger.

See https://github.com/llvm/llvm-project/pull/83701 and
https://github.com/llvm/llvm-project/issues/45797

Reviewed By: MaskRay

Pull Request: https://github.com/llvm/llvm-project/pull/83703


  Commit: ba13fa2a5d57581bff1a7e9322234af30f4882f6
      https://github.com/llvm/llvm-project/commit/ba13fa2a5d57581bff1a7e9322234af30f4882f6
  Author: Michael Spencer <bigcheesegs at gmail.com>
  Date:   2024-03-08 (Fri, 08 Mar 2024)

  Changed paths:
    M clang-tools-extra/clangd/JSONTransport.cpp
    M clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
    M llvm/include/llvm/Support/Error.h
    M llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
    M llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
    M llvm/lib/Object/ArchiveWriter.cpp
    M llvm/lib/Support/AutoConvert.cpp
    M llvm/lib/Support/LockFileManager.cpp
    M llvm/lib/Support/Path.cpp
    M llvm/lib/Support/RandomNumberGenerator.cpp
    M llvm/lib/Support/Unix/Memory.inc
    M llvm/lib/Support/Unix/Path.inc
    M llvm/lib/Support/Unix/Process.inc
    M llvm/lib/Support/Windows/Process.inc
    M llvm/lib/Support/Windows/Program.inc
    M llvm/lib/Support/raw_ostream.cpp
    M llvm/lib/Support/raw_socket_stream.cpp

  Log Message:
  -----------
  [llvm][Support] Add and use errnoAsErrorCode (#84423)

LLVM is inconsistent about how it converts `errno` to `std::error_code`.
This can cause problems because values outside of `std::errc` compare
differently if one is system and one is generic on POSIX systems.

This is even more of a problem on Windows where use of the system
category is just wrong, as that is for Windows errors, which have a
completely different mapping than POSIX/generic errors. This patch fixes
one instance of this mistake in `JSONTransport.cpp`.

This patch adds `errnoAsErrorCode()` which makes it so people do not
need to think about this issue in the future. It also cleans up a lot of
usage of `errno` in LLVM and Clang.


  Commit: def038bc40fae7d6756dde9c41677d76ad0387d2
      https://github.com/llvm/llvm-project/commit/def038bc40fae7d6756dde9c41677d76ad0387d2
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/DeclCXX.cpp
    M clang/test/SemaCXX/lambda-expressions.cpp

  Log Message:
  -----------
  Revert "[clang] Fix crash when declaring invalid lambda member" (#84615)

Reverts llvm/llvm-project#74110

Fails on many bots:
https://lab.llvm.org/buildbot/#/builders/5/builds/41633


  Commit: 567e00e9765aa57a4a91d3ac76adc5285b7b886b
      https://github.com/llvm/llvm-project/commit/567e00e9765aa57a4a91d3ac76adc5285b7b886b
  Author: Vitaly Buka <vitalybuka at google.com>
  Date:   2024-03-09 (Sat, 09 Mar 2024)

  Changed paths:
    M clang-tools-extra/clangd/JSONTransport.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
    M clang/test/SemaCXX/lambda-expressions.cpp
    M llvm/include/llvm/Support/Error.h
    M llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
    M llvm/lib/ExecutionEngine/Orc/TargetProcess/ExecutorSharedMemoryMapperService.cpp
    M llvm/lib/Object/ArchiveWriter.cpp
    M llvm/lib/Support/AutoConvert.cpp
    M llvm/lib/Support/LockFileManager.cpp
    M llvm/lib/Support/Path.cpp
    M llvm/lib/Support/RandomNumberGenerator.cpp
    M llvm/lib/Support/Unix/Memory.inc
    M llvm/lib/Support/Unix/Path.inc
    M llvm/lib/Support/Unix/Process.inc
    M llvm/lib/Support/Windows/Process.inc
    M llvm/lib/Support/Windows/Program.inc
    M llvm/lib/Support/raw_ostream.cpp
    M llvm/lib/Support/raw_socket_stream.cpp

  Log Message:
  -----------
  rebase

Created using spr 1.3.4


Compare: https://github.com/llvm/llvm-project/compare/7eed242d6042...567e00e9765a

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list