From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eVvu6-0006II-Eh for guix-patches@gnu.org; Mon, 01 Jan 2018 03:57:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eVvu2-00012U-Fd for guix-patches@gnu.org; Mon, 01 Jan 2018 03:57:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:50525) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eVvu2-00012A-Cm for guix-patches@gnu.org; Mon, 01 Jan 2018 03:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eVvu2-0005BE-61 for guix-patches@gnu.org; Mon, 01 Jan 2018 03:57:02 -0500 Subject: [bug#29922] [PATCH v2] linux-boot: Improve error reporting. References: <20180101004231.20195-1-dannym@scratchpost.org> In-Reply-To: <20180101004231.20195-1-dannym@scratchpost.org> Resent-Message-ID: From: Danny Milosavljevic Date: Mon, 1 Jan 2018 09:56:47 +0100 Message-Id: <20180101085647.22716-1-dannym@scratchpost.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29922@debbugs.gnu.org * gnu/build/linux-boot.scm (boot-system): Improve error reporting. * gnu/system.scm (operating-system-user-kernel-arguments): Export. * gnu/tests.scm (marionette-operating-system): Modify kernel-arguments. --- gnu/build/linux-boot.scm | 21 ++++++++++++++++++++- gnu/system.scm | 1 + gnu/tests.scm | 3 +++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 4dd740174..bff2eb0f4 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -507,7 +507,26 @@ to it are lost." (switch-root "/root") (format #t "loading '~a'...\n" to-load) - (primitive-load to-load) + (catch #t + (lambda () + (primitive-load to-load)) + (lambda (key proc format-string format-args . rest) + (format (current-error-port) "~a: ~a~%" proc + (apply format #f format-string format-args)) + (force-output (current-error-port)) + (exit 1) + (reboot)) + (lambda _ + (let ((print-frames + (@@ (system repl debug) print-frames)) + (frame->stack-vector + (@@ (system repl debug) frame->stack-vector)) + (stack-ref + (@@ (system repl debug) stack-ref))) + (print-frames + (frame->stack-vector + (stack-ref (make-stack #t) 0)) + #:width 1000000)))) (format (current-error-port) "boot program '~a' terminated, rebooting~%" diff --git a/gnu/system.scm b/gnu/system.scm index df89ca06d..a4407e8ab 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -73,6 +73,7 @@ operating-system-hosts-file operating-system-kernel operating-system-kernel-file + operating-system-user-kernel-arguments operating-system-kernel-arguments operating-system-initrd operating-system-users diff --git a/gnu/tests.scm b/gnu/tests.scm index 0caa922fd..dc0188f1e 100644 --- a/gnu/tests.scm +++ b/gnu/tests.scm @@ -172,6 +172,9 @@ marionette service in the guest is started after the Shepherd services listed in REQUIREMENTS." (operating-system (inherit os) + ;; Make sure that the system doesn't hang on kernel panic. + (kernel-arguments (cons "panic=1" + (operating-system-user-kernel-arguments os))) (services (cons (service marionette-service-type (marionette-configuration (requirements requirements)