• Tycho Andersen's avatar
    restore: use root_as_sibling only after defining it · 1ff2500b
    Tycho Andersen authored
    root_as_sibling was used in criu_signals_setup(), but was only defined later
    (when forking the root task for the first time). This meant that the
    SA_NOCLDSTOP was never masked off, which meant SIGCHLD was never delivered
    after ptracing the root task. Thus, when the a child of the root task died
    (e.g. from cr_system), the root task sat in PTRACE_STOP, and the restore task
    never PTRACE_CONT'd, resulting in a deadlock.
    
    Instead, we only unmask SA_NOCLDSTOP right before we PTRACE_SEIZE, after the
    value is defined.
    
    v2: re-work the condition for CLONE_PARENT
    v3: move unmasking of SA_NOCLDSTOP to restore_root_task
    v4: keep all the comments in the original code
    Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    1ff2500b
cr-restore.c 62.6 KB