unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: michael.albinus@gmx.de, ncaprisunfan@gmail.com, 49261@debbugs.gnu.org
Subject: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains
Date: Sat, 10 Jul 2021 20:04:51 +0300	[thread overview]
Message-ID: <83wnpyaymk.fsf@gnu.org> (raw)
In-Reply-To: <87a6mup24o.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat,  10 Jul 2021 18:25:27 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> 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=<optimized out>, vector=<optimized out>, maxdepth=<optimized out>, args_template=args_template@entry=make_fixnum(257), nargs=nargs@entry=1, args=<optimized out>, 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?





  reply	other threads:[~2021-07-10 17:04 UTC|newest]

Thread overview: 109+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 17:38 bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains Mallchad Skeghyeph
2021-06-30 13:00 ` Lars Ingebrigtsen
2021-06-30 13:26   ` Eli Zaretskii
2021-06-30 14:08     ` Lars Ingebrigtsen
     [not found]       ` <CADrO7Mje3DstmjxutZcpx33jWJwgE_z+hGfJc4aON1CYOpyJxA@mail.gmail.com>
2021-07-01 10:55         ` Lars Ingebrigtsen
2021-07-01 12:58           ` Eli Zaretskii
2021-06-30 16:07     ` Michael Albinus
2021-06-30 16:16       ` Eli Zaretskii
2021-07-01 11:38         ` Lars Ingebrigtsen
2021-06-30 19:31   ` Juri Linkov
2021-07-01 16:57   ` Michael Albinus
2021-07-01 18:31     ` Eli Zaretskii
2021-07-02 11:06       ` Lars Ingebrigtsen
2021-07-02 12:32         ` Michael Albinus
2021-07-07 16:01         ` Lars Ingebrigtsen
2021-07-07 16:07           ` Michael Albinus
2021-07-07 16:13             ` Lars Ingebrigtsen
2021-07-07 16:40               ` Michael Albinus
2021-07-07 16:57                 ` Lars Ingebrigtsen
2021-07-07 16:55           ` Michael Albinus
2021-07-07 16:59             ` Lars Ingebrigtsen
2021-07-07 17:36               ` Michael Albinus
2021-07-07 18:08                 ` Lars Ingebrigtsen
2021-07-07 18:33                   ` Eli Zaretskii
2021-07-07 18:50                     ` Lars Ingebrigtsen
2021-07-07 19:40                 ` Lars Ingebrigtsen
2021-07-07 20:03                   ` Michael Albinus
2021-07-08  6:03                     ` Michael Albinus
2021-07-08 19:53                       ` Michael Albinus
2021-07-09  6:30                         ` Eli Zaretskii
2021-07-09  8:28                           ` Michael Albinus
2021-07-09 10:45                             ` Eli Zaretskii
2021-07-09 11:01                               ` Michael Albinus
2021-07-09 16:31                                 ` Lars Ingebrigtsen
2021-07-12 13:53                                   ` Michael Albinus
2021-07-12 14:03                                     ` Eli Zaretskii
2021-07-12 14:37                                       ` Michael Albinus
2021-07-12 17:30                                         ` Eli Zaretskii
2021-07-12 17:35                                           ` Lars Ingebrigtsen
2021-07-12 17:38                                             ` Eli Zaretskii
2021-07-12 18:00                                               ` Michael Albinus
2021-07-12 18:25                                                 ` Eli Zaretskii
2021-07-12 18:46                                                   ` Michael Albinus
2021-07-12 19:04                                                     ` Eli Zaretskii
2021-07-13 17:53                                                       ` Michael Albinus
2021-07-13 16:30                                               ` Lars Ingebrigtsen
2021-07-13 16:31                                                 ` Lars Ingebrigtsen
2021-07-13 16:41                                                 ` Eli Zaretskii
2021-07-13 17:59                                                   ` Michael Albinus
2021-07-13 19:00                                                     ` Eli Zaretskii
2021-07-13 19:09                                                       ` Lars Ingebrigtsen
2021-07-13 19:36                                                       ` Michael Albinus
2021-07-13 17:55                                                 ` Michael Albinus
2021-07-13 19:05                                                   ` Lars Ingebrigtsen
2021-07-16 16:15                                                     ` Michael Albinus
2021-07-17 14:06                                                       ` Lars Ingebrigtsen
2021-07-07 20:05                   ` Eli Zaretskii
2021-07-07 20:09                     ` Lars Ingebrigtsen
2021-07-07 20:15                       ` Eli Zaretskii
2021-07-07 20:10                     ` Eli Zaretskii
2021-07-07 20:18                       ` Lars Ingebrigtsen
2021-07-07 20:29                         ` Lars Ingebrigtsen
2021-07-07 20:37                           ` Lars Ingebrigtsen
2021-07-07 20:55                             ` Lars Ingebrigtsen
2021-07-07 21:04                               ` Lars Ingebrigtsen
2021-07-07 22:22                                 ` Lars Ingebrigtsen
2021-07-08  0:09                                   ` bug#49261: Segfault during loadup Lars Ingebrigtsen
2021-07-08  6:35                                     ` Eli Zaretskii
2021-07-08 12:51                                       ` Lars Ingebrigtsen
2021-07-11  8:36                                     ` Paul Eggert
2021-07-11 10:21                                       ` Eli Zaretskii
2021-07-11 15:25                                         ` Eli Zaretskii
2021-07-12  7:16                                           ` Paul Eggert
2021-07-12 12:07                                             ` Eli Zaretskii
2021-07-12 14:50                                               ` Paul Eggert
2021-07-12 14:56                                                 ` Andreas Schwab
2021-07-12 15:54                                                 ` Eli Zaretskii
2021-07-13 23:12                                                   ` Paul Eggert
2021-07-14  7:42                                                     ` Andreas Schwab
2021-07-14 22:04                                                       ` Paul Eggert
2021-07-14 22:10                                                         ` Andreas Schwab
2021-07-14 12:36                                                     ` Eli Zaretskii
2021-07-14 22:24                                                       ` Paul Eggert
2021-07-15  6:13                                                         ` Eli Zaretskii
2021-07-11 11:32                                       ` Lars Ingebrigtsen
2021-07-08  6:15                                   ` bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains Eli Zaretskii
2021-07-08  6:20                                 ` Eli Zaretskii
2021-07-08 12:44                                   ` Lars Ingebrigtsen
2021-07-08 13:11                                     ` Lars Ingebrigtsen
2021-07-08 13:13                                     ` Eli Zaretskii
2021-07-08  6:17                               ` Eli Zaretskii
2021-07-08 12:42                                 ` Lars Ingebrigtsen
2021-07-08 12:49                                   ` Lars Ingebrigtsen
2021-07-08 13:16                                   ` Eli Zaretskii
2021-07-08 13:34                                     ` Lars Ingebrigtsen
2021-07-08 16:47                                       ` Eli Zaretskii
2021-07-10 16:25                                         ` Lars Ingebrigtsen
2021-07-10 17:04                                           ` Eli Zaretskii [this message]
2021-07-10 17:15                                             ` Lars Ingebrigtsen
2021-07-10 17:20                                               ` Eli Zaretskii
2021-07-07 18:02           ` Eli Zaretskii
2021-07-07 18:17             ` Lars Ingebrigtsen
2021-07-07 18:20               ` Lars Ingebrigtsen
2021-07-07 18:42               ` Eli Zaretskii
2021-07-07 18:58                 ` Lars Ingebrigtsen
2021-07-07 19:03                   ` Lars Ingebrigtsen
2021-07-07 19:20                   ` Eli Zaretskii
2021-07-07 18:50               ` Eli Zaretskii
2021-07-07 19:22                 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wnpyaymk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=49261@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    --cc=ncaprisunfan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).