mirror of
https://github.com/darlinghq/darlingserver.git
synced 2024-11-23 04:19:44 +00:00
[thread] Ingore errors saving state after user-suspend
As the comment I added says, sometimes a process is killed while user-suspended (e.g. when LLDB sends the kill signal while debugging). In such cases, trying to save the state back to the process will fail (since it no longer exists). We can safely ignore such errors, but let's also log a warning just-in-case.
This commit is contained in:
parent
697fa6e643
commit
8e57a9213a
@ -1407,7 +1407,13 @@ DarlingServer::Thread::RunState DarlingServer::Thread::getRunState() const {
|
||||
void DarlingServer::Thread::waitWhileUserSuspended(uintptr_t threadStateAddress, uintptr_t floatStateAddress) {
|
||||
loadStateFromUser(threadStateAddress, floatStateAddress);
|
||||
dtape_thread_wait_while_user_suspended(_dtapeThread);
|
||||
saveStateToUser(threadStateAddress, floatStateAddress);
|
||||
try {
|
||||
saveStateToUser(threadStateAddress, floatStateAddress);
|
||||
} catch (std::system_error e) {
|
||||
// if we fail to save the state back to the process, that likely means the process died or was killed while waiting.
|
||||
// it's nothing to worry about. just log it and move on.
|
||||
threadLog.warning() << *this << ": failed to save state back to user in waitWhileUserSuspended: " << e.code() << " (" << e.what() << ")" << threadLog.endLog;
|
||||
}
|
||||
};
|
||||
|
||||
void DarlingServer::Thread::sendSignal(int signal) const {
|
||||
|
Loading…
Reference in New Issue
Block a user