From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id yL3ZEx/PX2McWQAAbAwnHQ (envelope-from ) for ; Mon, 31 Oct 2022 14:35:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cHaNEx/PX2PiAwAAauVa8A (envelope-from ) for ; Mon, 31 Oct 2022 14:35:27 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D74AC3DC7E for ; Mon, 31 Oct 2022 14:35:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opUwS-0007Eq-HY; Mon, 31 Oct 2022 09:35:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUwQ-0007Do-LB for bug-guix@gnu.org; Mon, 31 Oct 2022 09:35:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opUwQ-0002fj-CK for bug-guix@gnu.org; Mon, 31 Oct 2022 09:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1opUwQ-0008IJ-7v for bug-guix@gnu.org; Mon, 31 Oct 2022 09:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#58733: installer: coredump generation Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 31 Oct 2022 13:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58733 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 58733@debbugs.gnu.org Received: via spool by 58733-submit@debbugs.gnu.org id=B58733.166722329831869 (code B ref 58733); Mon, 31 Oct 2022 13:35:02 +0000 Received: (at 58733) by debbugs.gnu.org; 31 Oct 2022 13:34:58 +0000 Received: from localhost ([127.0.0.1]:39803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opUwL-0008Hx-NK for submit@debbugs.gnu.org; Mon, 31 Oct 2022 09:34:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1opUwK-0008Hl-43 for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 09:34:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUwE-0002bl-Tn for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 09:34:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=WGbeW3L8o7+WXTc//oQLCQd4UYEQTEroAwHCyGXJFeg=; b=Ben/rFuHEwSfQWL3EaCq 2OgbBLeO1x2S/G2rWMZBia9nWzVLYO8Etyg8TrUIDtQS2z1zxBPLVgjigildSf20uTSl6rR4LP6TL Woeo5W0HZT0jeZD3VHy2vnkDneXtQsreAr1FxDKK/nZhECI8glXBNdwJg2Ct8rYOCgOpG48sWP6C5 /RT14yhG+kkJ+5FAsAEUF5KRHvUH0HWmQuqqtu9P5yxKPGgZYXJC4P8CKsxvmKiGzr1YI3JyOsYHc /SoSGJ/PXR0TI1PlF7Luu2keB2Lv7Elysc907r8tJL0GHcD2eZ6/4XQh7LeD/LbUSZ0fLhYjt95AH eEu5Ij9UKhmhRg==; Received: from 2a02-8429-81d2-3d01-94c9-8097-ea5c-2775.rev.sfr.net ([2a02:8429:81d2:3d01:94c9:8097:ea5c:2775] helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opUwE-0001JB-Eo for 58733@debbugs.gnu.org; Mon, 31 Oct 2022 09:34:50 -0400 From: Mathieu Othacehe References: <87o7u228hq.fsf@gnu.org> Date: Mon, 31 Oct 2022 14:34:46 +0100 In-Reply-To: <87o7u228hq.fsf@gnu.org> (Mathieu Othacehe's message of "Sun, 23 Oct 2022 11:29:37 +0200") Message-ID: <87v8o0m809.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "bug-Guix" Errors-To: bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667223327; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=WGbeW3L8o7+WXTc//oQLCQd4UYEQTEroAwHCyGXJFeg=; b=Xhtekv+W4FWAGcZ/Qjqn/n/dBAxuNKaPfdKigE6H5UTwAZeXtePUmC/bOUGWs7sJdrBWrI uMb3BTAOnp0EgfIdoqX/ZRMiobXXs/HYIo4seyyC3DVqFDqD1s/f+HECKRCVcE2VzsdUAu PzoltrExPjqkN5OEqXeoJwZLb0DX4r2yiseibvoJ7hUy3AwdrMqgsNf7gXIUJ6TrpIkZwx lagmeUcoVJC/TjY2uLI8uOxEKj/XUvnHz8WeJpsylA8+MZjKvAGDKuNR7gJ6s2cCZiVcmV uB3q00tKUIRLZCIKXjurkz7McwwSTeqYzR9RSGAyr1d61XeKvC6omMZBaGwNIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667223327; a=rsa-sha256; cv=none; b=WVom7E9Su9FeZH/bSIfCYRzvpdY6G6kcu/BOfMUEjmZwhtAb4hixWODxcX8h5BwsRkJBB2 Sb9v6iHJl/f5eOtIN6VJscAUrxRg/AGkztdcondTpOgJVP79jTwOA3Bp5zuvv+ZB7yMlei siKkelKJa1eHtmu4e0du3ui8BocnAbacasI199PYxER1hbeSmawoAphTnFEb0SWaXuO+Fu 1kA4Hn4CrxXdS5ttsUxQIgrZEz5PAeYr5Ar/Fed4wcjkKkZ8FNKU88PfjAjO4l1kdaQDgs CdsYZqil4HLJcPsxi7qbT17XEkOr2rHoU/8bKDh9Y5oVyliWTz4Tebv3qvMCeA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Ben/rFuH"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.17 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Ben/rFuH"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D74AC3DC7E X-Spam-Score: -4.17 X-Migadu-Scanner: scn0.migadu.com X-TUID: QEWRjjkbG8bL --=-=-= Content-Type: text/plain Hello, > Failed to read a valid object file image from memory. > Core was generated by `/gnu/store/1jgcbdzx2ss6xv59w55g3kr3x4935dfb-guile-3.0.8/bin/guile --no-auto-com'. This is reported as: https://issues.guix.gnu.org/58923 > I think that it would be great if we could enable coredump generation > from the installer. This way, when a crash occurs and the installer > restarts, it would notice that there is an existing coredump in say > /tmp/coredump_xxx and propose to upload it using the existing dump > mechanism. Here is an attached patch implementing the proposed mechanism. Mathieu --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-installer-Add-core-dump-support.patch >From f4d2a1bb4df2f65b650be704bffb7ea469ae0232 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 31 Oct 2022 13:03:46 +0100 Subject: [PATCH 1/1] installer: Add core dump support. Fixes: * gnu/installer.scm (installer-program): Enable core dump generation. * gnu/installer/dump.scm (%core-dump): New variable. (prepare-dump): Copy the core dump file. * gnu/installer/newt/welcome.scm (run-welcome-page): Propose to report an installation that previously generated a core dump. --- gnu/installer.scm | 6 ++++++ gnu/installer/dump.scm | 10 +++++++++- gnu/installer/newt/welcome.scm | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/gnu/installer.scm b/gnu/installer.scm index 8a6e604fa5..52c595b5b7 100644 --- a/gnu/installer.scm +++ b/gnu/installer.scm @@ -389,6 +389,12 @@ (define installer-builder (ice-9 match) (ice-9 textual-ports)) + ;; Enable core dump generation. + (setrlimit 'core #f #f) + (call-with-output-file "/proc/sys/kernel/core_pattern" + (lambda (port) + (format port %core-dump))) + ;; Initialize gettext support so that installers can use ;; (guix i18n) module. #$init-gettext diff --git a/gnu/installer/dump.scm b/gnu/installer/dump.scm index daa02f205a..f91cbae021 100644 --- a/gnu/installer/dump.scm +++ b/gnu/installer/dump.scm @@ -28,13 +28,17 @@ (define-module (gnu installer dump) #:use-module (web http) #:use-module (web response) #:use-module (webutils multipart) - #:export (prepare-dump + #:export (%core-dump + prepare-dump make-dump send-dump-report)) ;; The installer crash dump type. (define %dump-type "installer-dump") +;; The core dump file. +(define %core-dump "/tmp/installer-core-dump") + (define (result->list result) "Return the alist for the given RESULT." (hash-map->list (lambda (k v) @@ -66,6 +70,10 @@ (define dump-dir ;; syslog (copy-file "/var/log/messages" "syslog") + ;; core dump + (when (file-exists? %core-dump) + (copy-file %core-dump "core-dump")) + ;; dmesg (let ((pipe (open-pipe* OPEN_READ "dmesg"))) (call-with-output-file "dmesg" diff --git a/gnu/installer/newt/welcome.scm b/gnu/installer/newt/welcome.scm index 0bca44d1b2..5d47591d67 100644 --- a/gnu/installer/newt/welcome.scm +++ b/gnu/installer/newt/welcome.scm @@ -20,6 +20,7 @@ (define-module (gnu installer newt welcome) #:use-module ((gnu build linux-modules) #:select (modules-loaded)) + #:use-module (gnu installer dump) #:use-module (gnu installer steps) #:use-module (gnu installer utils) #:use-module (gnu installer newt page) @@ -132,6 +133,20 @@ (define (run-welcome-page logo) the system does not boot, perhaps you will need to add nomodeset to the kernel arguments and need to configure the uvesafb kernel module.") (G_ "Pre-install warning"))) + (when (file-exists? %core-dump) + (match + (choice-window + (G_ "Previous installation failed") + (G_ "Continue") + (G_ "Report the failure") + (G_ "It seems that the previous installation exited unexpectedly \ +and generated a core dump. Do you want to continue or to report the failure \ +first?")) + (1 #t) + (2 (raise + (condition + (&message + (message "User abort."))))))) (run-menu-page (G_ "GNU Guix install") (G_ "Welcome to GNU Guix system installer! -- 2.38.0 --=-=-=--