• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

xemul / criu
66%
master: 66%

Build:
Build:
LAST BUILD BRANCH: criu-dev
DEFAULT BRANCH: master
Repo Added 20 Feb 2016 10:01AM UTC
Files 217
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH master-test
branch: master-test
CHANGE BRANCH
x
Reset
  • master-test
  • HEAD
  • br-criu-dev-fpregs-arch
  • br-issue-302
  • criu-2.x-stable
  • criu-compel
  • criu-dev
  • criu-dev-fdinfo-parse-once
  • criu-dev-filemap-open-fix
  • criu-dev-files-image-merge
  • criu-dev-files-images
  • criu-dev-fsnotify
  • criu-dev-ghost-holes
  • criu-dev-init-relax
  • criu-dev-initcalls
  • criu-dev-lsm-kerndat
  • criu-dev-memprotects
  • criu-dev-merge
  • criu-dev-nogetpid
  • criu-dev-page-xfer-sanitize
  • criu-dev-rebase
  • criu-dev-remote
  • criu-dev-rst-mem
  • criu-dev-rst-mem-2
  • criu-dev-scms
  • criu-dev-sit-device
  • criu-dev-stages-opt
  • criu-dev-test
  • criu-dev-ttys
  • criu-dev-veth-test
  • criu-zdtm-rpc
  • master
  • master-lsm-kerndat
  • master-memopt
  • master-merge
  • v2.11
  • v2.11.1
  • v2.12
  • v2.12.1
  • v2.4
  • v2.6
  • v2.7
  • v3.0
  • v3.1
  • v3.2
  • v3.2.1
  • v3.3
  • v3.4
  • v3.5

pending completion
1221

push

travis-ci

xemul
restore: Fix deadlock when helper's child dies

Since commit ced9c529f687 ("restore: fix race with helpers' kids dying
too early"), we block SIGCHLD in helper tasks before CR_STATE_RESTORE.
This way we avoided default criu sighandler as it doesn't expect that
childs may die.

This is very racy as we wait on futex for another stage to be started,
but the next stage may start only when all the tasks complete previous
stage. If some children of helper dies, the helper may already have
blocked SIGCHLD and have started sleeping on the futex. Then the next
stage never comes and no one reads a pending SIGCHLD for helper.

A customer met this situation on the node, where the following
(non-related) problem has occured:
Unable to send a fin packet: libnet_write_raw_ipv6(): -1 bytes written (Network is unreachable)
Then child criu of the helper has exited with error-code and the
lockup has happened.

While we could fix it by aborting futex in the end of
restore_task_with_children() for each (non-root also) tasks,
that would be not completely correct:
1. All futex-waiting tasks will wake up after that and they
   may not expect that some tasks are on the previous stage,
   so they will spam into logs with unrelated errors and may
   also die painfully.
2. Child may die and miss aborting of the futex due to:
   o segfault
   o OOM killer
   o User-sended SIGKILL
   o Other error-path we forgot to cover with abort futex

To fix this deadlock in TASK_HELPER, as suggested-by Kirill,
let's check if there are children deaths expected - if there
isn't any, don't block SIGCHLD, otherwise wait() and check if
death was on expected stage of restore (not CR_STATE_RESTORE).

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>

Conflicts:
	criu/cr-restore.c

17996 of 27404 relevant lines covered (65.67%)

58131.4 hits per line

Relevant lines Covered
Build:
Build:
27404 RELEVANT LINES 17996 COVERED LINES
58131.4 HITS PER LINE
Source Files on master-test
  • List 0
  • Changed 167
  • Source Changed 90
  • Coverage Changed 166
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
1221 master-test restore: Fix deadlock when helper's child dies Since commit ced9c529f687 ("restore: fix race with helpers' kids dying too early"), we block SIGCHLD in helper tasks before CR_STATE_RESTORE. This way we avoided default criu sighandler as it doesn't... push 16 Aug 2017 10:36AM UTC xemul travis-ci pending completion  
844 master-test Fix Fedora build (undo _FORTIFY_SOURCE for pie) Recent Fedora releases add -Wp,-D_FORTIFY_SOURCE=2 to rpm builds, which breaks compiling pie code on some architectures due to its trying to use (absent) memcpy_chk() instead of usual memcpy(). We ... push 17 Feb 2017 10:43AM UTC xemul travis-ci pending completion  
819 master-test xsave: check for X86_FEATURE_OSXSAVE rather than for X86_FEATURE_XSAVE Migrating a process between a system with the 'xsave' CPU flag and another system without the 'xsave' CPU flags is not possible and fails during restore. To avoid this situati... push 07 Feb 2017 04:45PM UTC xemul travis-ci pending completion  
576 master-test mnt: allow external slaves too In particular, if the thing in criu's namespace is also a slave of something in an external mount namespace (as it is in the tests), we won't see the master, just the external slave. However, this also counts as an ... push 13 Oct 2016 12:59PM UTC xemul travis-ci pending completion  
562 master-test mem: Move mem_pp from ctl to pstree_item's dmpi Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> push 05 Oct 2016 10:16AM UTC xemul travis-ci pending completion  
See All Builds (633)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc