From a5e557472cca4532b9e397d49ff4ac3f1fb53c7e Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 10 Jan 2021 12:23:47 -0700 Subject: Kernel: Defer handling of key press events in VirtualConsole Trying to pass these onto the Terminal while handling an IRQ is a recipe for disaster. Use Processor::deferred_call_queue to create an ad-hoc "second half" of the interrupt handler. Fixes #4889 --- Kernel/TTY/VirtualConsole.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Kernel') diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp index f6e530b2ee..13a43ac49f 100644 --- a/Kernel/TTY/VirtualConsole.cpp +++ b/Kernel/TTY/VirtualConsole.cpp @@ -238,7 +238,9 @@ void VirtualConsole::on_key_pressed(KeyboardDevice::Event event) return; } - m_terminal.handle_key_press(event.key, event.code_point, event.flags); + Processor::deferred_call_queue([this, event]() { + m_terminal.handle_key_press(event.key, event.code_point, event.flags); + }); } ssize_t VirtualConsole::on_tty_write(const UserOrKernelBuffer& data, ssize_t size) -- cgit v1.2.3