Intermittent segfaults when parsing (?) custom package from repo.

  • Done
  • quality assurance status badge
Details
3 participants
  • elaexuotee
  • Ludovic Courtès
  • Simon Tournier
Owner
unassigned
Submitted by
elaexuotee
Severity
normal
E
L
L
Ludovic Courtès wrote on 17 Jan 2022 16:42
(address . elaexuotee@wilsonb.com)(address . 53296@debbugs.gnu.org)
87pmoqmkrk.fsf@gnu.org
Hi,

elaexuotee@wilsonb.com skribis:

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
/tmp/test
/tmp/test/gnu
/tmp/test/gnu/packages
/tmp/test/gnu/packages/jsoftware.scm

$ 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)
guix 0052c3b
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 0052c3b0458fba32920a1cfb48b8311429f0d6b5

Is there another way to reproduce it?

Is the ‘LD_LIBRARY_PATH’ variable set on your system?

Thanks,
Ludo’.
E
E
elaexuotee wrote on 18 Jan 2022 07:23
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 53296@debbugs.gnu.org)
3GNCGE6R9I4MM.3JY1C8V1IN7CY@wilsonb.com
Good day. Thanks for looking into this.

Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (13 lines)
> Here’s how I tried (and failed) to reproduce the segfault:
>
> --8<---------------cut here---------------start------------->8---
> $ find /tmp/test
> /tmp/test
> /tmp/test/gnu
> /tmp/test/gnu/packages
> /tmp/test/gnu/packages/jsoftware.scm
>
> $ 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

Is that an Esperanto locale?!

Toggle quote (13 lines)
> $ 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)
> guix 0052c3b
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: 0052c3b0458fba32920a1cfb48b8311429f0d6b5
> --8<---------------cut here---------------end--------------->8---
>
> Is there another way to reproduce it?

The segfault is pretty inconsistent on my end. Unfortunately, the only
"reliable" way to produce I know at the moment is to badger the build command
repeatedly and get (un)lucky.

Toggle quote (2 lines)
> Is the ‘LD_LIBRARY_PATH’ variable set on your system?

Good thought. But no; I am seeing the segfaults in a --pure shell.
L
L
Ludovic Courtès wrote on 18 Jan 2022 12:28
(address . elaexuotee@wilsonb.com)(address . 53296@debbugs.gnu.org)
87ee55jn9i.fsf@gnu.org
Hi,

elaexuotee@wilsonb.com skribis:

Toggle quote (16 lines)
> Ludovic Courtès <ludo@gnu.org> wrote:
>> Here’s how I tried (and failed) to reproduce the segfault:
>>
>> --8<---------------cut here---------------start------------->8---
>> $ find /tmp/test
>> /tmp/test
>> /tmp/test/gnu
>> /tmp/test/gnu/packages
>> /tmp/test/gnu/packages/jsoftware.scm
>>
>> $ 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
>
> Is that an Esperanto locale?!

Jes!

Toggle quote (4 lines)
> The segfault is pretty inconsistent on my end. Unfortunately, the only
> "reliable" way to produce I know at the moment is to badger the build command
> repeatedly and get (un)lucky.

OK, please let us know when you have a reliable reproducer, or GDB
backtraces, things like that.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 8 Mar 2022 09:45
control message for bug #53296
(address . control@debbugs.gnu.org)
87sfrs96ji.fsf@gnu.org
tags 53296 + moreinfo
quit
L
L
Ludovic Courtès wrote on 8 Mar 2022 09:46
Re: bug#53296: Intermittent segfaults when parsing (?) custom package from repo.
(address . elaexuotee@wilsonb.com)(address . 53296@debbugs.gnu.org)
87o82g96i7.fsf@gnu.org
Hi,

Any update on this one?


If there’s no reliable way to reproduce it, I’ll close the bug soon.

Thanks,
Ludo’.

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (31 lines)
> Hi,
>
> elaexuotee@wilsonb.com skribis:
>
>> Ludovic Courtès <ludo@gnu.org> wrote:
>>> Here’s how I tried (and failed) to reproduce the segfault:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> $ find /tmp/test
>>> /tmp/test
>>> /tmp/test/gnu
>>> /tmp/test/gnu/packages
>>> /tmp/test/gnu/packages/jsoftware.scm
>>>
>>> $ 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
>>
>> Is that an Esperanto locale?!
>
> Jes!
>
>> The segfault is pretty inconsistent on my end. Unfortunately, the only
>> "reliable" way to produce I know at the moment is to badger the build command
>> repeatedly and get (un)lucky.
>
> OK, please let us know when you have a reliable reproducer, or GDB
> backtraces, things like that.
>
> Thanks,
> Ludo’.
E
E
elaexuotee wrote on 12 Feb 2023 14:07
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 53296@debbugs.gnu.org)
2FC0U30KGWBVR.2IVXS2127QF0U@wilsonb.com
Nothing like ACKing a year later!

This was almost certainly a local hardware issue. The machine this happened on
ended up showing progressively more mysterious behaviour that could not be
reproduced on other machines.

Feel free to close!

Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (44 lines)
> Hi,
>
> Any update on this one?
>
> https://issues.guix.gnu.org/53296
>
> If there’s no reliable way to reproduce it, I’ll close the bug soon.
>
> Thanks,
> Ludo’.
>
> Ludovic Courtès <ludo@gnu.org> skribis:
>
> > Hi,
> >
> > elaexuotee@wilsonb.com skribis:
> >
> >> Ludovic Courtès <ludo@gnu.org> wrote:
> >>> Here’s how I tried (and failed) to reproduce the segfault:
> >>>
> >>> --8<---------------cut here---------------start------------->8---
> >>> $ find /tmp/test
> >>> /tmp/test
> >>> /tmp/test/gnu
> >>> /tmp/test/gnu/packages
> >>> /tmp/test/gnu/packages/jsoftware.scm
> >>>
> >>> $ 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
> >>
> >> Is that an Esperanto locale?!
> >
> > Jes!
> >
> >> The segfault is pretty inconsistent on my end. Unfortunately, the only
> >> "reliable" way to produce I know at the moment is to badger the build command
> >> repeatedly and get (un)lucky.
> >
> > OK, please let us know when you have a reliable reproducer, or GDB
> > backtraces, things like that.
> >
> > Thanks,
> > Ludo’.
S
S
Simon Tournier wrote on 14 Feb 2023 13:04
(address . elaexuotee@wilsonb.com)
878rh01mhn.fsf@gmail.com
Hi,

Toggle quote (8 lines)
>> If there’s no reliable way to reproduce it, I’ll close the bug soon.
>
> This was almost certainly a local hardware issue. The machine this happened on
> ended up showing progressively more mysterious behaviour that could not be
> reproduced on other machines.
>
> Feel free to close!

So closing!

Thanks,
simon
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 53296@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 53296
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch