That seemed to help but I eventually got another similar crash. FWIW I managed to reduce (guix build graft) to just the code below, and it’s enough to trigger a crash after a dozen of runs: --8<---------------cut here---------------start------------->8--- (define-module (guix build graft) #:use-module (guix build utils) #:use-module (rnrs bytevectors) #:use-module (ice-9 vlist) #:use-module (ice-9 match) #:use-module (ice-9 threads) #:use-module (ice-9 binary-ports) #:use-module (ice-9 iconv) #:use-module (srfi srfi-1) ; list library #:use-module (srfi srfi-26) ; cut and cute #:export (replace-store-references rewrite-directory)) (define (exit-on-exception proc) "Return a procedure that wraps PROC so that 'primitive-exit' is called when an exception is caught." (lambda (arg) (catch #t (lambda () (proc arg)) (const #t) (lambda (key . args) ;; Since ports are not thread-safe as of Guile 2.0, reopen stderr. (let ((port (fdopen 2 "w0"))) (print-exception port #f key args) (display-backtrace (make-stack #t) port) (dynamic-call "abort" (dynamic-link)) (sleep 1000) (primitive-exit 1)))))) (define* (rewrite-directory directory output mapping) (define prefix-len (string-length directory)) (define (destination file) (string-append output (string-drop file prefix-len))) (define (rewrite-leaf file) (let (#;(stat (lstat file)) (dest (destination file))) (catch 'foo (lambda () (throw 'foo (dirname (string-append "/tmp/x" dest)))) (lambda (key file) (call-with-output-string (lambda (output) (make-bytevector (expt 2 10) #x77) (string->bytevector file "UTF-8") (open-input-string file) (make-bytevector (expt 2 20) #x77))))))) (n-par-for-each (pk 'jobs (parallel-job-count)) (exit-on-exception rewrite-leaf) (find-files directory (const #t) #:directories? #t))) ;;; graft.scm ends here --8<---------------cut here---------------end--------------->8--- Thoughts? Whatever ideas you have could be helpful. :-) Cheers, Ludo’.