1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

Kernel: Abort core dump generation if any substep fails

And make an effort to propagate errors out from the inner parts.
This fixes an issue where the kernel would infinitely loop in coredump
generation if the TmpFS filled up.
This commit is contained in:
Andreas Kling 2020-12-22 09:59:14 +01:00
parent 531c3fe72e
commit 2dfe5751f3
4 changed files with 52 additions and 24 deletions

View file

@ -42,16 +42,16 @@ public:
static OwnPtr<CoreDump> create(Process&, const String& output_path);
~CoreDump();
void write();
[[nodiscard]] KResult write();
private:
CoreDump(Process&, NonnullRefPtr<FileDescription>&&);
static RefPtr<FileDescription> create_target_file(const Process&, const String& output_path);
void write_elf_header();
void write_program_headers(size_t notes_size);
void write_regions();
void write_notes_segment(ByteBuffer&);
[[nodiscard]] KResult write_elf_header();
[[nodiscard]] KResult write_program_headers(size_t notes_size);
[[nodiscard]] KResult write_regions();
[[nodiscard]] KResult write_notes_segment(ByteBuffer&);
ByteBuffer create_notes_segment_data() const;
ByteBuffer create_notes_threads_data() const;