gdb_monitor: fix possible page fault on thread removal

Fixes #3133
This commit is contained in:
Christian Prochaska 2019-01-25 13:49:46 +01:00 committed by Norman Feske
parent 4f88b664e2
commit 210fbcc4c2
2 changed files with 4 additions and 3 deletions

View File

@ -267,7 +267,8 @@ void Cpu_session_component::kill_thread(Thread_capability thread_cap)
Cpu_thread_component *cpu_thread = lookup_cpu_thread(thread_cap); Cpu_thread_component *cpu_thread = lookup_cpu_thread(thread_cap);
if (cpu_thread) { if (cpu_thread) {
genode_remove_thread(cpu_thread->lwpid()); if (cpu_thread->lwpid())
genode_remove_thread(cpu_thread->lwpid());
_thread_list.remove(cpu_thread); _thread_list.remove(cpu_thread);
destroy(_md_alloc, cpu_thread); destroy(_md_alloc, cpu_thread);
} else } else

View File

@ -36,8 +36,8 @@ class Gdb_monitor::Cpu_thread_component : public Rpc_object<Cpu_thread>,
Cpu_session_component &_cpu_session_component; Cpu_session_component &_cpu_session_component;
Cpu_thread_client _parent_cpu_thread; Cpu_thread_client _parent_cpu_thread;
unsigned long _lwpid; unsigned long _lwpid { 0 };
addr_t _initial_ip; addr_t _initial_ip { 0 };
/* /*
* SIGTRAP, SIGSTOP and SIGINT must get delivered to the gdbserver code * SIGTRAP, SIGSTOP and SIGINT must get delivered to the gdbserver code