From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Newsgroups: gmane.emacs.devel Subject: Comparing symbol-with-position using eq (was: Help please! To track down GC trying to free an already freed object.) Date: Fri, 05 Apr 2019 11:05:59 -0600 Message-ID: <87ftqwcrgo.fsf_-_@gmail.com> References: <20190402112537.GA6212@ACM> <20190402202412.GA25792@ACM> <4a2df4442b4acf2eb2dabd3c2c4227c5.squirrel@dancol.org> <20190402210013.GD25792@ACM> <87bm1l6oq5.fsf@gmail.com> <20190405082652.GA4208@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="76893"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: Daniel Colascione , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 05 19:15:13 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCSQp-000JrF-Kg for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 19:15:11 +0200 Original-Received: from localhost ([127.0.0.1]:44771 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCSQo-00083o-JC for ged-emacs-devel@m.gmane.org; Fri, 05 Apr 2019 13:15:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCSQF-00083g-7j for emacs-devel@gnu.org; Fri, 05 Apr 2019 13:14:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCSQD-0006xM-GQ for emacs-devel@gnu.org; Fri, 05 Apr 2019 13:14:35 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:44768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hCSQ5-0004b2-4y for emacs-devel@gnu.org; Fri, 05 Apr 2019 13:14:32 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id i2so3393340pgj.11 for ; Fri, 05 Apr 2019 10:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=MYpJXFDh4sfWnRCc6lwDoVmR3Zvt05OO2eJe09UrhFQ=; b=FU2T9HUKOO9hCXUcq9kTzU9r0hJY0CbQm5t/eX0nRsL/WOpfzOC3rAWNFNkYyRuy3e KQRbROMKyFCjeiwputeiPpK6hVYumPnx7ahhr1IMgNAuflkMVIipIWhAIiCvpf12uxBj xpLMqCllcGbVayhoJ5uVSmKl5SmvnFlgg8wbmGPV2qpFFYjq/M/q9CfXqhQOQgy+j9av CUxVTmd7+xPSpa3kDYHJZOGd+C4vpa9J7G6aNxoLpAUokk7HSUd7qv0SGYeOXIqC4K6Y uxVz3/ujY98TPGnep6XyHPR7UatvwcezyD4+2qli1/qbJhz2z3YKjGknkk/lwFdVXYeT K5xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MYpJXFDh4sfWnRCc6lwDoVmR3Zvt05OO2eJe09UrhFQ=; b=rFr/YUKDjSdFRlCLWUtDJWlzZWJI1ics9WR1moqm2LyMFGp2hDFJU5xqwkICa7jNRA AxXv9nbj/1s7sAxqcIYUxqrO8FworLHCsuGLn54Bv6hJKl31CIyB/3QZJPOkG0TPL3He rAU9Wxav3tEe5AlzgQouqVapFr88JgERIXW5NlA/ZKQOPkGN4jUfmuXtFOcoB4Yg5T4y M119ebmGS//Dnzd+LuYti/OSSeW66h75QxCsG5ZgkW+7zmGTzBMXLT1d6pj6XjOoEc/T jnqIroCymvd/GtLRBYQCNDmWffKF7GPnZr2ttm36Wfi0eVDuilDkrrMMcK/R1+8o7+AV garg== X-Gm-Message-State: APjAAAVTTbHYMg3LRXdLn1cFBs0jD7DvKrQevxY6qrv14lxQ1hIX7kca 29B6qFw8xgFRySIvN8tWFi03RPMP X-Google-Smtp-Source: APXvYqymeEQvlCYtUV/LxjtQrQhJFhBOR6ZN/Dl1boSnHQC47kO0amJ7s/pYvbHtB+nU0Ya1vKyKIg== X-Received: by 2002:a65:4247:: with SMTP id d7mr12456994pgq.114.1554483960368; Fri, 05 Apr 2019 10:06:00 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id h1sm10175680pgs.67.2019.04.05.10.05.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Apr 2019 10:05:59 -0700 (PDT) In-Reply-To: <20190405082652.GA4208@ACM> (Alan Mackenzie's message of "Fri, 5 Apr 2019 08:26:52 +0000") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::52c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:234992 Archived-At: Hello, Alan. Alan Mackenzie writes: > On Thu, Apr 04, 2019 at 22:49:22 -0600, Alex wrote: > >> I apologize if this topic already reached its conclusion, but IMO >> having eq return true for two different object types is quite >> surprising behaviour. > > We are comparing two symbols, both of which are 'foo, but one of which is > annotated with its position in a source file. The two symbols are the > same symbol. Is it not comparing a symbol with a pseudovector containing that symbol and a position? > I understand the reaction to the idea, though. Even though the > representation of these two objects is different, conceptually they are > the same object. Similar objects, but I don't believe that's enough for eq. Consider that it's regarded non-portable in Lisp to compare integers with eq since the same number may be represented by different objects, or (eq 3 3.0), or (eq (list 1 2) (list 1 2)). > But consider: on a make bootstrap I did last night, there were 332 > warning messages from the byte compiler. Of these, only 80 gave the > correct line/column position, the other 252 being wrong. There have been > several bug reports from users complaining about such false positions. > This is what I'm trying to fix. I agree that it's a problem very much worth fixing; thank you for working on it. >> Is it out of the question to leave eq alone and introduce, e.g., >> eq-excluding-position that strips possible positions before comparison? > > It is, rather. To implement this would involve rewriting everything > which calls eq and is used by the byte compiler, to call > eq-excluding-position instead. These functions would need to exist in > two versions. There are rather a lot of functions which use eq. ;-) Why would you need to rewrite the helper procedures that the byte compiler uses? What about stripping the position at each relevant call site?