mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
Kernel: Set "pledge_violation" coredump metadata in REQUIRE_PROMISE()
Similar to LibC storing an assertion message before aborting, process death by pledge violation now sets a "pledge_violation" key with the respective pledge name as value in its coredump metadata, which the CrashReporter will then show.
This commit is contained in:
parent
7e5c49b755
commit
678919e9c1
Notes:
sideshowbarker
2024-07-18 23:02:10 +09:00
Author: https://github.com/linusg
Commit: 678919e9c1
Pull-request: https://github.com/SerenityOS/serenity/pull/5022
2 changed files with 6 additions and 0 deletions
|
@ -499,6 +499,7 @@ public:
|
|||
void unblock_waiters(Thread::WaitBlocker::UnblockFlags, u8 signal = 0);
|
||||
Thread::WaitBlockCondition& wait_block_condition() { return m_wait_block_condition; }
|
||||
|
||||
HashMap<String, String>& coredump_metadata() { return m_coredump_metadata; }
|
||||
const HashMap<String, String>& coredump_metadata() const { return m_coredump_metadata; }
|
||||
|
||||
PerformanceEventBuffer* perf_events() { return m_perf_event_buffer; }
|
||||
|
@ -778,6 +779,8 @@ inline u32 Thread::effective_priority() const
|
|||
&& !Process::current()->has_promised(Pledge::promise)) { \
|
||||
dbgln("Has not pledged {}", #promise); \
|
||||
cli(); \
|
||||
Process::current()->coredump_metadata().set( \
|
||||
"pledge_violation", #promise); \
|
||||
Process::current()->crash(SIGABRT, 0); \
|
||||
ASSERT_NOT_REACHED(); \
|
||||
} \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue