Toggle quote (13 lines)
> Recently working on a package, I have been encounting intermittent segfault
> during a build.
> The segfault seems to only occur when I have some error in my code that causes
> a crash, and the segfaults tend to cluster, appearing unexpectedly for a few
> build attempts, and then disappearing right as I think they are reproducible
> and try to grab an strace or something. Unfortunately, that's about the extent
> of information I have been able to gleen.
> The latest segfault happened with the attached package definition. Note, the
> offending code is at line 77, where I forgot to remove a docstring from a
> variable that used to be a procedure.
Here’s how I tried (and failed) to reproduce the segfault:
Toggle snippet (21 lines)
$ find /tmp/test
$ guix build -L /tmp/test jsoftware
/tmp/test/gnu/packages/jsoftware.scm:76:0: warning: source expression failed to match any pattern
guix build: error: jsoftware: nekonata pako
$ guix build -f /tmp/test/gnu/packages/jsoftware.scm
/tmp/test/gnu/packages/jsoftware.scm:76:0: error: (define ijconsole "G-exp script that detects AVX/AVX2 support at runtime and executes jconsole\n with the appropriate libj.so and profile.ijs." (with-imported-modules (quote ((guix cpu) (guix memoization) (guix profiling) (guix sets) (srfi srfi-26))) (program-file "ijconsole" (gexp (begin (use-modules ((guix cpu) #:select (cpu-flags current-cpu)) ((guix sets) #:select (set-contains?)) ((srfi srfi-26) #:select (cute))) (define %basedir (dirname (dirname (current-filename)))) (let* ((jconsole (string-append %basedir "/libexec/j/jconsole")) (cpu-has-flag? (cute set-contains? (cpu-flags (current-cpu)) <>)) (libj (format #f "~a/lib/j/libj~a.so" %basedir (cond ((cpu-has-flag? "avx2") "-avx2") ((cpu-has-flag? "avx") "-avx") (else "")))) (jprofile (string-append %basedir "/etc/j/profile.ijs"))) (apply execl jconsole "ijconsole" "-lib" libj "-jprofile" jprofile (cdr (command-line))))))))): source expression failed to match any pattern
$ guix describe
Generacio 201 Jan 12 2022 23:15:13 (nuna)
repository URL: https://git.savannah.gnu.org/git/guix.git
Is there another way to reproduce it?
Is the ‘LD_LIBRARY_PATH’ variable set on your system?