From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#27476: guix pull fails on powerful server Date: Mon, 25 Sep 2017 15:03:27 +0200 Message-ID: <87a81jj5gg.fsf__8169.47641219503$1506344661$gmane$org@gnu.org> References: <87h8vvp1q7.fsf@elephly.net> <87377esu1a.fsf@gnu.org> <87k20nz18u.fsf@igalia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwT3N-00025s-Tv for bug-guix@gnu.org; Mon, 25 Sep 2017 09:04:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwT3K-0004xZ-MN for bug-guix@gnu.org; Mon, 25 Sep 2017 09:04:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:48795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dwT3K-0004xS-IV for bug-guix@gnu.org; Mon, 25 Sep 2017 09:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dwT3K-0002y2-8B for bug-guix@gnu.org; Mon, 25 Sep 2017 09:04:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87k20nz18u.fsf@igalia.com> (Andy Wingo's message of "Mon, 25 Sep 2017 09:27:45 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Andy Wingo Cc: help-guix@gnu.org, 27476@debbugs.gnu.org Hi, Andy Wingo skribis: > On Fri 22 Sep 2017 16:10, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Hi Ricardo, >> >> Ricardo Wurmus skribis: >> >>> The following derivation will be built: >>> /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv >>> copying and compiling to '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-g= uix-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 procedu= re loop: >>> ice-9/threads.scm:289:22: Syntax error: >>> guix/scripts.scm:130:2: >>=3D: >>=3D (bind) used outside of 'with-monad= ' in form (>>=3D (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-o= utputs derivation))))))) >> >> This was reported at , 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/h= ome/ludo/src/guix/syntax-parms.scm.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; 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-7f9= 7c #)) #) # =E2=80=A6) =E2=80=A6) In ice-9/boot-9.scm: 230:17 11 (map1 (#)) 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--- =E2=80=A6 but then I failed to reproduce it again (that was on my 4-thread laptop). Ludo=E2=80=99.