From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Gergely Czuczy Newsgroups: gmane.emacs.bugs Subject: bug#28308: Build failure on FreeBSD/aarch64 Date: Mon, 11 Sep 2017 22:33:45 +0200 Message-ID: <90dd40c6-6837-aac5-fda6-f637bcfcc15b@harmless.hu> References: <2e5f41f7-e005-c28f-c04a-79953a804f71@harmless.hu> <8760d17pyj.fsf@users.sourceforge.net> <9ae1840f-9056-8771-43fa-b27bbd2b1bd3@harmless.hu> <87k218g33g.fsf@users.sourceforge.net> <2fbe77fe-1258-cef2-32e2-f741da514151@harmless.hu> <83y3powdsv.fsf@gnu.org> <87k215lqdf.fsf@users.sourceforge.net> <837ex5thtt.fsf@gnu.org> <83tw09s148.fsf@gnu.org> <83bmmhrw84.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1505162069 6467 195.159.176.226 (11 Sep 2017 20:34:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2017 20:34:29 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Cc: 28308@debbugs.gnu.org, npostavs@users.sourceforge.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 11 22:34:23 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drVP7-0000Vg-E0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 22:34:01 +0200 Original-Received: from localhost ([::1]:60426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drVPE-0000vR-NS for geb-bug-gnu-emacs@m.gmane.org; Mon, 11 Sep 2017 16:34:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drVP9-0000vG-4C for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 16:34:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drVP7-0004V1-Ra for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 16:34:03 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53697) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drVP7-0004Ux-OS for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 16:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1drVP7-0005GO-Ir for bug-gnu-emacs@gnu.org; Mon, 11 Sep 2017 16:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gergely Czuczy Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Sep 2017 20:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28308 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28308-submit@debbugs.gnu.org id=B28308.150516203620216 (code B ref 28308); Mon, 11 Sep 2017 20:34:01 +0000 Original-Received: (at 28308) by debbugs.gnu.org; 11 Sep 2017 20:33:56 +0000 Original-Received: from localhost ([127.0.0.1]:34145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drVP1-0005G0-NH for submit@debbugs.gnu.org; Mon, 11 Sep 2017 16:33:55 -0400 Original-Received: from marvin.harmless.hu ([195.56.55.204]:52893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drVOz-0005Fm-OP for 28308@debbugs.gnu.org; Mon, 11 Sep 2017 16:33:54 -0400 Original-Received: from 84-236-101-185.pool.digikabel.hu ([84.236.101.185] helo=[10.219.16.1]) by marvin.harmless.hu with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1drVOs-000CRb-56; Mon, 11 Sep 2017 20:33:46 +0000 In-Reply-To: <83bmmhrw84.fsf@gnu.org> Content-Language: en-US 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: 208.118.235.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:136809 Archived-At: On 2017. 09. 11. 19:17, Eli Zaretskii wrote: >> Cc: npostavs@users.sourceforge.net, 28308@debbugs.gnu.org >> From: Gergely Czuczy >> Date: Mon, 11 Sep 2017 19:12:12 +0200 >> >>> That's a call to delete_terminal, which doesn't appear in your >>> backtrace, and doesn't call xpalloc, either. So thanks, but I'm still >>> confused. Are you sure this is an unoptimized build? Is it possible >>> that we are looking at LLDB bug? >> It's the lldb debug, right. And I'm sure it's an unoptimized build, I've >> went back and checked the build flags: >> cc -Demacs  -I. -I. -I../lib -I../lib >> -I/usr/local/include/libxml2             -MMD -MF deps/.d -MP >> -Wno-switch -Wno-pointer-sign -Wno-string-plus-int >> -Wno-unknown-attributes -Wno-initializer-overrides >> -Wno-tautological-compare >> -Wno-tautological-constant-out-of-range-compare -O0 -g >> -fno-strict-aliasing  -Wl,-znocombreloc  (...) >> >> If that helps, I can create a qemu VM with this fbsd build, and give you >> the image. > Would it be possible for you to install GDB, and then repeat the same > experiment under GDB? It was relatively fast, however it appears to be the same: root@build-pine64:/usr/ports/editors/emacs-devel/work/emacs-f44184f/lisp# EMACSLOADPATH= lldb -- '../src/bootstrap-emacs' -batch l-no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -f batch-byte-compile emacs-lisp/macroexp.elk/emacs-f4 (lldb) target create "../src/bootstrap-emacs" Current executable set to '../src/bootstrap-emacs' (aarch64). (lldb) settings set -- target.run-args  "-batch" "--no-site-file" "--no-site-lisp" "--eval" "(setq load-prefer-newer t)" "-f" "batch-byte-compile" "emacs-lisp/macroexp.el" (lldb) r Process 98283 launching Process 98283 launched: '../src/bootstrap-emacs' (aarch64) Process 98283 stopped * thread #1, name = 'bootstrap-emacs', stop reason = signal SIGSEGV: invalid address (fault address: 0x41b17978)     frame #0: 0x0000000000228460 bootstrap-emacs`xnrealloc(pa=0x0000000000000000, nitems=0, item_size=1102150015) at alloc.c:939    936  {    937    eassert (0 <= nitems && 0 < item_size);    938    ptrdiff_t nbytes; -> 939    if (INT_MULTIPLY_WRAPV (nitems, item_size, &nbytes) || SIZE_MAX < nbytes)    940      memory_full (SIZE_MAX);    941    return xrealloc (pa, nbytes);    942  } (lldb) bt * thread #1, name = 'bootstrap-emacs', stop reason = signal SIGSEGV: invalid address (fault address: 0x41b17978)   * frame #0: 0x0000000000228460 bootstrap-emacs`xnrealloc(pa=0x0000000000000000, nitems=0, item_size=1102150015) at alloc.c:939     frame #1: 0x0000000000228204 bootstrap-emacs`xnrealloc(pa=0x000000000019ae38, nitems=42949672960, item_size=281474976703896) at alloc.c:939     frame #2: 0x000000000022e208 bootstrap-emacs`xpalloc(pa=0x0000000000000000, nitems=0x0000000041b1797f, nitems_incr_min=1683000, nitems_max=42949672960, item_size=281474976703896) at alloc.c:0     frame #3: 0x0000000000168214 bootstrap-emacs`delete_tty(terminal=0x4f67ed32e8e06446) at term.c:4463     frame #4: 0x0000000000040190 bootstrap-emacs`__start + 376     frame #5: 0x0000000040390018 ld-elf.so.1`.rtld_start at rtld_start.S:41 (lldb) It's still in the delete_ttye function, however, 4463 is a call to delete_terminal, and not to xpalloc. It's interesting why's that frame #2, because lldb also returns the same as we can see in the source: (lldb) frame select 3 frame #3: 0x0000000000168214 bootstrap-emacs`delete_tty(terminal=0x4f67ed32e8e06446) at term.c:4463    4460      before delete_terminal.  */    4461   reset_sys_modes (tty);    4462 -> 4463   delete_terminal (terminal);    4464    4465   xfree (tty->name);    4466   xfree (tty->type); However, disassembly gave something interesting: ** 4463   delete_terminal (terminal);    4464     0x16820c <+224>: bl     0xd40b4 ; coordinates_in_window + 5312 at window.c:1274     0x168210 <+228>: bl     0x22e1f8 ; xpalloc + 16084 at alloc.c:992 -> 4465   xfree (tty->name); ->  0x168214 <+232>: bl 0x35b294                  ; text_property_stickiness + 628 at textprop.c:1845     0x168218 <+236>: ldurb  w8, [x29, #-0x2c]     0x16821c <+240>: tbz    w8, #0x0, 0x16823c ; <+272> at term.c The pointer is at the xfree call. However, I the disassembly was too long, I couldn't get anything useful out of it. And here's the core file: http://czg.harmless.hu/tmp/bootstrap-emacs.core.gz You can download and analyze it with lldb, it was in the root of the source tree, if that matters. I guess that way you can just open it with lldb yourself, and dig into it.