From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauricio Collares Newsgroups: gmane.emacs.bugs Subject: bug#46670: 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode Date: Sat, 20 Feb 2021 21:12:11 -0300 Message-ID: <87a6ry46uc.fsf@collares.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39798"; mail-complaints-to="usenet@ciao.gmane.io" To: 46670@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 21 01:14:11 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 1lDcO2-000AER-NQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Feb 2021 01:14:11 +0100 Original-Received: from localhost ([::1]:39130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lDcO1-00010S-BL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Feb 2021 19:14:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDcNu-00010M-HA for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 19:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lDcNu-0002PU-AU for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 19:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lDcNu-0002Ez-6M for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 19:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauricio Collares Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Feb 2021 00:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46670 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16138664258583 (code B ref -1); Sun, 21 Feb 2021 00:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Feb 2021 00:13:45 +0000 Original-Received: from localhost ([127.0.0.1]:53144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDcNd-0002EM-Dv for submit@debbugs.gnu.org; Sat, 20 Feb 2021 19:13:45 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:40736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lDcNZ-0002EC-Af for submit@debbugs.gnu.org; Sat, 20 Feb 2021 19:13:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDcNZ-000104-59 for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 19:13:41 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lDcNU-0002Cs-PL for bug-gnu-emacs@gnu.org; Sat, 20 Feb 2021 19:13:39 -0500 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id ABFFB5C00A7 for ; Sat, 20 Feb 2021 19:13:33 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 20 Feb 2021 19:13:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=collares.org; h= from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=jK4AvCyUvjxffDF6tEYih5E1U/RNzatm+dNnKgUhAYk=; b=poOuv8Ud 8c/R7sl2Um54hWuz8i1DVeU5Rc0AyYDVgkQPxVLVlIptbXNV+5SDZ59geNGQfG7D DOzKuznu1sPkq1QrdOfDpPrZjMpJEGtR3KG1+fLk2xNOr0+9esa+jsBlZWnISIjd 4WIEqaDOo/pWKourdOgFkLp+YHLF4lqRKzphLpdnv/qNnT8lmgS2JSmWXAaZB8w/ Ep2z4p3geBfVTffvQeLrVb120djAPtf0KpjIPNYW0r5fU6IibH0IuVUxrj+FlHsV A8XeP1gQYqbd0VnHg9zPbGyrspJ0c9JTRya7oCsOm9FlzAW/OQEVLIQIuDilQvYk wh8JDNytHDo5Yg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=jK4AvCyUvjxffDF6tEYih5E1U/RNz atm+dNnKgUhAYk=; b=c4MLzNOURTy4ZffJRsf6RcFsujnGeV4/Etrrrt8G+UNof qWay4JRg9eYBXbXwDmfLv/soM3W9lb8Arx1oc/B1fPN7LmYlj3ZrVsnGd1UBN+45 KfUdspt7aTr1dnyx/vJa8LO7N2usyKktWXvcpnCLh0kaUyK4joAxlboEBM1RjAYF P4NPo90NrUg7YBOP5r6GipmRqEnVCiKZGn1i2NPHyso+jCkzm+6g4SIKkZ4kmBW7 3qYgOqv8BYvyYoin8QMEk6I76DNKmGyiSnLynUwdeuZuzFYIWUfTVb/8QF7aoxLt e+cO40fiyQtAB10ftUcQ1PNW7kuIO0EU/KBUI7lMA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrjeelgddujecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttd enucfhrhhomhepofgruhhrihgtihhoucevohhllhgrrhgvshcuoehmrghurhhitghiohes tgholhhlrghrvghsrdhorhhgqeenucggtffrrghtthgvrhhnpeevveevteeludetfeeuvd elffefueehtddtleffhffflefhhfeiudelveefieetgeenucfkphepudeluddrudekhedr feegrddvudehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepmhgruhhrihgtihhosegtohhllhgrrhgvshdrohhrgh X-ME-Proxy: Original-Received: from asus (unknown [191.185.34.215]) by mail.messagingengine.com (Postfix) with ESMTPA id A3F841080063 for ; Sat, 20 Feb 2021 19:13:32 -0500 (EST) Received-SPF: pass client-ip=66.111.4.29; envelope-from=mauricio@collares.org; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:200463 Archived-At: 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