From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#42931: 27.1; json-pretty-print-buffer on ~2MB line causes core dump Date: Mon, 24 Aug 2020 16:46:01 -0700 Organization: UCLA Computer Science Department Message-ID: <14e2aff5-20e3-03a3-50ae-cfabee5bc406@cs.ucla.edu> References: <0b9da4d7-ca24-8e00-d49f-7630e42abe89@orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15091"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: 42931@debbugs.gnu.org, Philipp Stephani , Bruno Haible , Lars Ingebrigtsen To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 25 01:47:09 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 1kAMBB-0003no-JI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 01:47:09 +0200 Original-Received: from localhost ([::1]:48052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAMBA-0000CB-MI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Aug 2020 19:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAMB4-0000Br-7t for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 19:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAMB3-000333-UZ for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 19:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAMB3-0005zC-S6 for bug-gnu-emacs@gnu.org; Mon, 24 Aug 2020 19:47:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <0b9da4d7-ca24-8e00-d49f-7630e42abe89@orcon.net.nz> Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Aug 2020 23:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42931 X-GNU-PR-Package: emacs Original-Received: via spool by 42931-submit@debbugs.gnu.org id=B42931.159831277022949 (code B ref 42931); Mon, 24 Aug 2020 23:47:01 +0000 Original-Received: (at 42931) by debbugs.gnu.org; 24 Aug 2020 23:46:10 +0000 Original-Received: from localhost ([127.0.0.1]:59582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAMAE-0005y5-0X for submit@debbugs.gnu.org; Mon, 24 Aug 2020 19:46:10 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:40938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAMAC-0005xr-1C for 42931@debbugs.gnu.org; Mon, 24 Aug 2020 19:46:09 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 831821600E2; Mon, 24 Aug 2020 16:46:02 -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 MVuUibuO4aHK; Mon, 24 Aug 2020 16:46:01 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8D0071600FD; Mon, 24 Aug 2020 16:46:01 -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 GXnl2XN6ZgUZ; Mon, 24 Aug 2020 16:46:01 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-75-82-69-226.socal.res.rr.com [75.82.69.226]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 5577D1600E2; Mon, 24 Aug 2020 16:46:01 -0700 (PDT) Autocrypt: addr=eggert@cs.ucla.edu; prefer-encrypt=mutual; keydata= LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCgptUUlOQkV5QWNtUUJFQURB QXlIMnhvVHU3cHBHNUQzYThGTVpFb243NGRDdmM0K3ExWEEySjJ0QnkycHdhVHFmCmhweHhk R0E5Smo1MFVKM1BENGJTVUVnTjh0TFowc2FuNDdsNVhUQUZMaTI0NTZjaVNsNW04c0thSGxH ZHQ5WG0KQUF0bVhxZVpWSVlYL1VGUzk2ZkR6ZjR4aEVtbS95N0xiWUVQUWRVZHh1NDd4QTVL aFRZcDVibHRGM1dZRHoxWQpnZDdneDA3QXV3cDdpdzdlTnZub0RUQWxLQWw4S1lEWnpiRE5D UUdFYnBZM2VmWkl2UGRlSStGV1FONFcra2doCnkrUDZhdTZQcklJaFlyYWV1YTdYRGRiMkxT MWVuM1NzbUUzUWpxZlJxSS9BMnVlOEpNd3N2WGUvV0szOEV6czYKeDc0aVRhcUkzQUZINmls QWhEcXBNbmQvbXNTRVNORnQ3NkRpTzFaS1FNcjlhbVZQa25qZlBtSklTcWRoZ0IxRApsRWR3 MzRzUk9mNlY4bVp3MHhmcVQ2UEtFNDZMY0ZlZnpzMGtiZzRHT1JmOHZqRzJTZjF0azVlVThN Qml5Ti9iClowM2JLTmpOWU1wT0REUVF3dVA4NGtZTGtYMndCeHhNQWhCeHdiRFZadWR6eERa SjFDMlZYdWpDT0pWeHEya2wKakJNOUVUWXVVR3FkNzVBVzJMWHJMdzYrTXVJc0hGQVlBZ1Jy NytLY3dEZ0JBZndoU Content-Language: en-US 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:186227 Archived-At: The patch I installed into Emacs master for Bug#43016 also fixes Bug#42931's test case, at least for me. However, Bug#42931 prompted me to change the way that the Gnulib diffseq module recurses so that the stack size is O(log N) rather than O(N). I installed this change into Gnulib, here: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=7aadb23803a8fb71d07e6e87ffb1ca510d86f8ef and propagated this into Emacs master, here: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=d494f9e81a6d11dcf6c22333cd950989b2051dff I doubt whether this patch needs to be backported into the emacs-27 branch. In theory even O(log N) might not be good enough if Emacs has a tiny stack and a huge buffer, but I doubt whether this is of practical concern. I'll cc this to Bruno Haible to give him a heads-up, since he created the diffseq module. Bruno, the bug report is here: https://bugs.gnu.org/42931