From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Baines Subject: bug#40525: inferior process on core-updates crashes: mmap(PROT_NONE) failed Date: Fri, 10 Apr 2020 12:55:11 +0100 Message-ID: <87y2r37dy8.fsf@cbaines.net> References: <87369c8mus.fsf@cbaines.net> <87a73jy8y9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:34136) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jMsGR-0006He-0F for bug-guix@gnu.org; Fri, 10 Apr 2020 07:56:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jMsGP-0006Kz-NW for bug-guix@gnu.org; Fri, 10 Apr 2020 07:56:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43268) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jMsGP-0006Kt-Kj for bug-guix@gnu.org; Fri, 10 Apr 2020 07:56:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jMsGP-0002Dk-Kk for bug-guix@gnu.org; Fri, 10 Apr 2020 07:56:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87a73jy8y9.fsf@gnu.org> 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-mx.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 40525@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Hi, > > Christopher Baines skribis: > >> At some point, usually when extracting the information about lint >> warnings, package derivations or system tests, the inferior guix repl >> crashes. > > Could you come up with a simpler reproducer? What do we need to send to > the inferior to reach that crash? I've attached a script that when run should reproduce the issue. I extracted the code relating to lint warnings from the Guix Data Service. The script attached runs this code twice against the inferior, once will often be enough to cause it to crash, but twice should reproduce it more reliably. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=inferior-crash.scm Content-Description: inferior-script (use-modules (ice-9 match) (guix inferior) (guix channels) (guix store)) (define (all-inferior-lint-warnings inf store) (define locales '("cs_CZ.utf8" "da_DK.utf8" "de_DE.utf8" "eo_EO.utf8" "es_ES.utf8" "fr_FR.utf8" "hu_HU.utf8" "pl_PL.utf8" "pt_BR.utf8" ;;"sr_SR.utf8" "sv_SE.utf8" "vi_VN.utf8" "zh_CN.utf8")) (define (lint-warnings-for-checker checker-name) `(lambda (store) (let* ((checker (find (lambda (checker) (eq? (lint-checker-name checker) ',checker-name)) %local-checkers)) (check (lint-checker-check checker))) (define lint-checker-requires-store?-defined? (defined? 'lint-checker-requires-store? (resolve-module '(guix lint)))) (define (process-lint-warning lint-warning) (list (match (lint-warning-location lint-warning) (($ file line column) (list (if (string-prefix? "/gnu/store/" file) ;; Convert a string like ;; /gnu/store/53xh0mpigin2rffg31s52x5dc08y0qmr-guix-module-union/share/guile/site/2.2/gnu/packages/xdisorg.scm ;; ;; This happens when the checker uses ;; package-field-location. (string-join (drop (string-split file #\/) 8) "/") file) line column))) (let* ((source-locale "en_US.utf8") (source-message (begin (setlocale LC_MESSAGES source-locale) (lint-warning-message lint-warning))) (messages-by-locale (filter-map (lambda (locale) (catch 'system-error (lambda () (setlocale LC_MESSAGES locale)) (lambda (key . args) (error (simple-format #f "error changing locale to ~A: ~A ~A" locale key args)))) (let ((message (lint-warning-message lint-warning))) (setlocale LC_MESSAGES source-locale) (if (string=? message source-message) #f (cons locale message)))) (list ,@locales)))) (cons (cons source-locale source-message) messages-by-locale)))) (filter (match-lambda ((package-id . warnings) (not (null? warnings))) (a (error (simple-format #f "NO MATCH FOR ~A\n" a)))) (hash-map->list (lambda (package-id package) (cons package-id (catch #t (lambda () (map process-lint-warning (if (and lint-checker-requires-store?-defined? (lint-checker-requires-store? checker)) (check package #:store store) (check package)))) (lambda (key . args) '())))) %package-table))))) (inferior-eval '(use-modules (srfi srfi-1) (guix lint)) inf) (inferior-packages inf) (let ((checkers (inferior-eval '(begin (map (lambda (checker) (list (lint-checker-name checker) (lint-checker-description checker) (if (memq checker %network-dependent-checkers) #t #f))) %all-checkers)) inf))) (map (match-lambda ((name description network-dependent?) (cons (list name description network-dependent?) (if network-dependent? '() (inferior-eval-with-store inf store (lint-warnings-for-checker name)))))) checkers))) (let* ((channel (channel (name 'guix) (commit "d523eb5c9c2659cbbaf4eeef3691234ae527ee6a") (url "https://git.savannah.gnu.org/git/guix.git"))) (inferior (inferior-for-channels (list channel))) (result (with-store store (all-inferior-lint-warnings inferior store) ;; Running all-inferior-lint-warnings once doesn't seem to always ;; produce the crash, so just run it again (all-inferior-lint-warnings inferior store)))) (peek "RESULT" result)) --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6QXp9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XdsTQ//bDArrI5lVx6lKiRhWpiv5P8l+0SbLZNZ0RpdB05czqXzVI3Llwqjqw52 VkwQlVU/NTBlSzf/28ZDWp8r/CmdxdX/YRw+3w7S5wOi9Y0cDdq1V3dKXWgnpN7X yWQXl1oWhC9qTBt1mWwndm+OMrhojLyoN+FPb6jbuPk40V3co8li0dkOvFZv910d 9pLHlavdLfv2JvDe2Cx/2AaXOQO2zhwoXSlpj5OzGre2rrH/hzEI4Grv+FV8Odyp bGtO29P6noVm6AHVWw6UARySMKWw9ruVYH7sFW4QUKtX8R3iaw3vE78Y6fmoN//Y eacQ8iwuBLlbARqx0XwQMBhje4/ufdg93MHHrNEqpmyb3mrAbz/G0Vtv404gQcx/ 5W4Rtddwq6XRRVhY3q8eTvLxYTDNoj6W6uSvSnwth/Pe/Z5kF255Vk1zPlk4ydVl 6NfTGMiO5SfIiQaUZiSVAjFj9pGedbQRDNXHpxKXqmw2CWcZkvYijoQaYq6q0jii x/jeckNDmUh64YQhdjFUmPOsYsBTWgnuaT4GlTO4BOW8NCAYMOLpvt4oHwFyv2dA T5AIAR7HUa2gZa5iYM6syBUUYLg3ANUZjpOLVEAMue2OVwm4oI58QRH7YPoytbis +dPESQMrGml5WIE8TRa2mme/1rfXZBpumCCnhv7Cf/iVxIMG7FA= =aO5d -----END PGP SIGNATURE----- --==-=-=--