From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Daniel Colascione" Newsgroups: gmane.emacs.bugs Subject: bug#38912: 27.0.60; PDumper meets segmentation fault when evil is loaded Date: Mon, 6 Jan 2020 09:10:20 -0800 Message-ID: References: <333553AC-68DE-4F1C-9586-5A13248AD6DD@icloud.com> <83ftgvh96l.fsf@gnu.org> <83a771g2tc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="136551"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: SquirrelMail/1.4.23 [SVN] Cc: NiwTinray , 38912@debbugs.gnu.org To: "Eli Zaretskii" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 06 18:11:27 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioVuU-000ZIz-Ky for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jan 2020 18:11:23 +0100 Original-Received: from localhost ([::1]:55400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioVuT-0004J4-7M for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Jan 2020 12:11:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46934) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioVuC-0004Ek-EK for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2020 12:11:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioVuA-0004It-QH for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2020 12:11:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40625) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioVuA-0004II-Aq for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2020 12:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ioVuA-0000AH-6n for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2020 12:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Daniel Colascione" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2020 17:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38912 X-GNU-PR-Package: emacs Original-Received: via spool by 38912-submit@debbugs.gnu.org id=B38912.1578330627591 (code B ref 38912); Mon, 06 Jan 2020 17:11:02 +0000 Original-Received: (at 38912) by debbugs.gnu.org; 6 Jan 2020 17:10:27 +0000 Original-Received: from localhost ([127.0.0.1]:46598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioVta-00009S-Qe for submit@debbugs.gnu.org; Mon, 06 Jan 2020 12:10:27 -0500 Original-Received: from dancol.org ([96.126.100.184]:58286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioVtY-00009I-Fd for 38912@debbugs.gnu.org; Mon, 06 Jan 2020 12:10:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:To:From: Subject:Date:References:In-Reply-To:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FPTAIL4tiztV7pq0BpWbQEX0OBDODwb117204Ry76C0=; b=pm83BDcBZ+eHhLPruU0FuO8c5N OHToOBP9g7rrSjsX0dm4zB/9M07U466kRVcm2aLrxu5cxKnDesd0zN6p88W6xMycXnRF2BMyLagwG /bvh0Kleke1K9cL/Ur1hjx63720rXFMai1A90fAQEiN+x9fgbI+qVJ9fVNefr6HOqYGd06VNsWvyA WW1MmZ5jCDzztLVW5Ppu1g85qsoeCXM4eqHD/6wzItrk7f+Fj7Qm916DucM+xrHFwJgxbPThsZ1im Ns9n08UVkvkumtUx+NQU128xtycAlf9Z++wfzJaHugD9lxt7addmsQ2xdSZ+L5YZhFnyCCbskN9fU Dk1Bj/jg==; Original-Received: from localhost ([127.0.0.1] helo=dancol.org) by dancol.org with esmtp (Exim 4.89) (envelope-from ) id 1ioVtT-0007Kx-Vj; Mon, 06 Jan 2020 09:10:20 -0800 Original-Received: from 127.0.0.1 (SquirrelMail authenticated user dancol) by dancol.org with HTTP; Mon, 6 Jan 2020 09:10:20 -0800 In-Reply-To: <83a771g2tc.fsf@gnu.org> X-Priority: 3 (Normal) Importance: Normal X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174245 Archived-At: > [Please use "Reply All" to reply, so that the bug address is kept on > the CC list.] > >> From: NiwTinray >> Date: Sun, 5 Jan 2020 13:25:07 +0800 >> >> > I cannot reproduce this from "emacs -Q" because 'use-package' is not a >> > known function. Can you show a recipe starting from "emacs -Q", >> > please? >> >> Here. I've attached a minimal script file that helps reproduce this bug. >> >> (require 'package) >> (package-initialize) >> (add-to-list 'package-archives >> '("melpa-stable" . "https://stable.melpa.org/packages/") t) >> (unless (package-installed-p 'evil) >> (package-refresh-contents) >> (package-install 'evil)) >> (require 'evil) >> (dump-emacs-portable "/tmp/test.pdmp") >> >> The script downloads the package "evil" from Melpa stable, load the evil >> package >> and dumps an image to /tmp/test.pdmp. >> >> > Also, does this happen if you add -Q to the Emacs invocation after >> > dumping? If not, there's more detail missing in your report: the >> > customizations in your init files. >> >> >> Sure. Please download this file, and run the command: >> >> emacs --batch -Q --script evil.el >> >> To see the bug happen, load the test.pdmp file: >> >> emacs -Q --dump-file /tmp/test.pdmp >> >> You should see a segmentation fault: >> >> [1] 23369 segmentation fault (core dumped) emacs -Q --dump-file >> /tmp/test.pdmp >> >> I run debugger inside src/.gdbinit using the command: >> >> gdb -x .gdbinit --args ./emacs --dump-file /tmp/test.pdmp >> >> And logged backtrace. See my second attachment: >> >> (base) omnisky :: ~/emacs/src ‹emacs-27*› » gdb -x .gdbinit --args >> ./emacs --dump-file /tmp/test.pdmp >> GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 >> Copyright (C) 2016 Free Software Foundation, Inc. >> License GPLv3+: GNU GPL version 3 or later >> >> This is free software: you are free to change and redistribute it. >> There is NO WARRANTY, to the extent permitted by law. Type "show >> copying" >> and "show warranty" for details. >> This GDB was configured as "x86_64-linux-gnu". >> Type "show configuration" for configuration details. >> For bug reporting instructions, please see: >> . >> Find the GDB manual and other documentation resources online at: >> . >> For help, type "help". >> Type "apropos word" to search for commands related to "word"... >> Reading symbols from ./emacs...done. >> warning: File "/home/ntr/emacs/src/.gdbinit" auto-loading has been >> declined by your `auto-load safe-path' set to >> "$debugdir:$datadir/auto-load". >> To enable execution of this file add >> add-auto-load-safe-path /home/ntr/emacs/src/.gdbinit >> line to your configuration file "/home/ntr/.gdbinit". >> To completely disable this security protection add >> set auto-load safe-path / >> line to your configuration file "/home/ntr/.gdbinit". >> For more information about this security protection see the >> "Auto-loading safe path" section in the GDB manual. E.g., run from the >> shell: >> info "(gdb)Auto-loading safe path" >> SIGINT is used by the debugger. >> Are you sure you want to change it? (y or n) [answered Y; input not from >> terminal] >> Environment variable "DISPLAY" not defined. >> TERM = xterm-24bits >> Breakpoint 1 at 0x411df0: file emacs.c, line 370. >> Breakpoint 2 at 0x4bfe60: file xterm.c, line 10130. >> (gdb) r >> Starting program: /home/ntr/emacs/src/emacs --dump-file /tmp/test.pdmp >> /home/ntr/emacs/src/emacs: >> /raid_sdc/home/ntr/anaconda3/lib/libtiff.so.5: no version information >> available (required by /home/ntr/emacs/src/emacs) >> [Thread debugging using libthread_db enabled] >> Using host libthread_db library >> "/lib/x86_64-linux-gnu/libthread_db.so.1". >> >> Program received signal SIGSEGV, Segmentation fault. >> 0x00000000004f12d0 in Fcurrent_active_maps (olp=olp@entry=XIL(0x30), >> position=position@entry=XIL(0)) at keymap.c:1541 >> 1541 && NILP (KVAR (current_kboard, >> Voverriding_terminal_local_map)) >> (gdb) xbacktrace >> "key-binding" (0xffffd5c8) >> "turn-on-undo-tree-mode" (0xffffd758) >> "global-undo-tree-mode-enable-in-buffers" (0xffffd948) >> "run-hooks" (0xffffd9e8) >> "run-mode-hooks" (0xffffdbc0) >> "minibuffer-inactive-mode" (0xffffdd40) >> (gdb) > > In my debug build of Emacs 27.0.60 I get an assertion violation while > dumping, which probably is already a sign of trouble. > > Daniel, any ideas? I haven't had a chance over the past few days to repro this problem, but I hope to do so this weeekend. The messages about the assertion failure *during* dumping do seem likely unrelated. The easiest way to debug this particular crash is with rr. Run the original test as "rr record emacs [args]", then run "rr replay". The latter will dump you in a GDB prompt. Type "cont" and run the replay of Emacs until you get to the SIGSEGV. Run "watch -l [expression]" to break out of execution whenever that value changes, then run "reverse-cont" to run the replay *backwards* until you get to the code that changed the variable with the bad value.