unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Andy Wingo <wingo@igalia.com>, help-guix@gnu.org, 27476@debbugs.gnu.org
Subject: Re: bug#27476: guix pull fails on powerful server
Date: Fri, 13 Oct 2017 22:29:09 +0200	[thread overview]
Message-ID: <877evyu6zu.fsf@elephly.net> (raw)
In-Reply-To: <877ew0o5br.fsf@gnu.org>


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

  reply	other threads:[~2017-10-13 20:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877evyu6zu.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=27476@debbugs.gnu.org \
    --cc=help-guix@gnu.org \
    --cc=ludo@gnu.org \
    --cc=wingo@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).