From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.bugs Subject: bug#27571: Crashing when printing a lisp object. Date: Mon, 03 Jul 2017 18:42:12 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1499132599 15025 195.159.176.226 (4 Jul 2017 01:43:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2017 01:43:19 +0000 (UTC) To: 27571@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 04 03:43:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSCry-0003ar-6Q for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Jul 2017 03:43:14 +0200 Original-Received: from localhost ([::1]:38254 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSCs3-0001h3-K4 for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jul 2017 21:43:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSCrp-0001fY-Gg for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSCrm-0002J8-BW for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:43:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSCrm-0002J0-7Z for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dSCrm-0005qi-1Q for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Keith David Bershatsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Jul 2017 01:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27571 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Emacs Bug Reports Original-Received: via spool by submit@debbugs.gnu.org id=B.149913256422458 (code B ref -1); Tue, 04 Jul 2017 01:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 4 Jul 2017 01:42:44 +0000 Original-Received: from localhost ([127.0.0.1]:51003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSCrT-0005qA-Hc for submit@debbugs.gnu.org; Mon, 03 Jul 2017 21:42:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dSCrR-0005px-A4 for submit@debbugs.gnu.org; Mon, 03 Jul 2017 21:42:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSCrK-0001vg-FX for submit@debbugs.gnu.org; Mon, 03 Jul 2017 21:42:35 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSCrK-0001vb-Be for submit@debbugs.gnu.org; Mon, 03 Jul 2017 21:42:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSCrI-0001TE-Je for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:42:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSCrF-0001sZ-En for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:42:32 -0400 Original-Received: from gateway23.websitewelcome.com ([192.185.50.107]:30674) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dSCrF-0001jG-41 for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 21:42:29 -0400 Original-Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway23.websitewelcome.com (Postfix) with ESMTP id ED3C814010 for ; Mon, 3 Jul 2017 20:42:14 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id SCqedWeXkUy7vSCqedaO7x; Mon, 03 Jul 2017 20:41:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:To :From:Message-ID:Date:Sender:Reply-To:Cc: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=xt9q0xBjFc292LaAwy1v23nl/ZYiAQatQLlGMLYZKsg=; b=ZZtQllk7ay5E/xgqhAXY5Ip6SE ufrmH2nM/v7/1k8iY4ZEmRqGYQZYCiMxkyamCd5lueZJ8ZZ1ulUb4cD3lPRCxI05fl2NxHcBPtmnq XgxzzcUb6fOKno3y8ZAtDlqLz8JqjFkmz0P7NmFSr6Wp3WDDMICbORvrOTfnQo0pdw1uAl99hLfp2 DPp2cyzpXbIcHOJNQ0mghP7ttDyfPmBo8TK8fZV0+AOWZJ6JvQx5nfSt8JJpJJytWULWo/4aVRMVa ucnjDDj9lj7tfACsI/9hj5o8b2A0ypmsF06AOEX8mQsuHvFxuEVzxz9xOt0h7g0CvLH0oNOoKNcmU nMgSI7Og==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51298 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dSCqz-0048Rt-Ap for bug-gnu-emacs@gnu.org; Mon, 03 Jul 2017 20:42:13 -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 - 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-Exim-ID: 1dSCqz-0048Rt-Ap X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51298 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:134152 Archived-At: I am using a custom version of undo-tree, which contains some additional = features and bug fixes that are not present in the ELPA version. In the = example below, the buffer undo-tree history variable has a count of 26 be= cause I typed each letter of the alphabet in lower case letters and I do = not use amalgamation -- i.e., every letter typed is separated by a buffer= undo boundary. [cl-struct-undo-tree [nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil= ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil ([nil = ([nil ([nil ([nil ([nil ([nil (#1=3D[nil nil ((26 . 27)) nil (22874 59645= 117315 0) 0 nil (((22874 59645 117309 0) . t)) nil nil]) ((25 . 26)) nil= (22874 59645 117331 0) 0 nil (((22874 59645 107309 0))) nil nil]) ((24 .= 25)) nil (22874 59645 117335 0) 0 nil (((22874 59645 97309 0))) nil nil]= ) ((23 . 24)) nil (22874 59645 117339 0) 0 nil (((22874 59645 87309 0))) = nil nil]) ((22 . 23)) nil (22874 59645 117343 0) 0 nil (((22874 59645 773= 09 0))) nil nil]) ((21 . 22)) nil (22874 59645 117347 0) 0 nil (((22874 5= 9645 67309 0))) nil nil]) ((20 . 21)) nil (22874 59645 117351 0) 0 nil ((= (22874 59645 57309 0))) nil nil]) ((19 . 20)) nil (22874 59645 117354 0) = 0 nil (((22874 59645 47309 0))) nil nil]) ((18 . 19)) nil (22874 59645 11= 7358 0) 0 nil (((22874 59645 37309 0))) nil nil]) ((17 . 18)) nil (22874 = 59645 117363 0) 0 nil (((22874 59645 27309 0))) nil nil]) ((16 . 17)) nil= (22874 59645 117366 0) 0 nil (((22874 59645 17309 0))) nil nil]) ((15 . = 16)) nil (22874 59645 117370 0) 0 nil (((22874 59645 7309 0))) nil nil]) = ((14 . 15)) nil (22874 59645 117374 0) 0 nil (((22874 59644 997309 0))) n= il nil]) ((13 . 14)) nil (22874 59645 117378 0) 0 nil (((22874 59644 9873= 09 0))) nil nil]) ((12 . 13)) nil (22874 59645 117382 0) 0 nil (((22874 5= 9644 977309 0))) nil nil]) ((11 . 12)) nil (22874 59645 117386 0) 0 nil (= ((22874 59644 967309 0))) nil nil]) ((10 . 11)) nil (22874 59645 117390 0= ) 0 nil (((22874 59644 957309 0))) nil nil]) ((9 . 10)) nil (22874 59645 = 117394 0) 0 nil (((22874 59644 947309 0))) nil nil]) ((8 . 9)) nil (22874= 59645 117398 0) 0 nil (((22874 59644 937309 0))) nil nil]) ((7 . 8)) nil= (22874 59645 117402 0) 0 nil (((22874 59644 927309 0))) nil nil]) ((6 . = 7)) nil (22874 59645 117405 0) 0 nil (((22874 59644 917309 0))) nil nil])= ((5 . 6)) nil (22874 59645 117409 0) 0 nil (((22874 59644 907309 0))) ni= l nil]) ((4 . 5)) nil (22874 59645 117413 0) 0 nil (((22874 59644 897309 = 0))) nil nil]) ((3 . 4)) nil (22874 59645 117417 0) 0 nil (((22874 59644 = 887309 0))) nil nil]) ((2 . 3)) nil (22874 59645 117420 0) 0 nil (((22874= 59644 877309 0))) nil nil]) ((1 . 2) (t 22874 59561 0 0)) nil (22874 596= 45 117425 0) 0 nil (((22874 59644 867309 0))) nil nil]) nil nil (22874 59= 632 379899 0) 0 nil (((0 0))) nil nil] #1# 216 26 nil #1#] The persistent undo history feature uses `prin1` to create a printed repr= esentation of the undo-tree history, which is saved to a file and then re= stored at a later point in time with the `read` command. Emacs 25.2.1 is= crashing on OSX Snow Leopard and also OSX El Capitan when the undo tree = history exceeds a count of approximately 6651. I have concluded that the= crashing is *not* due to a specific character recently typed, because I = was able to reproduce the crash typing a variety of characters -- followe= d by populating the undo-tree history variable, followed by `prin1`. My = most recent thinking/guessing is that perhaps the nesting of vectors and = nesting lists has something to do with the crashing. I have tried other = print functions such as `prin1-to-string` and `print`, which all cause th= e familiar crash. I am not proficient in using GDB, but have nevertheles= s included a backtrace below. I am saddened by the apparent reality that I may need to reduce my undo-t= ree history to a count limit of 6500, which seems rather small considerin= g that each character that I type would go towards that limit. It is pos= sible that some prior large undo/redo is contributing to the crashing, bu= t I was able to narrow it down to `prin1` working with a history count of= 6651 and I was able to "break the camel's back" repeatedly with just one= additional keystroke + populate history variable + prin1. I don't think= it is a garbage collection issue, because I tried binding let-binding (g= c-cons-threshold most-positive-fixnum) and the crash still occurred. Any= ideas on how to avoid crashing (other than truncating the size of my und= o tree history variable) would be greatly appreciated. Program received signal SIGSEGV, Segmentation fault. 0x0000000100141da7 in print_object (obj=3D4790542093, printcharfun=3D= 0,=20 escapeflag=3Dtrue) at print.c:1350 1350 { (gdb) bt full #0 0x0000000100141da7 in print_object (obj=3D4790542093, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1350 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\303o\024\034\001\000\000\000\350\345\211\= 035\001", '\000' , "\320\360:_\377\177" #1 0x000000010014261f in print_object (obj=3D4766068675, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1659 halftail =3D 4766068675 print_length =3D 9223372036854775807 i =3D 1 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\265=DE=89\035\001\000\000\000\350\345\211= \035\001", '\000' , "`\363:_\377\177" #2 0x0000000100143a77 in print_object (obj=3D, printc= harfun=3D0,=20 escapeflag=3Dtrue) at print.c:1965 idx =3D 0 tem =3D 4790542093 size =3D 10 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\243#\n\034\001\000\000\000\350\345\211\03= 5\001", '\000' , "\360\365:_\377\177" #3 0x000000010014261f in print_object (obj=3D4765393827, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1659 ---Type to continue, or q to quit--- Program rec= eived signal SIGSEGV, Segmentation fault. 0x0000000100141da7 in print_object (obj=3D4790542093, printcharfun=3D= 0,=20 escapeflag=3Dtrue) at print.c:1350 1350 { (gdb) bt full #0 0x0000000100141da7 in print_object (obj=3D4790542093, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1350 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\303o\024\034\001\000\000\000\350\345\211\= 035\001", '\000' , "\320\360:_\377\177" #1 0x000000010014261f in print_object (obj=3D4766068675, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1659 halftail =3D 4766068675 print_length =3D 9223372036854775807 i =3D 1 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\265=DE=89\035\001\000\000\000\350\345\211= \035\001", '\000' , "`\363:_\377\177" #2 0x0000000100143a77 in print_object (obj=3D, printc= harfun=3D0,=20 escapeflag=3Dtrue) at print.c:1965 idx =3D 0 tem =3D 4790542093 size =3D 10 buf =3D "\000\000\000\000\000\000\000\000\070\346\211\035\001= ", '\000' , "\243#\n\034\001\000\000\000\350\345\211\03= 5\001", '\000' , "\360\365:_\377\177" #3 0x000000010014261f in print_object (obj=3D4765393827, printcharfu= n=3D0,=20 escapeflag=3Dtrue) at print.c:1659 ---Type to continue, or q to quit---