unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* guix pull fails on powerful server
@ 2017-09-22  8:38 Ricardo Wurmus
  2017-09-22 14:10 ` bug#27476: " Ludovic Courtès
  2017-09-25  8:43 ` Clément Lassieur
  0 siblings, 2 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-09-22  8:38 UTC (permalink / raw)
  To: help-guix

Hi there,

I have a big server with 1.5T RAM and 192 CPU cores.  “guix pull”
is very slow and crashes with the error below:

--8<---------------cut here---------------start------------->8---
[root@murphy:~] (1001) $ guix pull
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument

Starting download of /tmp/guix-file.Px0iiK
From https://git.savannah.gnu.org/cgit/guix.git/snapshot/master.tar.gz...
 ....tar.gz                                 3.9MiB/s 00:03 | 13.6MiB transferred
unpacking '/gnu/store/vl04ygdiyqwbs1ms1rrx495g2yn44ipc-guix-latest.tar.gz'...
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivation will be built:
   /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
copying and compiling to '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
loading...       25.4% of 629 filesrandom seed for tests: 1506066913
loading...       99.8% of 629 files
compiling...     69.2% of 629 filesice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (apply set-build-options* #:use-substitutes
ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad ((derivation (origin->derivation (package-source pack
tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs derivation)))))))

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv' failed with exit code 1
guix pull: error: build failed: build of `/gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv' failed
--8<---------------cut here---------------end--------------->8---

Here’s the version of Guix:

--8<---------------cut here---------------start------------->8---
[root@murphy:~] (1003) $ guix --version
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
guix (GNU Guix) 
Copyright (C) 2017 the Guix authors
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
[root@murphy:~] (1004) $ which guix
/root/.guix-profile/bin/guix
[root@murphy:~] (1005) $ readlink -f /root/.guix-profile/bin/guix
/gnu/store/m6nlmnlyr5d8d97k8lgp6ig2r2nxgf3r-guix-0.13.0-5.228a398/bin/guix
--8<---------------cut here---------------end--------------->8---

Is this related to Guile’s memory problems?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-09-22  8:38 guix pull fails on powerful server Ricardo Wurmus
@ 2017-09-22 14:10 ` Ludovic Courtès
  2017-09-25  7:27   ` Andy Wingo
  2017-09-25  8:43 ` Clément Lassieur
  1 sibling, 1 reply; 21+ messages in thread
From: Ludovic Courtès @ 2017-09-22 14:10 UTC (permalink / raw)
  To: Ricardo Wurmus, Andy Wingo; +Cc: help-guix, 27476

Hi Ricardo,

Ricardo Wurmus <rekado@elephly.net> skribis:

> The following derivation will be built:
>    /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
> copying and compiling to '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
> loading...       25.4% of 629 filesrandom seed for tests: 1506066913
> loading...       99.8% of 629 files
> compiling...     69.2% of 629 filesice-9/threads.scm:289:22: In procedure loop:
> ice-9/threads.scm:289:22: Syntax error:
> guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (apply set-build-options* #:use-substitutes
> ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad ((derivation (origin->derivation (package-source pack
> tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs derivation)))))))

This was reported at <https://bugs.gnu.org/27476>, and I suspect a
thread-safety issue.  However, syntax parameters are purely functional
AFAICS, so I fail to see why multithreading could be a problem.

Andy, any idea what could be causing this?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-09-22 14:10 ` bug#27476: " Ludovic Courtès
@ 2017-09-25  7:27   ` Andy Wingo
  2017-09-25 13:03     ` Ludovic Courtès
  0 siblings, 1 reply; 21+ messages in thread
From: Andy Wingo @ 2017-09-25  7:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix, 27476

On Fri 22 Sep 2017 16:10, ludo@gnu.org (Ludovic Courtès) writes:

> Hi Ricardo,
>
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> The following derivation will be built:
>>    /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
>> copying and compiling to '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
>> loading...       25.4% of 629 filesrandom seed for tests: 1506066913
>> loading...       99.8% of 629 files
>> compiling...     69.2% of 629 filesice-9/threads.scm:289:22: In procedure loop:
>> ice-9/threads.scm:289:22: Syntax error:
>> guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (apply set-build-options* #:use-substitutes
>> ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad ((derivation (origin->derivation (package-source pack
>> tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs derivation)))))))
>
> This was reported at <https://bugs.gnu.org/27476>, and I suspect a
> thread-safety issue.  However, syntax parameters are purely functional
> AFAICS, so I fail to see why multithreading could be a problem.
>
> Andy, any idea what could be causing this?

I have heard of but not seen a number of similar bugs: errors that
"can't happen" but which appear under multiple threads.  I don't know
what underlying pattern is.  Has anyone found a test case that reliably
reproduces?

Andy

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-22  8:38 guix pull fails on powerful server Ricardo Wurmus
  2017-09-22 14:10 ` bug#27476: " Ludovic Courtès
@ 2017-09-25  8:43 ` Clément Lassieur
  1 sibling, 0 replies; 21+ messages in thread
From: Clément Lassieur @ 2017-09-25  8:43 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

I got it too for the first time yesterday on my 128G RAM and 32 CPU
cores server:

--8<---------------cut here---------------start------------->8---
substitute: updating list of substitutes from [...]
Updating from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from Git commit 3140844e33254316348135b03762eaeb04764544...
substitute: updating list of substitutes from [...]
The following derivation will be built:
   /gnu/store/7143x1dd2r5kch8dldyylz1ljhp3nird-guix-latest.drv
copying and compiling to '/gnu/store/8a42yc4yxslrr1hf7wk5x5mddbs76yqm-guix-latest' with Guile 2.2.2...
loading...       25.3% of 632 filesrandom seed for tests: 1506279202
loading...       99.8% of 632 files
compiling...     94.8% of 632 filesice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/gexp.scm:530:8: return: return used outside of 'with-monad' in form (return output)

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/7143x1dd2r5kch8dldyylz1ljhp3nird-guix-latest.drv' failed with exit code 1
guix pull: error: build failed: build of `/gnu/store/7143x1dd2r5kch8dldyylz1ljhp3nird-guix-latest.drv' failed
--8<---------------cut here---------------end--------------->8---

And then, today, again:

--8<---------------cut here---------------start------------->8---
substitute: updating list of substitutes from [...]
Updating from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from Git commit 66660960ba75233ae5b6c539f43d97d06d64e9ad...
substitute: updating list of substitutes from [...]
The following derivation will be built:
   /gnu/store/dmv64icdan1fqrl00czgwx1an923fzda-guix-latest.drv
copying and compiling to '/gnu/store/slqcrr5gwhi1zqv21wjp0l973zs3dywc-guix-latest' with Guile 2.2.2...
loading...       25.3% of 632 filesrandom seed for tests: 1506327995
loading...       99.8% of 632 files
compiling...     94.8% of 632 filesice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/gexp.scm:539:10: return: return used outside of 'with-monad' in form (return (derivation->output-path drv))

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/dmv64icdan1fqrl00czgwx1an923fzda-guix-latest.drv' failed with exit code 1
guix pull: error: build failed: build of `/gnu/store/dmv64icdan1fqrl00czgwx1an923fzda-guix-latest.drv' failed
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-25  7:27   ` Andy Wingo
@ 2017-09-25 13:03     ` Ludovic Courtès
  2017-09-25 14:02       ` bug#27476: " Ricardo Wurmus
  0 siblings, 1 reply; 21+ messages in thread
From: Ludovic Courtès @ 2017-09-25 13:03 UTC (permalink / raw)
  To: Andy Wingo; +Cc: help-guix, 27476

Hi,

Andy Wingo <wingo@igalia.com> skribis:

> On Fri 22 Sep 2017 16:10, ludo@gnu.org (Ludovic Courtès) writes:
>
>> Hi Ricardo,
>>
>> Ricardo Wurmus <rekado@elephly.net> skribis:
>>
>>> The following derivation will be built:
>>>    /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
>>> copying and compiling to '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
>>> loading...       25.4% of 629 filesrandom seed for tests: 1506066913
>>> loading...       99.8% of 629 files
>>> compiling...     69.2% of 629 filesice-9/threads.scm:289:22: In procedure loop:
>>> ice-9/threads.scm:289:22: Syntax error:
>>> guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (apply set-build-options* #:use-substitutes
>>> ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad ((derivation (origin->derivation (package-source pack
>>> tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs derivation)))))))
>>
>> This was reported at <https://bugs.gnu.org/27476>, and I suspect a
>> thread-safety issue.  However, syntax parameters are purely functional
>> AFAICS, so I fail to see why multithreading could be a problem.
>>
>> Andy, any idea what could be causing this?
>
> I have heard of but not seen a number of similar bugs: errors that
> "can't happen" but which appear under multiple threads.  I don't know
> what underlying pattern is.  Has anyone found a test case that reliably
> reproduces?

With this program:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 threads)
             (srfi srfi-1))

(define-syntax-parameter foo
  (identifier-syntax +))

(define threads
  (unfold (lambda (x) (> x 100))
          (lambda (x)
            (call-with-new-thread
             (lambda ()
               (while #t
                 (macroexpand
                  '(syntax-parameterize ((foo (identifier-syntax -)))
                     (foo y z)))))))
          1+
          0))

(for-each join-thread threads)
--8<---------------cut here---------------end--------------->8---

I managed to get a segfault:

--8<---------------cut here---------------start------------->8---
$ guile syntax-parms.scm
;;; note: source file /home/ludo/src/guix/syntax-parms.scm
;;;       newer than compiled /home/ludo/.cache/guile/ccache/2.2-LE-8-3.A/home/ludo/src/guix/syntax-parms.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/ludo/src/guix/syntax-parms.scm
;;; compiled /home/ludo/.cache/guile/ccache/2.2-LE-8-3.A/home/ludo/src/guix/syntax-parms.scm.go
In /home/ludo/src/guix/syntax-parms.scm:
    13:17 13 (_)
In ice-9/psyntax.scm:
  1233:22 12 (expand-top-sequence (#(ribcage #(x) #((m-1dff1b83541ce327-7f97c #)) #) # …) …)
In ice-9/boot-9.scm:
   230:17 11 (map1 (#<tree-il (lambda-case (((id) #f #f #f () (id-1dff1b83541ce327-7fb4…>))
In ice-9/psyntax.scm:
  2053:19 10 (_ _ #() (foo y z) ())
In ice-9/boot-9.scm:
   230:17  9 (map1 #())
In ice-9/psyntax.scm:
  1408:12  8 (_ _)
  1788:11  7 (lp (1) (11 0 . 0))
  1678:45  6 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17  5 (map1 ((tmp-1dff1b83541ce327-7f98b 0 . 0)))
In ice-9/psyntax.scm:
  2701:67  4 Adres-eraro
--8<---------------cut here---------------end--------------->8---

… but then I failed to reproduce it again (that was on my 4-thread
laptop).

Ludo’.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-09-25 13:03     ` Ludovic Courtès
@ 2017-09-25 14:02       ` Ricardo Wurmus
  2017-09-30  7:59         ` Ricardo Wurmus
  0 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2017-09-25 14:02 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


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

> With this program:
>
> --8<---------------cut here---------------start------------->8---
> (use-modules (ice-9 threads)
>              (srfi srfi-1))
>
> (define-syntax-parameter foo
>   (identifier-syntax +))
>
> (define threads
>   (unfold (lambda (x) (> x 100))
>           (lambda (x)
>             (call-with-new-thread
>              (lambda ()
>                (while #t
>                  (macroexpand
>                   '(syntax-parameterize ((foo (identifier-syntax -)))
>                      (foo y z)))))))
>           1+
>           0))
>
> (for-each join-thread threads)
> --8<---------------cut here---------------end--------------->8---

I have tried this programme on my 16 core 32G workstation, and on the
192 core 1.5T server, but could not get it to segfault.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-25 14:02       ` bug#27476: " Ricardo Wurmus
@ 2017-09-30  7:59         ` Ricardo Wurmus
  2017-10-03 20:29           ` Marius Bakke
                             ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-09-30  7:59 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


I’ve tried “guix pull” on the same server again, this time limiting CPUs
with “taskset -c 0 guix pull”:

--8<---------------cut here---------------start------------->8---
$ taskset -c 0 guix pull
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument

Starting download of /tmp/guix-file.QleIQR
From https://git.savannah.gnu.org/cgit/guix.git/snapshot/master.tar.gz...
 ....tar.gz                                 1.6MiB/s 00:09 | 13.6MiB transferred
unpacking '/gnu/store/g5246hzsj9vv1fmigdd7fh0060fybnbd-guix-latest.tar.gz'...
The following derivation will be built:
   /gnu/store/z5bhk17nxmdhvj0g4cy038p25mzh1gys-guix-latest.drv
copying and compiling to '/gnu/store/s3s7xlqa10mvf8v0ypxz8gzw3lcf1x5z-guix-latest' with Guile 2.2.2...
loading...       25.7% of 635 filesrandom seed for tests: 1506720257
loading...       99.8% of 635 files
compiling...     69.1% of 635 filesice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/scripts/graph.scm:103:10: return: return used outside of 'with-monad' in form (return (package-node-edges a))

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/z5bhk17nxmdhvj0g4cy038p25mzh1gys-guix-latest.drv' failed with exit code 1
guix pull: error: build failed: build of `/gnu/store/z5bhk17nxmdhvj0g4cy038p25mzh1gys-guix-latest.drv' failed
--8<---------------cut here---------------end--------------->8---

After limiting memory with “ulimit -Sv 5000000”:

--8<---------------cut here---------------start------------->8---
ice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/scripts/pull.scm:192:8: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (indirect-root-added latest) (lambda (done) (mlet* %store-monad () (if (and (file-exists? latest) (string=? (readlink latest) source-dir)) (begin (display (G_ "Guix already up to date\n")) (return #t)) (begin (switch-symlinks latest source-dir) (format #t (G_ "updated ~a successfully deployed under `~a'~%") %guix-package-name latest) (return #t))))))

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/afji58647yzz7cr9dvlj87sd3ad36lbk-guix-latest.drv' failed with exit code 1
guix pull: error: build failed: build of `/gnu/store/afji58647yzz7cr9dvlj87sd3ad36lbk-guix-latest.drv' failed
--8<---------------cut here---------------end--------------->8---

It always crashes at around 69%.

Is there another work-around I could try on this machine?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-30  7:59         ` Ricardo Wurmus
@ 2017-10-03 20:29           ` Marius Bakke
  2017-10-04 13:15             ` Ricardo Wurmus
  2017-10-04 15:09           ` Clément Lassieur
                             ` (3 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Marius Bakke @ 2017-10-03 20:29 UTC (permalink / raw)
  To: Ricardo Wurmus, Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476

[-- Attachment #1: Type: text/plain, Size: 199 bytes --]

Ricardo Wurmus <rekado@elephly.net> writes:

> Is there another work-around I could try on this machine?

Using Guile 2.0 worked for me:

guix package -r guix guile-git -i guile2.0-guix guile2.0-git

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-10-03 20:29           ` Marius Bakke
@ 2017-10-04 13:15             ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-04 13:15 UTC (permalink / raw)
  To: Marius Bakke; +Cc: Andy Wingo, help-guix, 27476


Marius Bakke <mbakke@fastmail.com> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Is there another work-around I could try on this machine?
>
> Using Guile 2.0 worked for me:
>
> guix package -r guix guile-git -i guile2.0-guix guile2.0-git

Unfortunately, this didn’t work for me.  I tried this:

   guix package -i guile2.0-guix --with-source=/path/to/guix/checkout

This printed a lot of repetitions of “warning: unknown warning type
`macro-use-before-definition'” and eventually failed with this
backtrace:

--8<---------------cut here---------------start------------->8---
Backtrace:
In ice-9/boot-9.scm:
 160: 9 [catch #t #<catch-closure 8c6c00> ...]
In unknown file:
   ?: 8 [apply-smob/1 #<catch-closure 8c6c00>]
In ice-9/boot-9.scm:
  66: 7 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 6 [eval # #]
In ice-9/boot-9.scm:
2412: 5 [save-module-excursion #<procedure 9057c0 at ice-9/boot-9.scm:4084:3 ()>]
4091: 4 [#<procedure 9057c0 at ice-9/boot-9.scm:4084:3 ()>]
1734: 3 [%start-stack load-stack #<procedure 916b60 at ice-9/boot-9.scm:4080:10 ()>]
1739: 2 [#<procedure 9176c0 ()>]
In unknown file:
   ?: 1 [primitive-load "/tmp/guix-build-guile2.0-guix-0.13.0-4.f1ddfe4.drv-0/source/./build-aux/compile-all.scm"]
In ice-9/threads.scm:
  99: 0 [loop (("guix/base16.scm" "guix/base32.scm" "guix/base64.scm" ...))]

ice-9/threads.scm:99:22: In procedure loop:
ice-9/threads.scm:99:22: In procedure fport_write: Bad address
make[2]: *** [Makefile:5252: make-go] Error 1
make[2]: Leaving directory '/tmp/guix-build-guile2.0-guix-0.13.0-4.f1ddfe4.drv-0/source'
make[1]: *** [Makefile:4383: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-guile2.0-guix-0.13.0-4.f1ddfe4.drv-0/source'
make: *** [Makefile:2973: all] Error 2
phase `build' failed after 149.5 seconds
builder for `/gnu/store/aqz4d2bbihvdmxqb6rlb71c853jb4dp3-guile2.0-guix-0.13.0-4.f1ddfe4.drv' failed with exit code 1
guix package: error: build failed: build of `/gnu/store/aqz4d2bbihvdmxqb6rlb71c853jb4dp3-guile2.0-guix-0.13.0-4.f1ddfe4.drv
--8<---------------cut here---------------end--------------->8---

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-30  7:59         ` Ricardo Wurmus
  2017-10-03 20:29           ` Marius Bakke
@ 2017-10-04 15:09           ` Clément Lassieur
  2017-10-04 16:17             ` bug#27476: " Ricardo Wurmus
  2017-10-07 15:11           ` Ludovic Courtès
                             ` (2 subsequent siblings)
  4 siblings, 1 reply; 21+ messages in thread
From: Clément Lassieur @ 2017-10-04 15:09 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

Ricardo Wurmus <rekado@elephly.net> writes:

> Is there another work-around I could try on this machine?

My workaround was to build Guix from sources.  But I'm sure you thought
about it.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-10-04 15:09           ` Clément Lassieur
@ 2017-10-04 16:17             ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-04 16:17 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: Andy Wingo, help-guix, 27476


Clément Lassieur <clement@lassieur.org> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Is there another work-around I could try on this machine?
>
> My workaround was to build Guix from sources.  But I'm sure you thought
> about it.

Yes, that works, but I was looking for something that a user can do who
wouldn’t like to fiddle with git.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-09-30  7:59         ` Ricardo Wurmus
  2017-10-03 20:29           ` Marius Bakke
  2017-10-04 15:09           ` Clément Lassieur
@ 2017-10-07 15:11           ` Ludovic Courtès
  2017-10-10  7:17             ` Ricardo Wurmus
  2017-10-12 13:37           ` bug#27476: " Ludovic Courtès
  2017-11-07 10:57           ` Ludovic Courtès
  4 siblings, 1 reply; 21+ messages in thread
From: Ludovic Courtès @ 2017-10-07 15:11 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

Ricardo Wurmus <rekado@elephly.net> skribis:

> I’ve tried “guix pull” on the same server again, this time limiting CPUs
> with “taskset -c 0 guix pull”:

As a stopgap, commit aba219af0fed6a349af930f19c913fb87e6a69dd ensures
that ‘--cores’ is honored.  So if you run “guix pull --cores=1”, it will
build things sequentially.

Now, to take advantage of that, you first need to update to the current
Guix…

Ludo’.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-10-07 15:11           ` Ludovic Courtès
@ 2017-10-10  7:17             ` Ricardo Wurmus
  2017-10-10 11:32               ` Ludovic Courtès
  0 siblings, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-10  7:17 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


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

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> I’ve tried “guix pull” on the same server again, this time limiting CPUs
>> with “taskset -c 0 guix pull”:
>
> As a stopgap, commit aba219af0fed6a349af930f19c913fb87e6a69dd ensures
> that ‘--cores’ is honored.  So if you run “guix pull --cores=1”, it will
> build things sequentially.
>
> Now, to take advantage of that, you first need to update to the current
> Guix…

Thank you, this worked!

On that server I built Guix from source and then let the users pull with
“--cores=1” to update their own Guix.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: guix pull fails on powerful server
  2017-10-10  7:17             ` Ricardo Wurmus
@ 2017-10-10 11:32               ` Ludovic Courtès
  0 siblings, 0 replies; 21+ messages in thread
From: Ludovic Courtès @ 2017-10-10 11:32 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

Ricardo Wurmus <rekado@elephly.net> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> skribis:
>>
>>> I’ve tried “guix pull” on the same server again, this time limiting CPUs
>>> with “taskset -c 0 guix pull”:
>>
>> As a stopgap, commit aba219af0fed6a349af930f19c913fb87e6a69dd ensures
>> that ‘--cores’ is honored.  So if you run “guix pull --cores=1”, it will
>> build things sequentially.
>>
>> Now, to take advantage of that, you first need to update to the current
>> Guix…
>
> Thank you, this worked!
>
> On that server I built Guix from source and then let the users pull with
> “--cores=1” to update their own Guix.

You could also run guix-daemon with --cores=4 or similar, so that it
uses 4 cores by default (few package builds scale beyond that anyway),
and then maybe --max-jobs=4 so you don’t waste the other cores.  ;-)

Ludo’.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: bug#27476: guix pull fails on powerful server
  2017-09-30  7:59         ` Ricardo Wurmus
                             ` (2 preceding siblings ...)
  2017-10-07 15:11           ` Ludovic Courtès
@ 2017-10-12 13:37           ` Ludovic Courtès
  2017-10-13 20:29             ` Ricardo Wurmus
  2017-10-13 21:04             ` Ricardo Wurmus
  2017-11-07 10:57           ` Ludovic Courtès
  4 siblings, 2 replies; 21+ messages in thread
From: Ludovic Courtès @ 2017-10-12 13:37 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]

Hi!

Ricardo Wurmus <rekado@elephly.net> skribis:

> The following derivation will be built:
>    /gnu/store/z5bhk17nxmdhvj0g4cy038p25mzh1gys-guix-latest.drv
> copying and compiling to '/gnu/store/s3s7xlqa10mvf8v0ypxz8gzw3lcf1x5z-guix-latest' with Guile 2.2.2...
> loading...       25.7% of 635 filesrandom seed for tests: 1506720257
> loading...       99.8% of 635 files
> compiling...     69.1% of 635 filesice-9/threads.scm:289:22: In procedure loop:
> ice-9/threads.scm:289:22: Syntax error:
> guix/scripts/graph.scm:103:10: return: return used outside of 'with-monad' in form (return (package-node-edges a))

The program below crashes with completely surreal backtraces in less
than a minute on my 4-thread laptop:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 threads)
             (srfi srfi-1)
             (guix monads)
             (guix store))

(define threads
  (unfold (lambda (x) (> x 100))
          (lambda (x)
            (call-with-new-thread
             (lambda ()
               (define monad
                 (symbol-append 'foo-monad
                                (string->symbol (number->string x))))

               (while #t
                 (macroexpand
                  `(begin
                     (define-monad ,monad
                       (bind +)
                       (return -))
                     (with-monad ,monad
                       (return 3))
                     (mapm ,monad + '(1 2 3))))))))
          1+
          0))

(for-each join-thread threads)
--8<---------------cut here---------------end--------------->8---

Can you check if that also happens on your many-core machine?

The patch below seems to fix the problem: (guix monads) has shared state
(hash tables) used both at expansion-time and run-time, and it wasn’t
protected.

My hypothesis is that this was causing random memory corruption.  The
weird thing, though, is that the errors we were getting were not so
random.  Also, the load phase of ‘guix pull’ is sequential.

Could you test it and report back?

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2527 bytes --]

diff --git a/guix/monads.scm b/guix/monads.scm
index 6ae616aca..c9c5da3bb 100644
--- a/guix/monads.scm
+++ b/guix/monads.scm
@@ -20,6 +20,7 @@
   #:use-module ((system syntax)
                 #:select (syntax-local-binding))
   #:use-module (ice-9 match)
+  #:use-module (ice-9 threads)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-26)
@@ -117,6 +118,7 @@
   ;; the syntax object of the parameter over which it is templated, and (2)
   ;; the syntax of its body.
   (define-once %templates (make-hash-table))
+  (define-once %template-lock (make-mutex))
 
   (define (register-template! name param body)
     (hash-set! %templates name (cons param body)))
@@ -139,8 +141,9 @@ template instances."
       (syntax-source s))
 
     (define current-info-port
-      ;; Port for debugging info.
-      (const (%make-void-port "w")))
+      ;; Port for debugging info.  Return a fresh port at each call to make
+      ;; sure we're thread-safe.
+      (lambda () (%make-void-port "w")))
 
     (define location-string
       (format #f "~a:~a:~a"
@@ -204,12 +207,14 @@ template instances."
        ;; Search for an instance of template NAME for this ACTUAL parameter.
        ;; On success, expand to the identifier of the instance; otherwise
        ;; expand to #f.
-       (any (matching-instance? #'name #'actual) %template-instances))
+       (with-mutex %template-lock
+         (any (matching-instance? #'name #'actual) %template-instances)))
       ((_ exists? name actual)
        ;; Likewise, but return a Boolean.
        (let ((result (->bool
-                      (any (matching-instance? #'name #'actual)
-                           %template-instances))))
+                      (with-mutex %template-lock
+                        (any (matching-instance? #'name #'actual)
+                             %template-instances)))))
          (unless result
            (format (current-warning-port)
                    "~a: warning: no specialization of template '~a' for '~a'~%"
@@ -220,8 +225,9 @@ template instances."
        ;; Expand to the definitions of all the existing templates
        ;; specialized for ACTUAL.
        #`(begin
-           #,@(hash-map->list (cut instance-definition <> <> #'actual)
-                              %templates))))))
+           #,@(with-mutex %template-lock
+                (hash-map->list (cut instance-definition <> <> #'actual)
+                                %templates)))))))
 
 (define-syntax define-template
   (lambda (s)

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: bug#27476: guix pull fails on powerful server
  2017-10-12 13:37           ` bug#27476: " Ludovic Courtès
@ 2017-10-13 20:29             ` Ricardo Wurmus
  2017-10-13 21:04             ` Ricardo Wurmus
  1 sibling, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-13 20:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


Hi Ludo,

> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> The following derivation will be built:
>>    /gnu/store/z5bhk17nxmdhvj0g4cy038p25mzh1gys-guix-latest.drv
>> copying and compiling to '/gnu/store/s3s7xlqa10mvf8v0ypxz8gzw3lcf1x5z-guix-latest' with Guile 2.2.2...
>> loading...       25.7% of 635 filesrandom seed for tests: 1506720257
>> loading...       99.8% of 635 files
>> compiling...     69.1% of 635 filesice-9/threads.scm:289:22: In procedure loop:
>> ice-9/threads.scm:289:22: Syntax error:
>> guix/scripts/graph.scm:103:10: return: return used outside of 'with-monad' in form (return (package-node-edges a))
>
> The program below crashes with completely surreal backtraces in less
> than a minute on my 4-thread laptop:
>
> --8<---------------cut here---------------start------------->8---
> (use-modules (ice-9 threads)
>              (srfi srfi-1)
>              (guix monads)
>              (guix store))
>
> (define threads
>   (unfold (lambda (x) (> x 100))
>           (lambda (x)
>             (call-with-new-thread
>              (lambda ()
>                (define monad
>                  (symbol-append 'foo-monad
>                                 (string->symbol (number->string x))))
>
>                (while #t
>                  (macroexpand
>                   `(begin
>                      (define-monad ,monad
>                        (bind +)
>                        (return -))
>                      (with-monad ,monad
>                        (return 3))
>                      (mapm ,monad + '(1 2 3))))))))
>           1+
>           0))
>
> (for-each join-thread threads)
> --8<---------------cut here---------------end--------------->8---
>
> Can you check if that also happens on your many-core machine?

It does not crash.  I left it running for more than an hour (without
compiling) and it printed things like this:

--8<---------------cut here---------------start------------->8---
…
GC Warning: Repeated allocation of very large block (appr. size 57528320):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 57528320):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 57528320):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 57528320):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 14385152):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 14385152):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 57528320):
        May lead to memory leak and poor performance
GC Warning: Repeated allocation of very large block (appr. size 28766208):
        May lead to memory leak and poor performance
…
--8<---------------cut here---------------end--------------->8---

That’s on the machine with 1.5T RAM and 192 cores.  Then I ran it again
for 10 minutes after compiling it.  It did not crash.

> The patch below seems to fix the problem: (guix monads) has shared state
> (hash tables) used both at expansion-time and run-time, and it wasn’t
> protected.
>
> My hypothesis is that this was causing random memory corruption.  The
> weird thing, though, is that the errors we were getting were not so
> random.  Also, the load phase of ‘guix pull’ is sequential.
>
> Could you test it and report back?

I’m trying the patch right now with “guix pull”.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-10-12 13:37           ` bug#27476: " Ludovic Courtès
  2017-10-13 20:29             ` Ricardo Wurmus
@ 2017-10-13 21:04             ` Ricardo Wurmus
  2017-10-13 21:10               ` Ricardo Wurmus
  1 sibling, 1 reply; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-13 21:04 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


Hi Ludo,

> The patch below seems to fix the problem: (guix monads) has shared state
> (hash tables) used both at expansion-time and run-time, and it wasn’t
> protected.
>
> My hypothesis is that this was causing random memory corruption.  The
> weird thing, though, is that the errors we were getting were not so
> random.  Also, the load phase of ‘guix pull’ is sequential.
>
> Could you test it and report back?

This doesn’t seem to be enough to fix the problem.  I patched ~/guix and
ran “guix pull --url=$PWD” from ~/guix:

--8<---------------cut here---------------start------------->8---
[rwurmus@murphy:~/guix] (335) $ time ./pre-inst-env guix pull --url=$PWD
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
Updating from Git repository at '/home/rwurmus/guix'...
Building from Git commit d24c69d86670bfad0c6bb147162c918e9fcdccc2...
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument
guix pull: warning: failed to load '(bimsb packages bioinformatics-nonfree)':
ERROR: no code for module (gnu packages zip)
guix pull: warning: failed to load '(bimsb packages staging)':
ERROR: no code for module (gnu packages zip)
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivation will be built:
   /gnu/store/y54b92jj44li36743fgxzy0iagi6gb9n-guix-latest.drv
copying and compiling to '/gnu/store/p5zlw7fas26bickkqz4d68g8bxnjr14z-guix-latest' with Guile 2.2.2...
loading...       25.8% of 640 filesrandom seed for tests: 1507927861
loading...       99.8% of 640 files
compiling...     18.6% of 640 filesIn thread:
ERROR: In procedure return: return used outside of 'with-monad'Error while printing exception.
compiling...     70.0% of 640 files
--8<---------------cut here---------------end--------------->8---

The higher the percentage of completion, the slower this all gets.  It
hasn’t actually finished yet, even though it has been running for over
13 minutes.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-10-13 21:04             ` Ricardo Wurmus
@ 2017-10-13 21:10               ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2017-10-13 21:10 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


I tried it again after unsetting GUIX_PACKAGE_PATH, but the results are
just as bad:

--8<---------------cut here---------------start------------->8---
[rwurmus@murphy:~/guix] (338) $ unset GUIX_PACKAGE_PATH
[rwurmus@murphy:~/guix] (339) $ time ./pre-inst-env guix pull --url=$PWD
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
Updating from Git repository at '/home/rwurmus/guix'...
Building from Git commit d24c69d86670bfad0c6bb147162c918e9fcdccc2...
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivation will be built:
   /gnu/store/q5sh4c1mfk396kixqdq8j0wdfwin4dsx-guix-latest.drv
copying and compiling to '/gnu/store/jzq053lg77shnysmhj4i2f2bngz2rr5b-guix-latest' with Guile 2.2.2...
loading...       25.8% of 640 filesrandom seed for tests: 1507928738
loading...       99.8% of 640 files
compiling...     14.4% of 640 filesIn thread:
ERROR: In procedure >>=: >>= (bind) used outside of 'with-monad'Error while printing exception.
compiling...     14.5% of 640 filesIn thread:
ERROR: In procedure return: return used outside of 'with-monad'Error while printing exception.
compiling...     17.3% of 640 filesIn thread:
ERROR: In procedure return: return used outside of 'with-monad'Error while printing exception.
compiling...     70.0% of 640 filesGC Warning: Repeated allocation of very large block (appr. size 28766208):
        May lead to memory leak and poor performance
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: bug#27476: guix pull fails on powerful server
  2017-09-30  7:59         ` Ricardo Wurmus
                             ` (3 preceding siblings ...)
  2017-10-12 13:37           ` bug#27476: " Ludovic Courtès
@ 2017-11-07 10:57           ` Ludovic Courtès
  2018-04-30 21:19             ` Ludovic Courtès
  4 siblings, 1 reply; 21+ messages in thread
From: Ludovic Courtès @ 2017-11-07 10:57 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

Hi,

Ricardo Wurmus <rekado@elephly.net> skribis:

> After limiting memory with “ulimit -Sv 5000000”:
>
> ice-9/threads.scm:289:22: In procedure loop:
> ice-9/threads.scm:289:22: Syntax error:
> guix/scripts/pull.scm:192:8: >>=: >>= (bind) used outside of 'with-monad' in form (>>= (indirect-root-added latest) (lambda (done) (mlet* %store-monad () (if (and (file-exists? latest) (string=? (readlink latest) source-dir)) (begin (display (G_ "Guix already up to date\n")) (return #t)) (begin (switch-symlinks latest source-dir) (format #t (G_ "updated ~a successfully deployed under `~a'~%") %guix-package-name latest) (return #t))))))
>
> Some deprecated features have been used.  Set the environment
> variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
> program to get more information.  Set it to "no" to suppress
> this message.
> builder for `/gnu/store/afji58647yzz7cr9dvlj87sd3ad36lbk-guix-latest.drv' failed with exit code 1
> guix pull: error: build failed: build of `/gnu/store/afji58647yzz7cr9dvlj87sd3ad36lbk-guix-latest.drv' failed
>
> It always crashes at around 69%.

This gave me an idea.  With this program:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 threads)
             (srfi srfi-1)
             (guix monads)
             (guix store)
             (system base compile))

(compile #f)                                      ;load modules

(define threads
  (unfold (lambda (x) (> x 100))
          (lambda (x)
            (call-with-new-thread
             (lambda ()
               (while #t
                 (compile
                  '(begin
                     (with-monad %store-monad
                       (>>= foo bar
                            (return 3)))
                     (mlet %store-monad ((x y))
                       (mbegin %store-monad
                         (return x)
                         (return y))))
                  #:env (current-module)
                  #:from 'scheme
                  #:to 'tree-il)))))
          1+
          0))

(for-each join-thread threads)
--8<---------------cut here---------------end--------------->8---

I can reproduce the error:

--8<---------------cut here---------------start------------->8---
$ ulimit -Sv 2000000
$ guile syntax-parms.scm
In ice-9/psyntax.scm:
  1678:45 19 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17 18 (map1 (((("placeholder" placeholder) ((#<procedure 7fe06eb84230 at guix/monads.scm:283…>) . #) …) …)))
In ice-9/psyntax.scm:
  1483:23 17 (_ _ _)
In ice-9/boot-9.scm:
   230:29 16 (map1 (#<syntax y> #<syntax (#<syntax lambda> (#<syntax t-1dff1b83541ce327-679d05c>) (#<syntax ml…>))
   230:17 15 (map1 (#<syntax (#<syntax lambda> (#<syntax t-1dff1b83541ce327-679d05c>) (#<syntax mlet*> #<syntax…>))
In ice-9/psyntax.scm:
  1788:11 14 (lp ((#<syntax mlet*> #<syntax %store-monad> () #<syntax (#<syntax let> ((#<syntax x> #<syntax …>)) #)
  1678:45 13 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17 12 (map1 (((("placeholder" placeholder) ("l-1dff1b83541ce327-67a3671" lexical . #) ("placeho…" …) …) …)))
In ice-9/psyntax.scm:
  1678:45 11 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17 10 (map1 (((("placeholder" placeholder) ((#<procedure 7fe06eb84230 at guix/monads.scm:2…>) . #) …) . #)))
In ice-9/psyntax.scm:
  2337:44  9 (expand-let _ _ _ #f (hygiene guile-user) #<procedure build-let (src ids vars val-exps body-exp)> _ …)
  1678:45  8 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17  7 (map1 (((("placeholder" placeholder) ("l-1dff1b83541ce327-67a37b2" lexical . #) ("placeho…" …) …) …)))
In ice-9/psyntax.scm:
  1678:45  6 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   230:17  5 (map1 (((("placeholder" placeholder) ((#<procedure 7fe06eb84230 at guix/monads.scm:283…>) . #) …) …)))
In ice-9/psyntax.scm:
  1483:23  4 (_ _ _)
In ice-9/boot-9.scm:
   230:17  3 (map1 (#<syntax (return x)> #<syntax (#<syntax lambda> (#<syntax unused-value>) (#<syntax mbegin>…>))
In ice-9/psyntax.scm:
  1406:23  2 (_ _)
  1347:32  1 (syntax-type ((#<syntax %store-monad> #<syntax %return>)) (("placeholder" placeholder) ((#) . #) …) …)
  1558:32  0 (expand-macro #<procedure 7fe06eb87198 at guix/monads.scm:538:0 (x)> _ _ _ _ _ _)
ice-9/psyntax.scm:1558:32: In procedure expand-macro:
ice-9/psyntax.scm:1558:32: Syntax error:
unknown location: state-return: Wrong number of arguments in form ((%store-monad %return))
In syntax-parms.scm:
    15:17  9 (_)
In system/base/compile.scm:
    255:6  8 (compile _ #:from _ #:to _ #:env _ #:opts _)
   183:32  7 (compile-fold (#<procedure compile-tree-il (x e opts)>) (begin (with-monad %store-monad (>>= …)) #) …)
In ice-9/boot-9.scm:
   2316:4  6 (save-module-excursion #<procedure 30a63560 at language/scheme/compile-tree-il.scm:29:3 ()>)
In language/scheme/compile-tree-il.scm:
    31:15  5 (_)
In ice-9/psyntax.scm:
  1233:22  4 (expand-top-sequence ((begin (with-monad %store-monad (>>= foo bar (return 3))) (mlet # ((…)) #))) _ …)
In ice-9/boot-9.scm:
   230:17  3 (map1 (#<procedure 2b188c00 at ice-9/psyntax.scm:1231:24 ()> #<procedure 2b188a80 at ice-9/psynta…>))
In ice-9/psyntax.scm:
  1611:33  2 (parse (((("placeholder" placeholder) ((#<procedure 7fe06eb84230 at guix/monads.scm…>) . #) …) . #)) …)
  1347:32  1 (syntax-type (>>= foo bar (return 3)) (("placeholder" placeholder) ((#<procedure 7fe06eb8…>) . #) …) …)
  1558:32  0 (expand-macro #<procedure 30a63200 at ice-9/eval.scm:333:13 (a)> _ _ _ _ _ _)
ice-9/psyntax.scm:1558:32: In procedure expand-macro:
ice-9/psyntax.scm:1558:32: Syntax error:
unknown location: source expression failed to match any pattern
GC Warning: Failed to expand heap by 28770304 bytes
GC Warning: Failed to expand heap by 28770304 bytes
GC Warning: Failed to expand heap by 14385152 bytes
GC Warning: Out of Memory! Heap size: 919 MiB. Returning NULL!
Warning: Unwind-only `out-of-memory' exception; skipping pre-unwind handler.
--8<---------------cut here---------------end--------------->8---

So it looks like Guile failing badly in ENOMEM conditions.

I can’t reproduce this with current Guile ‘stable-2.2’, following Andy’s
weak-table rewrite¹, so this might have been a weak-table bug showing up
under memory pressure.

With ‘guix pull’ this was more likely to happen on your many-core server
than on my laptop because you have more threads and thus much higher
memory usage.

Ludo’.

¹ https://lists.gnu.org/archive/html/guile-devel/2017-10/msg00051.html
  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=a053c0510c4a644f9453166b7b385cf30f6d3a21

^ permalink raw reply	[flat|nested] 21+ messages in thread

* bug#27476: guix pull fails on powerful server
  2017-11-07 10:57           ` Ludovic Courtès
@ 2018-04-30 21:19             ` Ludovic Courtès
  2019-01-29 10:07               ` Ricardo Wurmus
  0 siblings, 1 reply; 21+ messages in thread
From: Ludovic Courtès @ 2018-04-30 21:19 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Andy Wingo, help-guix, 27476

ludo@gnu.org (Ludovic Courtès) skribis:

> I can’t reproduce this with current Guile ‘stable-2.2’, following Andy’s
> weak-table rewrite¹, so this might have been a weak-table bug showing up
> under memory pressure.

With Guile 2.2.3 a similar program triggers a crash very quickly:

--8<---------------cut here---------------start------------->8---
$ cat ../guile-debugging/syntax-parms.scm 
(use-modules (ice-9 threads)
             (srfi srfi-1)
             (guix monads)
             (guix store)
             (system base compile))

(compile #f)                                      ;load modules

(define threads
  (unfold (lambda (x) (> x 100))
          (lambda (x)
            (call-with-new-thread
             (lambda ()
               (while #t
                 (compile
                  '(mlet %store-monad ((x y))
                     (mbegin %store-monad
                       (return x)
                       (return y)))
                  #:env (current-module)
                  #:from 'scheme
                  #:to 'tree-il)))))
          1+
          0))

(for-each join-thread threads)
$ guile --version
guile (GNU Guile) 2.2.3
Copyright (C) 2017 Free Software Foundation, Inc.

License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ guile ../guile-debugging/syntax-parms.scm 
In ice-9/psyntax.scm:
  2338:44 19 (expand-let _ _ _ #f _ #<procedure build-let (src ids vars val-exps body-exp)> _ _ _)
  1679:45 18 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17 17 (map1 ("-" "1dff1b83541ce327" "-" "2ad70"))
In ice-9/psyntax.scm:
  1679:45 16 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17 15 (map1 ((#(ribcage () () ()) #(ribcage () () ()) #(ribcage #(unused-value) #((m-1dff1b83541ce327-29a7a top)) #("l-1dff1b83541ce327-2bce9")) #(ribcage () () ()) # …)))
In ice-9/psyntax.scm:
  1484:23 14 (_ _ _)
In ice-9/boot-9.scm:
   222:29 13 (map1 _)
   222:17 12 (map1 ("-" "2bd28"))
In ice-9/psyntax.scm:
  1789:11 11 (lp _ ())
  1679:45 10 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17  9 (map1 ((expand-1dff1b83541ce327-2bd31) (#<tree-il (lambda ((name . expand)) (lambda-case (((body) #f #f #f () (body-1dff1b83541ce327-2bd35)) (call (lambda () (…>) …))
In ice-9/psyntax.scm:
  1679:45  8 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17  7 (map1 ((m-1dff1b83541ce327-2bcf4 top)))
In ice-9/psyntax.scm:
  1484:23  6 (_ _ _)
In ice-9/boot-9.scm:
   222:17  5 (map1 (#<syntax %store-monad>))
In ice-9/psyntax.scm:
  1407:23  4 (_ _)
  1317:39  3 (syntax-type y (shift #(ribcage #(e) #((top)) #("l-680b775fb37a463-1343")) #(ribcage () () ()) #(ribcage #(xx) #((top)) #("l-680b775fb37a463-1340")) #(ribcage …)) # …)
   916:15  2 (resolve-identifier y (#<syntax >>=> #<syntax (#<syntax mval> #<syntax mproc0>)>) (shift #(ribcage #(e) #((top)) #("l-680b775fb37a463-1343")) #(ribcage () () #) …) …)
   833:21  1 (id-var-name y _ _)
    669:4  0 (search y (() #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ()) #(ribcage () () ())) (top) (hygiene guile-user))
ice-9/psyntax.scm:669:4: In procedure search:
In procedure vector-ref: Wrong type argument in position 1 (expecting vector): ()
In ice-9/boot-9.scm:
   222:29 19 (map1 _)
   222:17 18 (map1 (#f))
In ice-9/psyntax.scm:
  1789:11 17 (lp _ ())
  1679:45 16 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17 15 (map1 (() (m-1dff1b83541ce327-8f24e top)))
In ice-9/psyntax.scm:
  1679:45 14 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17 13 (map1 ((m-1dff1b83541ce327-8fe71 top) shift #(ribcage #(e) #((top)) #("l-680b775fb37a463-1343")) #(ribcage () () ()) #(ribcage #(xx) #((top)) #("l-680b775fb3…")) #))
In ice-9/psyntax.scm:
  1409:12 12 (expand-expr _ _ _ (shift #(ribcage #(e) #((top)) #("l-680b775fb37a463-1343")) #(ribcage () () ()) #(ribcage #(xx) #((top)) #("l-680b775fb37a463-1340")) #(# # …)) # …)
  2054:19 11 (_ _ _ (m-1dff1b83541ce327-8fe71 top) ())
In ice-9/boot-9.scm:
   222:17 10 (map1 (#<syntax identifier?> (#<syntax syntax> #<syntax id>)))
In ice-9/psyntax.scm:
  1409:12  9 (_ _)
  1789:11  8 (lp _ (#(ribcage () () ()) #(ribcage #(x) #((m-1dff1b83541ce327-8f383 top)) #("l-1dff1b83541ce327-8f40b")) #(ribcage () () ()) #(ribcage () () ()) #(ribcage # …) …))
  1679:45  7 (parse _ _ _ _ _ _ _)
In ice-9/boot-9.scm:
   222:17  6 (map1 (#(ribcage #(x) #((m-1dff1b83541ce327-8f383 top)) #("l-1dff1b83541ce327-8f40b")) #(ribcage () () ()) shift #(ribcage #(monad body) #((top) (top)) #("…" …)) …))
In ice-9/psyntax.scm:
  2702:67  5 (_ tmp-1dff1b83541ce327-8fa7a _ _)
 2646:111  4 (gen-clause #<tree-il (lexical tmp tmp-1dff1b83541ce327-8db88)> () (#(ribcage () () ()) #(ribcage #(x) #((m-1dff1b83541ce327-8f383 top)) #("l-1dff1b83541ce3…")) …) …)
  2607:69  3 (build-dispatch-call (("8fa7c" . 0)) "1dff1b83541ce327" #<tree-il (lexical tmp tmp-1dff1b83541ce327-8e71d)> #((m-1dff1b83541ce327-8f383 top)) (#f #f () (#) #<tr…> …))
In ice-9/boot-9.scm:
   222:17  2 (map1 ("8fa7c"))
In ice-9/psyntax.scm:
  2004:10  1 (gen-var _)
In unknown file:
           0 (symbol->string "8fa7c")
ERROR: In procedure symbol->string:
In procedure symbol->string: Wrong type argument in position 1 (expecting symbol): "8fa7c"
--8<---------------cut here---------------end--------------->8---

Ludo’.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: bug#27476: guix pull fails on powerful server
  2018-04-30 21:19             ` Ludovic Courtès
@ 2019-01-29 10:07               ` Ricardo Wurmus
  0 siblings, 0 replies; 21+ messages in thread
From: Ricardo Wurmus @ 2019-01-29 10:07 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andy Wingo, help-guix, 27476


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

> ludo@gnu.org (Ludovic Courtès) skribis:
>
>> I can’t reproduce this with current Guile ‘stable-2.2’, following Andy’s
>> weak-table rewrite¹, so this might have been a weak-table bug showing up
>> under memory pressure.
>
> With Guile 2.2.3 a similar program triggers a crash very quickly:
>
> --8<---------------cut here---------------start------------->8---
> $ cat ../guile-debugging/syntax-parms.scm
> (use-modules (ice-9 threads)
>              (srfi srfi-1)
>              (guix monads)
>              (guix store)
>              (system base compile))
>
> (compile #f)                                      ;load modules
>
> (define threads
>   (unfold (lambda (x) (> x 100))
>           (lambda (x)
>             (call-with-new-thread
>              (lambda ()
>                (while #t
>                  (compile
>                   '(mlet %store-monad ((x y))
>                      (mbegin %store-monad
>                        (return x)
>                        (return y)))
>                   #:env (current-module)
>                   #:from 'scheme
>                   #:to 'tree-il)))))
>           1+
>           0))
>
> (for-each join-thread threads)
[…]
> --8<---------------cut here---------------end--------------->8---

I tried this with guile 2.2.4 on my laptop with 4 CPUs (according to
lscpu) and I did not get a crash even after waiting for several minutes.

--
Ricardo

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2019-01-29 10:22 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22  8:38 guix pull fails on powerful server Ricardo Wurmus
2017-09-22 14:10 ` bug#27476: " Ludovic Courtès
2017-09-25  7:27   ` Andy Wingo
2017-09-25 13:03     ` Ludovic Courtès
2017-09-25 14:02       ` bug#27476: " Ricardo Wurmus
2017-09-30  7:59         ` Ricardo Wurmus
2017-10-03 20:29           ` Marius Bakke
2017-10-04 13:15             ` Ricardo Wurmus
2017-10-04 15:09           ` Clément Lassieur
2017-10-04 16:17             ` bug#27476: " Ricardo Wurmus
2017-10-07 15:11           ` Ludovic Courtès
2017-10-10  7:17             ` Ricardo Wurmus
2017-10-10 11:32               ` Ludovic Courtès
2017-10-12 13:37           ` bug#27476: " Ludovic Courtès
2017-10-13 20:29             ` Ricardo Wurmus
2017-10-13 21:04             ` Ricardo Wurmus
2017-10-13 21:10               ` Ricardo Wurmus
2017-11-07 10:57           ` Ludovic Courtès
2018-04-30 21:19             ` Ludovic Courtès
2019-01-29 10:07               ` Ricardo Wurmus
2017-09-25  8:43 ` Clément Lassieur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).