From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#27779: #27779; C stack overflow from `read' on deeply nested lisp object. Date: Thu, 02 May 2019 00:05:52 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186832"; mail-complaints-to="usenet@blaine.gmane.org" Cc: eggert@cs.ucla.edu, 27779@debbugs.gnu.org, mail@vasilij.de To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 09:06:19 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1hM5nM-000mHV-5O for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 09:06:16 +0200 Original-Received: from localhost ([127.0.0.1]:46303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM5nL-0006lb-45 for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 03:06:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM5nD-0006jE-58 for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:06:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM5nB-0001zN-HQ for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:06:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60159) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM5n8-0001x1-3f for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:06:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hM5n7-00072s-Rq for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 03:06:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 May 2019 07:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27779 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 27779-submit@debbugs.gnu.org id=B27779.155678075827069 (code B ref 27779); Thu, 02 May 2019 07:06:01 +0000 Original-Received: (at 27779) by debbugs.gnu.org; 2 May 2019 07:05:58 +0000 Original-Received: from localhost ([127.0.0.1]:45470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM5n3-00072W-Pc for submit@debbugs.gnu.org; Thu, 02 May 2019 03:05:58 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.49.219]:40549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM5n0-00072M-VF for 27779@debbugs.gnu.org; Thu, 02 May 2019 03:05:57 -0400 Original-Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway23.websitewelcome.com (Postfix) with ESMTP id 27CB42FC6 for <27779@debbugs.gnu.org>; Thu, 2 May 2019 02:05:54 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id M5mzhxoU4dnCeM5n0hhnPW; Thu, 02 May 2019 02:05:54 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:Cc:To:From:Message-ID:Date: Sender:Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rzT/g1ZTbb/0R37FRHStUkoKQv2tvtMJ1Swd98rhSaE=; b=IhOshCLPqGI5X5focBygRrogwa EHWsn+DlAGalFTIlMW7wbW0RLNjP7u/MquwGrIxyNaBHWhTbqwm8poSRRqmp0EBi+jt+dmJcdMWZU TBPaTH5UPRdfC6tQUO0CrklnRXak/+DHx7EeZ7KE150y+mLQwJ4QOG5F87+EjviuvocCEjZLIKeXz h8QBo+SXLKsjlo7BNM5DfA/SuSXx0Lnuyq1LhcBDxqfdrL+xq9WlgVb37X/IaJgAtbugv4FH8mn6+ WltrFAQoOnU9jva2quLmyjVMyMVKskFn1lJq8R6bLmYLHIDxu4sEfj+ay8ZxvGjhK/T5Ac9hPL6u9 KUc1Doyg==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:53848 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hM5mz-004IEo-8v; Thu, 02 May 2019 02:05:53 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1hM5mz-004IEo-8v X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:53848 X-Source-Auth: lawlist X-Email-Count: 3 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158618 Archived-At: I performed the following tests on OSX 10.6.8 (Snow Leopard): SOURCE: git clone -b emacs-26 git://git.sv.gnu.org/emacs.git CONFIGURE: CFLAGS='-Wall -O0 -g3' ./configure \ --with-ns \ --enable-checking='yes,glyphs' \ --enable-check-lisp-object-type \ --without-compress-install \ --without-makeinfo \ --with-gnutls=no \ --with-mailutils \ --without-makeinfo LISP: (require 'cl-lib) (defun make-deep-object (depth) (let ((obj 1)) (while (> (cl-decf depth) 0) (setq obj (vector (list obj)))) obj)) ;;; STACK OVERFLOW: problem with `read' ;;; The bug was introduced on December 8, 2016 with ;;; commit: f0a1e9ec3fba3d5bea5bd62f525dba3fb005d1b1 (let* ((print-circle t) (max-lisp-eval-depth most-positive-fixnum) (max-specpdl-size most-positive-fixnum) (deep-object (make-deep-object 6000)) (string (prin1-to-string deep-object)) (result (read string))) (when result (message "Bug #27779: Success! (%d)" (length string)))) RESULT _WITH_ TERMINAL (ulimit -S -s unlimited): "Bug #27779: Success! (23997)" RESULT _WITHOUT_ TERMINAL (ulimit -S -s unlimited): "Re-entering top level after C stack overflow" I use a custom fork of undo-tree with a previous version of the CL Lisp libraries and have not done any testing to see how Emacs 26.2 would fair with my custom fork, or with the stock version of undo-tree. I have a list of known issues affecting my fork, including, but not limited to: Emacs Bug #27571 and a need for the old CL Lisp libraries .... I have not done any testing to see whether #27571 still exists. Keith ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [05-01-2019 19:30:17] <01 May 2019 22:30:17 -0400> > From: Noam Postavsky > To: Vasilij Schneidermann > Cc: Keith David Bershatsky , Noam Postavsky , > Paul Eggert , 27779@debbugs.gnu.org > Subject: Re: bug#27779: #27779; C stack overflow from `read' on deeply nested lisp object. > > Vasilij Schneidermann writes: > > > I've run into this issue today when loading up undo-tree on Emacs 26.1. > > I'm wondering if Paul's patch at https://debbugs.gnu.org/31995#21 (which > is in Emacs 26.2) effectively fixes this for practical use of undo-tree > history? That is, we know stack overflow is still possible for a > sufficiently deep nested object, but that patch should make it possible > for Emacs to read much deeper objects without overflowing.