From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#41357: 28.0.50; GC may miss to mark calle safe register content Date: Sun, 17 May 2020 12:05:25 -0700 Organization: UCLA Computer Science Department Message-ID: References: <83pnb2bmk2.fsf@gnu.org> <83eeribiim.fsf@gnu.org> <92ac80b1-102b-7429-8642-d5a2e974f468@cs.ucla.edu> <838shqbhko.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="72458"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: 41357@debbugs.gnu.org, akrl@sdf.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 17 21:06:19 2020 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 1jaOc6-000IiG-Nx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 21:06:18 +0200 Original-Received: from localhost ([::1]:60832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaOc5-0003bc-63 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 May 2020 15:06:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaObq-0003bM-Oz for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 15:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33207) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaObq-0005iv-GA for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 15:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaObq-0001L2-BC for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 15:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 May 2020 19:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41357 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, akrl@sdf.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15897423305088 (code B ref -1); Sun, 17 May 2020 19:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 May 2020 19:05:30 +0000 Original-Received: from localhost ([127.0.0.1]:44750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaObJ-0001K0-Ka for submit@debbugs.gnu.org; Sun, 17 May 2020 15:05:29 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaObJ-0001Jt-48 for submit@debbugs.gnu.org; Sun, 17 May 2020 15:05:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaObI-0003ZC-VR for bug-gnu-emacs@gnu.org; Sun, 17 May 2020 15:05:28 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaObI-0005Wq-0e; Sun, 17 May 2020 15:05:28 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A37C3160052; Sun, 17 May 2020 12:05:26 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Q_lhkkTEwKhv; Sun, 17 May 2020 12:05:25 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E5ADE1600CC; Sun, 17 May 2020 12:05:25 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aherHqjcxlYz; Sun, 17 May 2020 12:05:25 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id B7290160052; Sun, 17 May 2020 12:05:25 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU In-Reply-To: <838shqbhko.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=131.179.128.68; envelope-from=eggert@cs.ucla.edu; helo=zimbra.cs.ucla.edu X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 12:21:30 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001 autolearn=_AUTOLEARN 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:180501 Archived-At: On 5/17/20 10:24 AM, Eli Zaretskii wrote: > I struggle to see > how a Lisp object could appear in a register without leaving any trace > on the stack Quite easily. It happens all the time. If I do something like this: Lisp_Object a = Fcons (b, c); f (x, y); return a; The compiler might put 'a' into a callee-save register R, which means that while f is running there's no trace of 'a' on the stack (unless f's code itself decides to use R for whatever reason, but let's suppose it doesn't). This situation can persist even if f calls g which calls h which calls the garbage collector, and the garbage collector will then think the cons is garbage even though it's not. The proposed fix is harmless except it may execute a handful more instructions per GC. So the cost of applying the fix is tiny, whereas the potential reliability benefit is large.