Fix race condition in page fault notification
When a page fault cannot be resolved, the GDB monitor can get a hint about which thread faulted by evaluating the thread state object returned by 'Cpu_session::state()'. Unfortunately, with the current implementation, the signal which informs GDB monitor about the page fault is sent before the thread state object of the faulted thread has been updated, so it can happen that the faulted thread cannot be determined immediately after receiving the signal. With this commit, the thread state gets updated before the signal is sent. At least on base-nova it can also happen that the thread state is not accessible yet after receiving the page fault notification. For this reason, GDB monitor needs to retry its query until the state is accessible. Fixes #1206.
This commit is contained in:
committed by
Norman Feske
parent
2a5fd44d7d
commit
a46de84f89
@@ -81,8 +81,6 @@ void Pager_activation_base::entry()
|
||||
/* handle request */
|
||||
if (obj->pager(pager)) {
|
||||
/* could not resolv - leave thread in pagefault */
|
||||
Lock::Guard guard(obj->state.lock);
|
||||
obj->state.unresolved_page_fault = true;
|
||||
PDBG("Could not resolve pf=%p ip=%p",
|
||||
(void*)pager.fault_addr(), (void*)pager.fault_ip());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user