[CRIU] dump stopped tasks suspended from terminal (treat TSTP like STOP)?

Scott Mcdermott scott at smemsh.net
Sun Jan 24 06:51:54 PST 2016


I tried criu (v1.8-224-g5dc64eb, kernel 4.3.1), command line:

    $ sudo criu dump -t `pgrep -P1 tmux`
    Error (ptrace.c:274): SEIZE 17067: unsupported stop signal 20
    Error (ptrace.c:274): SEIZE 19394: unsupported stop signal 20
    Error (ptrace.c:274): SEIZE 17067: unsupported stop signal 20
    ...
    Error (cr-dump.c:1578): Dumping FAILED.

These are just shells, pagers, curses apps stopped by CTRL-Z.  I
typically have tons of these stopped jobs in my terminals.  These simple
paused terminal apps cannot be dumped by CRIU?

I noticed that in patch 79d47a9 the capability to handle processes
suspended by SIGSTOP was added, and indeed if I do the following:

    tmux -L test
    <inside-tmux> more /etc/hosts
    <outside-tmux> kill -STOP <pidof-more-in-tmux>

(i.e., send STOP signal from different terminal, leaving pager in
foreground) then the pager still stops, the shell notices, and a
subsequent 'dump' succeeds.

Can we not just naively add code to treat TSTP as identical to STOP?  It
seems to only differ in where it came from (tty driver raises TSTP in
attached process but STOP must be raised explicitly by user code) and
whether it can be blocked.

(incidentally, we also have SIGTTOU case to handle but that's more
complicated because there's a buffer with I/O waiting when return from
signal)

-- 
Scott


More information about the CRIU mailing list