fgsect/FitM

criu dump failed

Opened this issue · 1 comments

Hi, I setup a new ubuntu20.04 vm, run commands in misc/provision.sh to prepare the environment.

Then I try the example with make and FITM_ARGS=config/fitm-args.ftp.json make run, but I got criu dump failed error message. The fuzzer stuck at gen1 for about 1min then exit.

Could you please help? Thank you.

cargo build --release
    Finished release [optimized + debuginfo] target(s) in 0.03s
sudo rm -rf ./active-state
sudo rm -rf ./cmin-tmp
sudo -E ./target/release/fitm config/fitm-args.ftp.json
cwd: "/home/qwe/FitM"

    __________________  ___
   / ____/  _/_  __/  |/  /
  / /_   / /  / / / /|_/ / 
 / __/ _/ /  / / / /  / /  
/_/   /___/ /_/ /_/  /_/   


File fitm-state.json not found. Restarting from scratch.
No valid state to resume. Starting fresh :)
==== [*] Time start init_run: 2022-04-15 19:39:09 ====
[*] Init run finished with exit code None
[*] Target was killed by signal. Assuming dump success.
[*] Init run finished with exit code Some(0)
[!] Unexpected exit status '0' from snapshot creation.
thread 'main' panicked at 'Namespace call failed with error Custom { kind: Other, error: "[!] criu dump failed, check active-state dir." }', src/namespacing.rs:135:31
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: fitm::namespacing::NamespaceContext::execute
             at /home/qwe/FitM/src/namespacing.rs:135:31
   3: fitm::FITMSnapshot::init_run
             at /home/qwe/FitM/src/lib.rs:269:28
   4: fitm::run
             at /home/qwe/FitM/src/lib.rs:1351:13
   5: fitm::main
             at /home/qwe/FitM/src/main.rs:88:21
   6: core::ops::function::FnOnce::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[*] Init run finished with exit code None
[*] Target was killed by signal. Assuming dump success.
==== [*] Time end init_run: "2022-04-15 19:39:10" ====
---> Round 1: Fuzzing Gen 1
==== [*] Queue before process_stage contains: [[], ["fitm-gen1-state0"], ["fitm-gen2-state0"], []] ====
==== [*] Time start process_stage gen 1: "2022-04-15 19:39:10" ====
     -> Processing stage with 1 inputs.
==== [*] Time start process_stage loop step fitm-gen1-state0: "2022-04-15 19:39:10" ====
==== [*] Wrote cmin contents from /home/qwe/FitM/cmin-tmp to /home/qwe/FitM/saved-states/fitm-gen1-state0/in ====
==== [*] Start fuzzing fitm-gen1-state0 ("ftp") ====
         Fuzzer Stats:
         - cycles_done       : 1
         - execs_done        : 62990
         - execs_per_sec     : 1049.52
         - paths_total       : 103
         - max_depth         : 2
         - stability         : 100.00%
         - unique_crashes    : 0
         - unique_hangs      : 0
==== [*] Finished fuzzing fitm-gen1-state0 ====
==== [*] Wrote cmin contents from /home/qwe/FitM/cmin-tmp to /home/qwe/FitM/saved-states/fitm-gen1-state0/out/main/queue ====
==== [*] Creating outputs for state: fitm-gen1-state0 ====
==== [*] Using input: "/home/qwe/FitM/saved-states/fitm-gen1-state0/out/main/queue/id:000068,time:0,orig:id:000131,src:000055+000118,time:58311,op:splice,rep:2" ====
thread 'main' panicked at '[!] create_outputs_file(): Snapshot run failed: Os { code: 10, kind: Uncategorized, message: "No child processes" }', src/lib.rs:552:55
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/panicking.rs:143:14
   2: core::result::unwrap_failed
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1749:5
   3: core::result::Result<T,E>::expect
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/result.rs:1022:23
   4: fitm::FITMSnapshot::create_outputs_file::{{closure}}
             at /home/qwe/FitM/src/lib.rs:552:21
   5: fitm::namespacing::NamespaceContext::execute
             at /home/qwe/FitM/src/namespacing.rs:126:27
   6: fitm::FITMSnapshot::create_outputs_file
             at /home/qwe/FitM/src/lib.rs:525:27
   7: fitm::FITMSnapshot::create_outputs
             at /home/qwe/FitM/src/lib.rs:623:13
   8: fitm::process_stage
             at /home/qwe/FitM/src/lib.rs:981:9
   9: fitm::run
             at /home/qwe/FitM/src/lib.rs:1458:30
  10: fitm::main
             at /home/qwe/FitM/src/main.rs:88:21
  11: core::ops::function::FnOnce::call_once
             at /rustc/7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[!] Error during create_outputs execution. Please check latest statefolder for output
make: *** [Makefile:40: run] Error 1

In active-state/snapshot/criu.log, it seems that the snapshot works

...
(00.022122) 0x7f7784ffd000-0x7f7784ffe000 (4K) prot 0x1 flags 0x2 fdflags 0 st 0x41 off 0x2c000 reg fp  shmid: 0x2
(00.022124) 0x7f7784ffe000-0x7f7784fff000 (4K) prot 0x3 flags 0x2 fdflags 0 st 0x41 off 0x2d000 reg fp  shmid: 0x2
(00.022126) 0x7f7784fff000-0x7f7785000000 (4K) prot 0x3 flags 0x22 fdflags 0 st 0x201 off 0 reg ap  shmid: 0
(00.022127) 0x7ffd9d46a000-0x7ffd9d48b000 (132K) prot 0x3 flags 0x122 fdflags 0 st 0x201 off 0 reg ap  shmid: 0
(00.022129) 0x7ffd9d4b7000-0x7ffd9d4bb000 (16K) prot 0x1 flags 0x22 fdflags 0 st 0x1201 off 0 reg vvar ap  shmid: 0
(00.022131) 0x7ffd9d4bb000-0x7ffd9d4bd000 (8K) prot 0x5 flags 0x22 fdflags 0 st 0x209 off 0 reg vdso ap  shmid: 0
(00.022133) 0xffffffffff600000-0xffffffffff601000 (4K) prot 0x4 flags 0x22 fdflags 0 st 0x204 off 0 vsys ap  shmid: 0
(00.022135) Obtaining task auvx ...
(00.022245) Dumping path for -3 fd via self 16 [/home/qwe/FitM/active-state]
(00.022271) Dumping path for -3 fd via self 16 [/]
(00.022276) Dumping task cwd id 0x17 root id 0x18
(00.022373) Dumping file-locks
(00.022379)
(00.022381) Dumping pstree (pid: 20513)
(00.022382) ----------------------------------------
(00.022384) Process: 20513(20513)
(00.022410) ----------------------------------------
(00.022432) cg: All tasks in criu's cgroups. Nothing to dump.
(00.022434) unix: Dumping external sockets
(00.022460) Writing image inventory (version 1)
(00.022508) Running post-dump scripts
(00.022511) Unfreezing tasks into 2
(00.022513)     Unseizing 20513 into 2
(00.023064) Writing stats
(00.023094) Dumping finished successfully