Projects STRLCPY criu Commits edaec5d7
🤬
  • coredump: report missing files without a backtrace

    New message:
    
     ERROR: Required file /usr/lib64/libcrypto.so.3.0.1 not found.
     Exiting
    
    Old message:
    
       File "/home/criu/coredump/criu_coredump/coredump.py", line 693, in _gen_mem_chunk
         f = open(fname, 'rb')
     FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib64/libcrypto.so.3.0.1'
    
    Signed-off-by: Adrian Reber <[email protected]>
  • Loading...
  • Adrian Reber committed with Andrei Vagin 1 year ago
    edaec5d7
    1 parent 3ca979f9
  • ■ ■ ■ ■ ■
    coredump/coredump.py
    1 1  import argparse
    2 2  import os
     3 +import sys
    3 4   
    4 5  import criu_coredump
    5 6   
    skipped 28 lines
    34 35   
    35 36   opts = vars(parser.parse_args())
    36 37   
    37  - coredump(opts)
     38 + try:
     39 + coredump(opts)
     40 + except SystemExit as error:
     41 + print('ERROR: %s' % error)
     42 + print('Exiting')
     43 + sys.exit(1)
    38 44   
    39 45   
    40 46  if __name__ == '__main__':
    skipped 2 lines
  • ■ ■ ■ ■ ■
    coredump/criu_coredump/coredump.py
    skipped 691 lines
    692 692   files = self.reg_files
    693 693   fname = next(filter(lambda x: x["id"] == shmid, files))["name"]
    694 694   
    695  - f = open(fname, 'rb')
     695 + try:
     696 + f = open(fname, 'rb')
     697 + except FileNotFoundError:
     698 + sys.exit('Required file %s not found.' % fname)
     699 + 
    696 700   f.seek(off)
    697 701   
    698 702   start = vma["start"]
    skipped 149 lines
Please wait...
Page is in error, reload to recover