[CRIU] CRIT can't decode files.img correctly.

Nicolas Viennot Nicolas.Viennot at twosigma.com
Fri Jan 3 18:14:13 MSK 2020


Hello Jun,

I believe fixes of this kind must be applied: https://github.com/checkpoint-restore/criu/commit/f870238fcd547ddd942a4856d235f970ee2a113e
I missed some of the base64.encodebytes() in images.py. It would be great if you could provide a better patch than what I did.

Thanks,
Nico 

---

From: criu-bounces at openvz.org <criu-bounces at openvz.org> On Behalf Of Jun Gan
Sent: Thursday, January 2, 2020 8:28 PM
To: criu at openvz.org
Subject: [CRIU] CRIT can't decode files.img correctly.


I can use criu successfully dump/restore my application. For some reason, I need to change vma&opened files to support restore on another computer.

I can use CIRT decode mm.img but met following error when tried to decode files.img:

# crit-python3 decode -i backup_dir/files.img --pretty
.....................
        {
            "type": "UNIXSK",
            "id": 31,
            "usk": {
                "id": 31,
                "ino": 265331349,
                "type": "STREAM",
                "state": "LISTEN",
                "flags": "0x80002",
                "uflags": "0x0",
                "backlog": 128,
                "peer": 0,
                "fown": {
                    "uid": 0,
                    "euid": 0,
                    "signum": 0,
                    "pid_type": 0,
                    "pid": 0
                },
                "opts": {
                    "so_sndbuf": 212992,
                    "so_rcvbuf": 212992,
                    "so_snd_tmo_sec": 0,
                    "so_snd_tmo_usec": 0,
                    "so_rcv_tmo_sec": 0,
                    "so_rcv_tmo_usec": 0,
                    "reuseaddr": false,
                    "so_priority": 0,
                    "so_rcvlowat": 1,
                    "so_mark": 0,
                    "so_passcred": false,
                    "so_passsec": false,
                    "so_dontroute": false,
                    "so_no_check": false,
                    "so_reuseport": false,
                    "so_broadcast": false
                },
                "name": Traceback (most recent call last):
  File "crit/crit-python3", line 6, in <module>
    cli.main()
  File "crit/pycriu/cli.py", line 410, in main
    opts["func"](opts)
  File "crit/pycriu/cli.py", line 43, in decode
    json.dump(img, f, indent=indent)
  File "/usr/lib64/python3.6/json/__init__.py", line 179, in dump
    for chunk in iterable:
  File "/usr/lib64/python3.6/json/encoder.py", line 430, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib64/python3.6/json/encoder.py", line 404, in _iterencode_dict
    yield from chunks
  File "/usr/lib64/python3.6/json/encoder.py", line 325, in _iterencode_list
    yield from chunks
  File "/usr/lib64/python3.6/json/encoder.py", line 404, in _iterencode_dict
    yield from chunks
  File "/usr/lib64/python3.6/json/encoder.py", line 404, in _iterencode_dict
    yield from chunks
  File "/usr/lib64/python3.6/json/encoder.py", line 437, in _iterencode
    o = _default(o)
  File "/usr/lib64/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'bytes' is not JSON serializable


It looks like something about json format, I'm not familiar with python, can someone help me how to figure out what's wrong here?

I'm using CRIU 3.13 and Python 3.6.8

Thank you very much!!!!

-- 
Jun Gan



More information about the CRIU mailing list