GNU bug report logs - #46670
28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode

Previous Next

Package: emacs;

Reported by: Mauricio Collares <mauricio <at> collares.org>

Date: Sun, 21 Feb 2021 00:14:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Andrea Corallo <akrl <at> sdf.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#46670: closed (28.0.50; [feature/native-comp] possible
 miscompilation affecting lsp-mode)
Date: Wed, 24 Feb 2021 08:23:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 24 Feb 2021 08:22:08 +0000
with message-id <xjf7dmxkh8v.fsf <at> sdf.org>
and subject line Re: bug#46670: 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode
has caused the debbugs.gnu.org bug report #46670,
regarding 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
46670: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46670
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mauricio Collares <mauricio <at> collares.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; [feature/native-comp] possible miscompilation affecting
 lsp-mode
Date: Sat, 20 Feb 2021 21:12:11 -0300
This was found by Anthony Cowley, who isolated the exact function in
lsp-mode that was misbehaving. I verified that I could reproduce this
findings, and then I removed surrounding context to obtain a minimized
testcase. If this fails to reproduce, it's entirely my fault.

Steps to reproduce:

1) Put this in minimized.el:

;;; -*- lexical-binding: t; -*-

(defun minimized--look-back (s)
  (and (equal (buffer-substring-no-properties (- (point) (length s)) (point))
              s)
       s))

(defun minimized-go ()
  (interactive)
  (message (minimized--look-back ".")))

(provide 'minimized)

2) Type "." in a buffer and then run minimized-go with the point after
the period. This prints back "." in the minibuffer if the code's
interpreted but not if it's native-compiled.

Note that removing the "lexical-binding: t" line makes the bug not
reproduce. Replacing "(- (point) (length s))" by "(1- (point))" also
makes the bug disappear.

Best,
Mauricio


[Message part 3 (message/rfc822, inline)]
From: Andrea Corallo <akrl <at> sdf.org>
To: Mauricio Collares <mauricio <at> collares.org>
Cc: 46670-done <at> debbugs.gnu.org
Subject: Re: bug#46670: 28.0.50; [feature/native-comp] possible
 miscompilation affecting lsp-mode
Date: Wed, 24 Feb 2021 08:22:08 +0000
Mauricio Collares <mauricio <at> collares.org> writes:

> On February 23, 2021 8:26:25 PM GMT-03:00, Andrea Corallo <akrl <at> sdf.org> wrote:
>>Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of
>>text editors" <bug-gnu-emacs <at> gnu.org> writes:
>>
>>Right I've pushed bddd7a2d13 implementing the discussed solution as I'm
>>convinced is more general and future proof.
>>
>>The patch is passing the tests and bootstrapping clean, also is adding a
>>test that should cover this specific bug.
>>
>>Mauricio could you verify it actually solves the lsp-mode issue?
>
> Hi Andrea,
>
> I've verified that the lsp-mode completion issue is fixed. Many, many thanks! 
>
> By the way, I just noticed that this is probably the same issue that
> was reported by X L and Óscar Fuentes in emacs-devel ('Completion
> doesn't start after "." Is pressed in go-mode with gopls').

Wonderful!  I'm closing this bug then.

Thank you for reporting it

  Andrea


This bug report was last modified 4 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.