Bug#891363: Diffoscope crashes when cleaning non-writeable temporary files/dirs
michal marzuchowski
michal.marzuchowski at live.com
Sat Feb 24 22:16:06 UTC 2018
Package: diffoscope
Version: 90
When comparing two NixOS iso images (one pulled from website and one I
built myself), diffoscope fails after or during printing results with
(full error included at the bottom):
> PermissionError: [Errno 13] Permission denied: 'curl'
> Unable to delete <TemporaryDirectory '/tmp/tmpun51yx54_diffoscope'>
> Traceback (most recent call last):
> File
> "/nix/store/1ipliryvqaxixffryxw1w7ckqly0sw35-diffoscope-90/lib/python3.6/site-packages/diffoscope/main.py",
> line 412, in main
> sys.exit(run_diffoscope(parsed_args))
> SystemExit: 1
It seems that diffoscope is not able to remove r-xr-xr-x temporary file:
> ~> find /tmp/tmpun51yx54_diffoscope -name curl -exec ls -gGd {} +
> dr-xr-xr-x 2 4096 Jan 1 1970
> /tmp/tmpun51yx54_diffoscope/d1yxmlqavkg9pp02h3b20sn6wbw1ngmd-nixos-17.09.3047.8bce347f02f/nixos/pkgs/tools/networking/curl
> -r-xr-xr-x 1 151168 Jan 1 1970
> /tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl
> lrwxrwxrwx 1 68 Feb 24 22:10
> /tmp/tmpun51yx54_diffoscope/plr0a7lnqmz4v453drw7q1ivrdrcamvj-system-path/bin/curl
> -> /nix/store/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl
The 'curl' seems to be first to be removed:
> ~> rm -r /tmp/tmpun51yx54_diffoscope
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin'?
> y
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin'?
> y
> rm: remove write-protected regular file
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl'?
> y
> rm: cannot remove
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl':
> Permission denied
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/a18nnq9b1vyh9f7f71w5lmip91cqr1px-gdbm-1.13'?
> ^C
Non-writeable files and dirs are quite common for NixOS isos:
> ~> rm -r /tmp/tmpun51yx54_diffoscope
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin'?
> y
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin'?
> y
> rm: remove write-protected regular file
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl'?
> y
> rm: cannot remove
> '/tmp/tmpun51yx54_diffoscope/dmchxbmdbk9616xl98f0a69wb55anmq6-curl-7.58.0-bin/bin/curl':
> Permission denied
> rm: descend into write-protected directory
> '/tmp/tmpun51yx54_diffoscope/a18nnq9b1vyh9f7f71w5lmip91cqr1px-gdbm-1.13'?
> ^C
Full stacktrace:
> Unable to delete <TemporaryDirectory '/tmp/tmprakoxawl_diffoscope'>
> Traceback (most recent call last):
> File
> "/nix/store/1ipliryvqaxixffryxw1w7ckqly0sw35-diffoscope-90/lib/python3.6/site-packages/diffoscope/main.py",
> line 412, in main
> sys.exit(run_diffoscope(parsed_args))
> SystemExit: 1
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File
> "/nix/store/1ipliryvqaxixffryxw1w7ckqly0sw35-diffoscope-90/lib/python3.6/site-packages/diffoscope/tempfiles.py",
> line 62, in clean_all_temp_files
> x.cleanup()
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/tempfile.py",
> line 811, in cleanup
> _shutil.rmtree(self.name)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 480, in rmtree
> _rmtree_safe_fd(fd, path, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 418, in _rmtree_safe_fd
> _rmtree_safe_fd(dirfd, fullname, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 418, in _rmtree_safe_fd
> _rmtree_safe_fd(dirfd, fullname, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 438, in _rmtree_safe_fd
> onerror(os.unlink, fullname, sys.exc_info())
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 436, in _rmtree_safe_fd
> os.unlink(name, dir_fd=topfd)
> PermissionError: [Errno 13] Permission denied: 'curl'
> Unable to delete <TemporaryDirectory '/tmp/tmpun51yx54_diffoscope'>
> Traceback (most recent call last):
> File
> "/nix/store/1ipliryvqaxixffryxw1w7ckqly0sw35-diffoscope-90/lib/python3.6/site-packages/diffoscope/main.py",
> line 412, in main
> sys.exit(run_diffoscope(parsed_args))
> SystemExit: 1
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File
> "/nix/store/1ipliryvqaxixffryxw1w7ckqly0sw35-diffoscope-90/lib/python3.6/site-packages/diffoscope/tempfiles.py",
> line 62, in clean_all_temp_files
> x.cleanup()
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/tempfile.py",
> line 811, in cleanup
> _shutil.rmtree(self.name)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 480, in rmtree
> _rmtree_safe_fd(fd, path, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 418, in _rmtree_safe_fd
> _rmtree_safe_fd(dirfd, fullname, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 418, in _rmtree_safe_fd
> _rmtree_safe_fd(dirfd, fullname, onerror)
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 438, in _rmtree_safe_fd
> onerror(os.unlink, fullname, sys.exc_info())
> File
> "/nix/store/53dyjh7xjhnbibqllr7j27lk2h98n7j7-python3-3.6.4/lib/python3.6/shutil.py",
> line 436, in _rmtree_safe_fd
> os.unlink(name, dir_fd=topfd)
> PermissionError: [Errno 13] Permission denied: 'curl'
More information about the Reproducible-builds
mailing list