From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains Date: Sat, 10 Jul 2021 20:04:51 +0300 Message-ID: <83wnpyaymk.fsf@gnu.org> References: <87o8bn7bie.fsf@gnus.org> <87zgv6vuon.fsf@gmx.de> <837di9lwbm.fsf@gnu.org> <87a6n5vuu4.fsf@gnus.org> <8735sqnmei.fsf@gnus.org> <87zguyf4ht.fsf@gmx.de> <87pmvum54p.fsf@gnus.org> <87v95mf2lj.fsf@gmx.de> <87pmvt3ob1.fsf@gnus.org> <83r1g9evoy.fsf@gnu.org> <83pmvtevgg.fsf@gnu.org> <87czrt3mj4.fsf@gnus.org> <878s2h3m1d.fsf@gnus.org> <874kd53lnl.fsf@gnus.org> <87zgux26ab.fsf@gnus.org> <83k0m1e3dg.fsf@gnu.org> <875yxlugcb.fsf@gnus.org> <8335spdjy5.fsf@gnu.org> <878s2hszcx.fsf@gnus.org> <83y2agda7l.fsf@gnu.org> <87a6mup24o.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17913"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael.albinus@gmx.de, ncaprisunfan@gmail.com, 49261@debbugs.gnu.org To: Lars Ingebrigtsen , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 10 19:06:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2GQi-0004YS-Aq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Jul 2021 19:06:16 +0200 Original-Received: from localhost ([::1]:55774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2GQh-0007wq-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Jul 2021 13:06:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2GQU-0007wi-5W for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2021 13:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2GQT-0005Mt-UD for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2021 13:06:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m2GQT-0004QZ-I2 for bug-gnu-emacs@gnu.org; Sat, 10 Jul 2021 13:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jul 2021 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49261 X-GNU-PR-Package: emacs Original-Received: via spool by 49261-submit@debbugs.gnu.org id=B49261.162593671116962 (code B ref 49261); Sat, 10 Jul 2021 17:06:01 +0000 Original-Received: (at 49261) by debbugs.gnu.org; 10 Jul 2021 17:05:11 +0000 Original-Received: from localhost ([127.0.0.1]:33361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2GPf-0004PV-2m for submit@debbugs.gnu.org; Sat, 10 Jul 2021 13:05:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m2GPe-0004PG-5r for 49261@debbugs.gnu.org; Sat, 10 Jul 2021 13:05:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40452) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2GPY-0004hK-PC; Sat, 10 Jul 2021 13:05:04 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2062 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2GPY-0005Xt-Dl; Sat, 10 Jul 2021 13:05:04 -0400 In-Reply-To: <87a6mup24o.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 10 Jul 2021 18:25:27 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209758 Archived-At: > From: Lars Ingebrigtsen > Cc: michael.albinus@gmx.de, ncaprisunfan@gmail.com, 49261@debbugs.gnu.org > Date: Sat, 10 Jul 2021 18:25:27 +0200 > > (gdb) p $2->u.s.car > $3 = XIL(0x2aaa9c41a9e0) > (gdb) xtype > Lisp_Symbol > (gdb) xsymbol > $4 = (struct Lisp_Symbol *) 0x7ffff1fc26c0 > "normal-top-level" > (gdb) > > So it's segfaulting while evaling normal-top-level? Yes. Which is consistent with the backtrace, so this didn't teach us anything new. It would be good to try to understand byte code of which function is being run in frame #3 here: > Thread 1 "bootstrap-emacs" received signal SIGSEGV, Segmentation fault. > 0x00005555556f0549 in AREF (idx=6988131860, array=XIL(0x7ffff1bd901d)) > at lisp.h:731 > 731 return lisp_h_XLP (o); > (gdb) bt > #0 0x00005555556f0549 in AREF (idx=6988131860, array=XIL(0x7ffff1bd901d)) > at lisp.h:731 > #1 HASH_KEY (idx=3494065930, h=0x7ffff1bd8f98) at lisp.h:2374 > #2 hash_lookup > (h=0x7ffff1bd8f98, key=XIL(0x555555c76c64), hash=hash@entry=0x0) > at fns.c:4479 > #3 0x0000555555719cb9 in exec_byte_code > (bytestr=, vector=, maxdepth=, args_template=args_template@entry=make_fixnum(257), nargs=nargs@entry=1, args=, args@entry=0x7fffffffd940) at bytecode.c:1415 > #4 0x00005555556e643f in fetch_and_exec_byte_code > (args=0x7fffffffd940, nargs=1, syms_left=make_fixnum(257), fun=XIL(0x7ffff1bc9895)) at lisp.h:731 > #5 funcall_lambda > (fun=XIL(0x7ffff1bc9895), nargs=nargs@entry=1, arg_vector=arg_vector@entry=0x7fffffffd940) at eval.c:3244 The problem is this is an optimized build and many variables are "optimized out". Line 1415 of bytecomp.c is here: CASE (Bswitch): { /* TODO: Perhaps introduce another byte-code for switch when the number of cases is less, which uses a simple vector for linear search as the jump table. */ Lisp_Object jmp_table = POP; if (BYTE_CODE_SAFE && !HASH_TABLE_P (jmp_table)) emacs_abort (); Lisp_Object v1 = POP; ptrdiff_t i; struct Lisp_Hash_Table *h = XHASH_TABLE (jmp_table); /* h->count is a faster approximation for HASH_TABLE_SIZE (h) here. */ if (h->count <= 5 && !h->test.cmpfn) { /* Do a linear search if there are not many cases FIXME: 5 is arbitrarily chosen. */ for (i = h->count; 0 <= --i; ) if (EQ (v1, HASH_KEY (h, i))) break; } else i = hash_lookup (h, v1, NULL); <<<<<<<<<<<<<<<<< Stefan, what code in command-line-1 is likely to produce the Bswitch byte-code? Anyway, looking at frame 1, I guess the value of 'idx' is bogus, which means something is wrong with the hash table. So maybe we should audit the part(s) of the offending commit that have something to do with hash tables? Also, what kind of hash-table are we looking up there, is it possible to understand that by looking at the variables involved in the above code?