unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 46670@debbugs.gnu.org, mauricio@collares.org,
	Andrea Corallo <akrl@sdf.org>
Subject: bug#46670: 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode
Date: Sat, 27 Feb 2021 12:39:48 +0000	[thread overview]
Message-ID: <CAOqdjBcmfhjHoAUpf9mEd-W8pNL=PiU1EOUv+PREmsH716cvYQ@mail.gmail.com> (raw)
In-Reply-To: <83v9adolkk.fsf@gnu.org>

On Sat, Feb 27, 2021 at 10:24 AM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Pip Cet <pipcet@gmail.com>
> > Date: Sat, 27 Feb 2021 09:39:50 +0000
> > Cc: Andrea Corallo <akrl@sdf.org>, 46670@debbugs.gnu.org, mauricio@collares.org
> >
> > > > How, assuming for the moment that the "strange" in (1) actually means
> > > > "buggy", are we supposed to fix this?
> > >
> > > I don't see any evidence yet that this needs to be fixed.  Without
> > > such evidence, the whole discussion is about a moot point.
> >
> > Quite the reverse: if we make rules saying such bug reports are to be
> > ignored, as Andrea suggested, actually reporting the bug is moot. It's
> > the rules I objected to in the previous mail, not the legitimate
> > requirement for further elaboration on my part before anyone else is
> > convinced there's a bug.
>
> Reports are never ignored, because someone needs to read them before
> deciding whether they need any action.  But that's beside the point.

"Deciding something doesn't need any (actual) attention" is pretty
close to the dictionary definition of "ignore".

After some playing around, I've now found a Lisp reproducer that is
mis-compiled because of the bug I reported.

However, I'd like to raise a general point:

The compiler consists of three stages. The first maps LAP code
programs to LIMPLE; the second stage transforms the LIMPLE tree into
another LIMPLE tree which is meant still to represent the same
program; the third translates LIMPLE to the libgccjit internal
representation.

Say we've found, as I have, an apparent bug in the second stage: a
LIMPLE tree representing one program is transformed into a LIMPLE tree
representing another, different program.

There are three possibilities:

1. it's easy to construct a preimage of such a LIMPLE tree under the
Lisp-to-LIMPLE transformation. Then we most likely have a reproducible
miscompilation bug, and we can fix it.
2. it's easy to prove that no erroneously-transformed LIMPLE tree is
arrived at by the first stage. In this case, we have no bug.
3. it's difficult to figure out whether the erroneously-transformed
LIMPLE tree can arise as a result of Lisp-to-LIMPLE transformation.

Case 3 is the difficult one. It's also the most common one, and the
one that we were talking about here until I found my example.

My strong opinion is that we must treat case #3 as a potential,
serious, miscompilation bug. Andrea's opinion, IIUC, is that we should
ignore case #3.

More importantly, when faced with a bug of case #1, Andrea's approach
might be to turn it into a case #3. Mine would be to fix it. That's
the situation we're in now.

> My point is that if those "assume" forms never generate any real code
> in the produced .eln file, then why worry about them?

They don't generate code themselves, but they affect later stages of
the code generation process and thus, ultimately, the real code that
results.

However, the task of proving that this actually results in a
Lisp-to-machine-code bug is, in general, too much to expect the
initial discoverer to perform.

> They are like
> comments: if you don't like comments, just ignore them; they don't
> actually affect any executable code.

They're not. We could redefine them to be, but we'd first have to
remove all code that uses them. And then that would leave us with
LIMPLE constructs that are quite literally meaningless.

> > All of this was sufficient for me to write Andrea asking whether there
> > was an issue (leaving out what I thought would be, to him, the tedious
> > trivialities of the lines above), or whether I was confused. I could
> > certainly have handled the ensuing exchange better, and I'll try to do
> > so in the future. However, the categorical instalment of new rules
> > disallowing the presentation of patches or bug reports for all bugs
> > outside a very narrow class would prevent that entirely.
>
> There are no rules that disallow presentation of patches.

Thanks for clarifying that.

Pip





  reply	other threads:[~2021-02-27 12:39 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21  0:12 bug#46670: 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode Mauricio Collares
2021-02-21 11:51 ` Pip Cet
2021-02-21 11:56   ` Pip Cet
2021-02-21 21:03     ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-21 22:46       ` Pip Cet
2021-02-22  9:37         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-22 10:04           ` Pip Cet
2021-02-22 10:25             ` Pip Cet
2021-02-22 11:23               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-22 12:11                 ` Pip Cet
2021-02-22 13:12                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-23  7:59                     ` Pip Cet
2021-02-23  9:04                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-23 23:26                         ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-24  2:10                           ` Mauricio Collares
2021-02-24  8:22                             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-23 19:09                     ` Pip Cet
2021-02-23 23:36                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-24  4:31                         ` Pip Cet
2021-02-24  9:04                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-24  9:28                             ` Pip Cet
2021-02-24  9:42                               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-24  9:46                                 ` Pip Cet
2021-02-24 10:06                                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-25 12:41                                     ` Pip Cet
2021-02-25 14:58                                       ` Eli Zaretskii
2021-02-25 15:14                                         ` Pip Cet
2021-02-25 15:31                                           ` Eli Zaretskii
2021-02-25 16:56                                       ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-25 20:59                                         ` Pip Cet
2021-02-26 19:33                                           ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-26 20:30                                             ` Pip Cet
2021-02-26 20:44                                               ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-26 20:11                                           ` Eli Zaretskii
2021-02-26 20:32                                             ` Pip Cet
2021-02-27  5:06                                             ` Pip Cet
2021-02-27  7:49                                               ` Eli Zaretskii
2021-02-27  9:39                                                 ` Pip Cet
2021-02-27 10:24                                                   ` Eli Zaretskii
2021-02-27 12:39                                                     ` Pip Cet [this message]
2021-02-27 13:30                                                       ` Eli Zaretskii
2021-02-27 17:15                                                         ` Pip Cet
2021-02-27 18:40                                                           ` Eli Zaretskii
2021-02-28  8:14                                                             ` Pip Cet
2021-03-01  5:24                                                               ` Richard Stallman
2021-03-01  6:40                                                                 ` Pip Cet
2021-02-22 11:16             ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-23  9:07               ` Pip Cet
2021-02-23 22:55                 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-02-24  7:00                   ` Pip Cet

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='CAOqdjBcmfhjHoAUpf9mEd-W8pNL=PiU1EOUv+PREmsH716cvYQ@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=46670@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=mauricio@collares.org \
    /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).