genode/repos/os/include
Christian Helmuth 4a2319a4d6 os: limit backtrace to stack of current thread
The frame-pointer-based backtrace does not work without enabling
-fno-omit-frame-pointer explicitly and in most cases leads to page
faults because non-pointer stack values are dereferenced during the
walk. The best we can do is to limit the backtrace walk to the stack of
the current thread to prevent page faults unrelated to the system state
without the use of the backtrace utility.

This commit introduces a printable Backtrace class usable in
Genode::log(), Genode::trace(), etc. The class is based on the new
function for_each_return_address(auto const &fn) that walks the stack in
its limits and calls fn() for each discovered return address on the
stack in the new os/include/os/backtrace.h. Archtecture-specific
stack-pointer retrieval and walk loops are implemented in dedicated
os/include/spec/<arch>/os/for_each_return_address.h files. Also, the
well-known Genode::backtrace() function (which logs the return-address
values) is provided for backwards compatibility.

Fixes #5078
2024-02-26 08:31:02 +01:00
..
audio_in_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
audio_out_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
blit os: avoid implicit conversions 2021-12-17 15:04:45 +01:00
block Remove unneeded session_size check 2022-08-10 13:32:57 +02:00
block_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
capture_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
decorator list_model.h: rename 'apply_first' to 'with_first' 2023-11-28 14:24:24 +01:00
event_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
file_system file_system/util.h: remove packet-stream helpers 2022-02-15 10:11:10 +01:00
file_system_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
framebuffer_session os: make nitpicker compatible to C++20 2023-05-30 12:03:29 +02:00
genode_c_api genode_c_api/event: add wheel events 2023-09-29 12:15:06 +02:00
gpio os: avoid implicit conversions 2021-12-17 15:04:45 +01:00
gpio_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
gpu gpu/intel: GEN12+ 2022-11-17 08:00:36 +01:00
gpu_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
gui_session os: make nitpicker compatible to C++20 2023-05-30 12:03:29 +02:00
i2c_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
init Adaptation to init refactoring 2017-03-24 16:19:56 +01:00
input acpi_event: generalize config for any key 2023-02-27 08:22:46 +01:00
input_session os: make nitpicker compatible to C++20 2023-05-30 12:03:29 +02:00
ldso Adjust file headers to refer to the AGPLv3 2017-02-28 12:59:29 +01:00
loader_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
mixer os: avoid using deprecated APIs 2019-01-30 13:49:54 +01:00
monitor monitor: add more debugging features 2023-08-23 13:46:37 +02:00
net os/include/net: add support for the DNS protocol 2023-11-28 14:24:23 +01:00
nic Remove unused Nic::Root implementation (nic/root.h) 2022-05-25 12:19:31 +02:00
nic_session os: replace enum by static constexpr (C++20) 2023-05-30 12:03:29 +02:00
nitpicker_gfx os: Don't use char as array subscript. 2022-02-15 10:23:58 +01:00
os os: limit backtrace to stack of current thread 2024-02-26 08:31:02 +01:00
packet_stream_rx os: remove blocking semantics from packet stream 2022-02-15 10:10:03 +01:00
packet_stream_tx os: remove blocking semantics from packet stream 2022-02-15 10:10:03 +01:00
pci pci_decode: calculate 64bit BAR size 2023-07-14 12:06:32 +02:00
pin_control_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
pin_state_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
platform_session platform_session: increase RAM and CAP quota 2023-11-30 14:20:53 +01:00
pointer os: avoid garbage warnings in app/painter 2019-01-07 12:25:45 +01:00
ram_fs vfs: remove 'file_size' from read/write interfaces 2023-02-27 08:22:49 +01:00
report_rom Remove unneeded session_size check 2022-08-10 13:32:57 +02:00
report_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
rtc_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
sandbox monitor: apply affinity to monitored children 2023-09-29 12:17:45 +02:00
smbios os: avoid implicit conversions 2021-12-17 15:04:45 +01:00
spec os: limit backtrace to stack of current thread 2024-02-26 08:31:02 +01:00
terminal os: avoid implicit conversions 2021-12-17 15:04:45 +01:00
terminal_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
trace trace_buffer: fix check for empty buffer 2023-04-17 14:48:30 +02:00
uart_session Remove format strings from connection types 2023-03-13 14:32:37 +01:00
uplink_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
usb usb_session: align USB packet allocation correctly 2022-11-17 08:00:35 +01:00
usb_session os: define CAP_QUOTA as constexpr (C++20) 2023-05-30 12:03:29 +02:00
util monitor: add more debugging features 2023-08-23 13:46:37 +02:00
vfs vfs: fix dangling allocation in dir_file_system 2023-05-30 12:03:26 +02:00
virtio virtio: fix MMIO build errors with -std=gnu++20 2023-05-30 12:03:31 +02:00