[libcxx-commits] [libcxx] [libc++][hardening] In production hardening modes, trap rather than abort (PR #78561)
Konstantin Varlamov via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Jan 19 11:38:54 PST 2024
var-const wrote:
For the record, with the changes applied, the output produced by `check_assertion.h` looks like this:
```
# .---command stderr------------
# | Failure: EXPECT_DEATH( c.front() ) failed!
# | (cause: Child died, but with a different death cause
# | Expected cause: verbose abort
# | Actual cause: trap
# | )
# |
# | child exit code: 5
# | ---------- standard err ----------
# |
# | ----------------------------------
# | ---------- standard out ----------
# |
# | ----------------------------------
# | Assertion failed: (( ExpectDeath(DeathCause::VerboseAbort, "c.front()", [&]() { (void)(c.front()); }) )), function main, file assert.cfront.empty.pass.cpp, line 28.
# `-----------------------------
# error: command failed with exit status: 250
```
```
# .---command stderr------------
# | Failure: EXPECT_DEATH( c.front() ) failed!
# | (cause: Child died, but with a different verbose abort message
# | Expected message: 'front() called on an empty container'
# | Actual message: 'front() called on an empty vector'
# | Expected location: *:*
# | Actual location: /Users/varconst/work/llvm-project/build/include/c++/v1/vector:617
# | )
# |
# | child exit code: 1
# | ---------- standard err ----------
# | ###
# | /Users/varconst/work/llvm-project/build/include/c++/v1/vector:617: assertion !empty() failed: front() called on an empty vector
# | ###
# | ----------------------------------
# | ---------- standard out ----------
# |
# | ----------------------------------
# | Assertion failed: (( ExpectDeath(DeathCause::VerboseAbort, "c.front()", [&]() { (void)(c.front()); }, AssertionInfoMatcher("front() called on an empty container")) )), function main, file assert.cfront.empty.pass.cpp, line 35.
# `-----------------------------
# error: command failed with exit status: 250
```
https://github.com/llvm/llvm-project/pull/78561
More information about the libcxx-commits
mailing list