Skip to content

Fix deadlock when a process is forked in the resume phase#691

Merged
karya0 merged 1 commit intodmtcp:2.6from
rohgarg:fix-threadsync-2.6
Sep 24, 2018
Merged

Fix deadlock when a process is forked in the resume phase#691
karya0 merged 1 commit intodmtcp:2.6from
rohgarg:fix-threadsync-2.6

Conversation

@rohgarg
Copy link
Copy Markdown
Contributor

@rohgarg rohgarg commented Apr 26, 2018

We need to reset the preResumeThreadCount in the child process in the
atfork_child handler. Otherwise, if a process is forked in the resume
phase, this can lead to a deadlock, where the checkpoint thread that's
created for the child process in the fork() wrapper gets blocked in
waitForUserThreadsToFinishPreResumeCB(). This is because the child process
inherits the non-zero value of preResumeThreadCount from the parent.

We need to reset the `preResumeThreadCount` in the child process in the
atfork_child handler. Otherwise, if a process is forked in the resume
phase, this can lead to a deadlock, where the checkpoint thread that's
created for the child process in the fork() wrapper gets blocked in
waitForUserThreadsToFinishPreResumeCB(). This is because the child process
inherits the non-zero value of `preResumeThreadCount` from the parent.
@karya0 karya0 merged commit a9eb5e9 into dmtcp:2.6 Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants