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 01:00:35 -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="246263"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 27779@debbugs.gnu.org, npostavs@gmail.com, mail@vasilij.de To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 02 10:01:18 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 1hM6ea-0011k8-Q4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 10:01:17 +0200 Original-Received: from localhost ([127.0.0.1]:47019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM6eZ-0006Jp-RI for geb-bug-gnu-emacs@m.gmane.org; Thu, 02 May 2019 04:01:15 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM6eO-0006EW-VB for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 04:01:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM6eN-000331-G4 for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 04:01:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60207) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM6eN-000329-0O for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 04:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hM6eM-0008N8-Qj for bug-gnu-emacs@gnu.org; Thu, 02 May 2019 04:01:02 -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 08:01:02 +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.155678404132151 (code B ref 27779); Thu, 02 May 2019 08:01:02 +0000 Original-Received: (at 27779) by debbugs.gnu.org; 2 May 2019 08:00:41 +0000 Original-Received: from localhost ([127.0.0.1]:45518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM6e1-0008MU-0u for submit@debbugs.gnu.org; Thu, 02 May 2019 04:00:41 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.150.114]:13005) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hM6dy-0008MK-0t for 27779@debbugs.gnu.org; Thu, 02 May 2019 04:00:39 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 89B36297EFF7 for <27779@debbugs.gnu.org>; Thu, 2 May 2019 03:00:37 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id M6dwhBJDziQerM6dxhqtVz; Thu, 02 May 2019 03:00:37 -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=Ko18f4/iF87xfmvQs4CdV1ukGiaGfouXZ8YITBCnOXE=; b=d/UmmaH5nJXaCGuuav6mTfDJkS A8+NMIttYPHvTslzoHVw6QpEMZ9227F475PvByfycaMV6fnQL+ptOG75MzoNxRWFCzwM8ofur6tGE ZXT70rIYkW82ahCTlun9plXTHrhjc1+B1uSeMXE9CB9O0RkSuQjVjD7cYALt9kimndqMlnRSdVJ0f sxHymTmvg9gnvE9YiXItl3+zNmsvNmF52jj1Q7PQ6uiALvZPxqL67Dd0b9Or4dDnsRpQub3jVa2se syltkjz+tDit2txNoTX3us1YIk2y2LsNKoXcz2pg97zN2cAUnEZsLWySgZdewXqj5ISdawImv5ATF xcQ/xisQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:54426 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1hM6dw-000LLf-Es; Thu, 02 May 2019 03:00:36 -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: 1hM6dw-000LLf-Es X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:54426 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:158621 Archived-At: TWO (2) TESTS: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; TEST # 1. SOURCE: git clone -b emacs-26 git://git.sv.gnu.org/emacs.git CONFIGURE: CFLAGS='-Wall -O2 -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)))) TEST: Lanched without the terminal by opening Emacs.app. RESULT: Bug #27779: Success! (23997) No need to set the terminal with "ulimit -S -s unlimited" before launching Emacs from the terminal. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; TEST # 2. SOURCE: git clone -b emacs-26 git://git.sv.gnu.org/emacs.git CONFIGURE: CFLAGS='-Wall -O0 -g3' ./configure \ --with-ns \ --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)))) TEST: Lanched without the terminal by opening Emacs.app. RESULT: Re-entering top level after C stack overflow ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > Date: [05-02-2019 00:26:45] <2 May 2019 00:26:45 -0700> > From: Paul Eggert > To: Keith David Bershatsky , Noam Postavsky > Cc: 27779@debbugs.gnu.org, mail@vasilij.de > Subject: Re: bug#27779: #27779; C stack overflow from `read' on deeply nested lisp object. > > Keith David Bershatsky wrote: > > 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 > > What happens if you try it with -O2 rather than -O0? > > Also, what happens if you try it without --enable-checking='yes,glyphs'? > > I have a suspicion that the debugging options are blowing the stack.