From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: bug#32952: "make check-system" fails to report record-abi-mismatch-error Date: Sat, 06 Oct 2018 00:19:12 -0700 Message-ID: <875zyfv8y7.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8h3I-0004Aa-6Q for bug-guix@gnu.org; Sat, 06 Oct 2018 03:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8h3G-0002uO-TS for bug-guix@gnu.org; Sat, 06 Oct 2018 03:31:04 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:34049) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8h3G-0002u8-NK for bug-guix@gnu.org; Sat, 06 Oct 2018 03:31:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g8h3G-0000p7-Gl for bug-guix@gnu.org; Sat, 06 Oct 2018 03:31:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8h30-00045e-22 for bug-guix@gnu.org; Sat, 06 Oct 2018 03:30:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8grw-0000XV-AB for bug-guix@gnu.org; Sat, 06 Oct 2018 03:19:21 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:40237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8grv-0000VZ-Pk for bug-guix@gnu.org; Sat, 06 Oct 2018 03:19:20 -0400 Received: by mail-pl1-x636.google.com with SMTP id 1-v6so7816127plv.7 for ; Sat, 06 Oct 2018 00:19:19 -0700 (PDT) Received: from garuda.local ([2601:601:9d00:3c88:6f5b:236d:b95b:f89a]) by smtp.gmail.com with ESMTPSA id f81-v6sm22918803pfh.46.2018.10.06.00.19.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Oct 2018 00:19:16 -0700 (PDT) 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: 32952@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Guix, On commit d71078bc75d149c70dc573a259986f1731145693, "make check-system" failed for me with the following error message: =2D-8<---------------cut here---------------start------------->8--- [2] [env] marusich@garuda.local:~/guix $ make check-system Compiling Scheme modules... warning: failed to load '(gnu tests install)': Backtrace: 9 (apply-smob/1 #) In ice-9/boot-9.scm: 705:2 8 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 7 (_ #(#(#))) 619:8 6 (_ #(#(#(#) (#)) #)) 626:19 5 (_ #(#(#(#) (#)) #)) In gnu/tests.scm: 277:11 4 (all-system-tests) 273:32 3 (fold-system-tests _ _) In srfi/srfi-1.scm: 697:23 2 (filter-map #= . #) In guix/discovery.scm: 113:22 1 (_ . _) In unknown file: 0 (display-error #f # #) ERROR: In procedure display-error: Wrong number of arguments to # make: *** [Makefile:5454: check-system] Error 1 [2] [env] marusich@garuda.local:~/guix $=20 =2D-8<---------------cut here---------------end--------------->8--- Although it wasn't obvious, this problem was actually caused by a record-abi-mismatch-error. When I deleted my $HOME/.cache/guile/ccache directory, this error went away, and I was able to run the system tests. However, it took some work to figure this out, since the error reporting mechanism itself suffered an error. To figure this out, I added some debug statements (see attached patch). After I did that, "make check-system" failed with some more information: =2D-8<---------------cut here---------------start------------->8--- [2] [env] marusich@garuda.local:~/guix $ make check-system Compiling Scheme modules... XXX before ;;; (#) ;;; ((gnu tests install)) ;;; ((record-abi-mismatch-error #>)) ;;; ((record-abi-mismatch-error #>)) warning: failed to load '(gnu tests install)': ;;; (#) ;;; ((#>)) Backtrace: 9 (apply-smob/1 #) In ice-9/boot-9.scm: 705:2 8 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 7 (_ #(#(#))) 619:8 6 (_ #(#(#(#) (#)) #)) 626:19 5 (_ #(#(#(#) (#)) #)) In gnu/tests.scm: 277:11 4 (all-system-tests) 273:32 3 (fold-system-tests _ _) In srfi/srfi-1.scm: 697:23 2 (filter-map #= . #) In guix/discovery.scm: 114:22 1 (_ record-abi-mismatch-error #) In unknown file: 0 (display-error #f # #) ERROR: In procedure display-error: Wrong number of arguments to # make: *** [Makefile:5454: check-system] Error 1 [2] [env] marusich@garuda.local:~/guix $=20 =2D-8<---------------cut here---------------end--------------->8--- This output shows two problems. The first problem is that an ABI mismatch error was thrown. The second problem is that display-error encountered a problem while trying to display that error. It's the second problem that I can't figure out. Why does display-error fail in this case? For context, note that fold-system-tests in gnu/tests.scm calls test-modules (in the same file), and that test-modules calls scheme-modules with #:warn set to warn-about-load-error. The procedure warn-about-load-error is defined in guix/ui.scm. It calls display-error. That seems to be where the problem occurs. Based on the debug output I added, we can see that in warn-about-load-error, the args variable refers to the following list: (record-abi-mismatch-error #>) This is strange, since the only place that throws record-abi-mismatch-error is in guix/records.scm... =2D-8<---------------cut here---------------start------------->8--- (define (abi-check type cookie) "Return syntax that checks that the current \"application binary interface\" (ABI) for TYPE is equal to COOKIE." (with-syntax ((current-abi (current-abi-identifier type))) #`(unless (eq? current-abi #,cookie) ;; The source file where this exception is thrown must be ;; recompiled. (throw 'record-abi-mismatch-error 'abi-check "~a: record ABI mismatch; recompilation needed" (list #,type) '())))) =2D-8<---------------cut here---------------end--------------->8--- ...and based on that code, I expected the args variable to contain many more elements. I expected it to look more like this: =2D-8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (throw 'record-abi-mismatch-error 'abi-check "~a: record ABI mismatch; recompilation needed" (list 'some-type) '()) Throw to key `record-abi-mismatch-error' with args `(abi-check "~a: record = ABI mismatch; recompilation needed" (some-type) ())'. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]>=20 =2D-8<---------------cut here---------------end--------------->8--- I don't understand what happened to all the other arguments. It looks like the throw invocation in guix/records.scm was written carefully so that it would throw exactly the arguments that display-error expects to receive, but some of the arguments apparently went missing (e.g., the "~a: record ABI mismatch; recompilation needed" message). I can't figure out why those arguments are missing. How can I debug this further? I'd like to fix this if possible so that "make check-system" can reliably report errors like this. Thank you in advance for your help! =2D-=20 Chris --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-Add-some-debug-statements.patch Content-Transfer-Encoding: quoted-printable From=20ac550495740ba4f8c87a9577145f6760a0ff00cd Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Fri, 5 Oct 2018 23:39:57 -0700 Subject: [PATCH] Add some debug statements =2D-- guix/discovery.scm | 4 +++- guix/ui.scm | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/guix/discovery.scm b/guix/discovery.scm index 3fc6e2c9e..af428825e 100644 =2D-- a/guix/discovery.scm +++ b/guix/discovery.scm @@ -110,7 +110,9 @@ name and the exception key and arguments." (resolve-interface module)) (lambda args ;; Report the error, but keep going. =2D (warn module args) + (display "XXX before\n") + ((pk warn) (pk module) (pk args)) + (display "XXX after\n") #f)))) (scheme-files (if sub-directory (string-append directory "/" sub-directory) diff --git a/guix/ui.scm b/guix/ui.scm index 96f403acf..f28f80d4b 100644 =2D-- a/guix/ui.scm +++ b/guix/ui.scm @@ -381,7 +381,7 @@ ARGS is the list of arguments received by the 'throw' h= andler." (define (warn-about-load-error file args) ;FIXME: factorize with = =E2=86=91 "Report the failure to load FILE, a user-provided Scheme file, without exiting. ARGS is the list of arguments received by the 'throw' handler." =2D (match args + (match (pk args) (('system-error . rest) (let ((err (system-error-errno args))) (warning (G_ "failed to load '~a': ~a~%") file (strerror err)))) @@ -398,7 +398,7 @@ exiting. ARGS is the list of arguments received by the= 'throw' handler." file obj))) ((error args ...) (warning (G_ "failed to load '~a':~%") file) =2D (apply display-error #f (current-error-port) args)))) + (apply display-error #f (pk (current-error-port)) (pk args))))) =20 (define (call-with-unbound-variable-handling thunk) (define tag =2D-=20 2.18.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAlu4YfAACgkQ3UCaFdgi Rp2uXBAAwW6XRO+ZIbXzZDEr8kainGH+DGVPpl0YIlEZpLXjyOjNCNJ7Crzmck03 v9MibuaFagolohPmZ2v2BrgXa1J9qBAv2xGzeFULN8PnvqsSZgjbocC3wJG6bLb8 aj1pIreR0QLB35a+mSC450yZDsPTc7uwqfqe11H3xBM81BonjR8JTXR0dGDAQjDz 8u2RgPfDP8FuO4sRJbTLYaG/OV/b1pJR84IyEWXMh9ByUFeqtqu6+0lmF2UqdEyF MenZobXXUPKt7aJ0SN/OjAuJzP6K27an38yRXWEasOtkClorfVdMDzvaPoGfzHn+ o1lWi3jxO54u4A+9ZPhtLcu2lMORvKgNiwjcR3caQhCsqoPLRfNWVSo7voG0IEem l4piZ++S4huNQrrZ+k3ijmcxxpya2uD/O2AqLQHdHsPHDppsGqxNs4q/4ifYiTtf eFSzaPkLH0EtU+oIgZA53VC6HjvFIT1rvyvWrT3u5Tt6GSX2f3gSoMB9qPafR5mH ji7XU2BDMRCgy731YVu3WVN8sjsZJ85UDY1D5sCFkVja+u9TlE+yoEw2gYaD8MAs C3BmvcMFS+Irj1BcnbIoqksFBcW8ieKiVTDfIDV0H6WrW/cmJ8qdnUXHGpZVDN5Q NXHmsDyJjmo9nWo5KNDzPSVyiZmN0jnfSvXUK0eRI1x+xUGq+ew= =ooNo -----END PGP SIGNATURE----- --==-=-=--