From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.bugs Subject: bug#42931: 27.1; json-pretty-print-buffer on ~2MB line causes core dump Date: Thu, 20 Aug 2020 15:26:06 +0200 Message-ID: References: <0b9da4d7-ca24-8e00-d49f-7630e42abe89@orcon.net.nz> <87364i2039.fsf@gnus.org> <831rk2eka9.fsf@gnu.org> <87imddwiy0.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10015"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Phil Sainty , 42931@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 20 15:27: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 1k8kb9-0002SO-85 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 15:27:19 +0200 Original-Received: from localhost ([::1]:38784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8kb8-0006sy-BO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Aug 2020 09:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8kas-0006pl-Ny for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 09:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k8kas-0001Yk-DW for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 09:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k8kas-0006i3-B2 for bug-gnu-emacs@gnu.org; Thu, 20 Aug 2020 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Stephani Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 20 Aug 2020 13:27:02 +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.159792998625729 (code B ref 42931); Thu, 20 Aug 2020 13:27:02 +0000 Original-Received: (at 42931) by debbugs.gnu.org; 20 Aug 2020 13:26:26 +0000 Original-Received: from localhost ([127.0.0.1]:41973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8kaI-0006gu-1h for submit@debbugs.gnu.org; Thu, 20 Aug 2020 09:26:26 -0400 Original-Received: from mail-ot1-f50.google.com ([209.85.210.50]:43688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8kaF-0006gh-I0 for 42931@debbugs.gnu.org; Thu, 20 Aug 2020 09:26:24 -0400 Original-Received: by mail-ot1-f50.google.com with SMTP id r21so1413696ota.10 for <42931@debbugs.gnu.org>; Thu, 20 Aug 2020 06:26:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UDYKkKJGi8TFyAdUAClPCv0u9/rEPT1LEYkb9toyI0U=; b=U9sFYv+xDcNwG6W0q4NHNzww2X/ZXg44fz/WRFX0KJygOQ61DSdTM/EVBUuxdz6iNq QtUJ8HKxnEvuBU1nPbtIuCe0BqYcVcAmU2qsdqotf9Z9S41SiJOopKwjCFkfSOjrDkcW cyt0+nzwEMB/l+yfSJg5hJL5iLDe0caYrOAbb3SaghDYg5TJk/ZQRQv26ZcD6QeqGaZ8 8Wvjo7FgMY8ynMVsu0EqeBzYwDPqDQ+g0azHSG4ziqo4cTW+3QX7lYLv0qzknDlzmhrY CJkMo4cGfoG5O5fFpr0dAvt53N2VmyQ2BSVDvvgLBTM0bPCdFY7MtA6Iv4fcTISZmaYF lKyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UDYKkKJGi8TFyAdUAClPCv0u9/rEPT1LEYkb9toyI0U=; b=SX9tOCa/i0JM4fsu59+1FrM/dVjbPNNgdtggeYtSrJi9BqApm5BdKTwJ0+6Y5YfLec 3qteEc47ppAIfotq45AMS5mT87hflt9h+jUdYcuQhYhFfCw2JbHWvWIYves+DlfjOOQD PVzUbey3nRKPbOQdZfImyl2e00Y5AicLMW0R66teDqAwVgDX1tK7kQAj8pbksn33mwHw bxsWf1vCmm/4x4X8oPO9ao0+QuR31EYnE2dPttxEdq6+cTiTPdhPEwefnbEzAfHA+rxt kdIp9/JAXQNWSDLfq/h+nuZtrz6VB+cc4XIneQjLm61h7UiXc4hGNlfRnwy5toAoUs8T BWvw== X-Gm-Message-State: AOAM533ixCw7k73pHicAEVsl0rcKvDX3LGwocvvcI/FpKFN3GKLezMn2 axVxM+4hHVVDCOnGI+XKPA+pvH4m/+pvH8WqI98= X-Google-Smtp-Source: ABdhPJwezyqrJiAu9S3scVGDf2rJfINgattsVrHiqOu57eirHIm1/Trp0uUZd+YUiaG1CTK6SbxcyvDchB2WwPTIfQ4= X-Received: by 2002:a9d:20c1:: with SMTP id x59mr2106666ota.36.1597929977692; Thu, 20 Aug 2020 06:26:17 -0700 (PDT) In-Reply-To: <87imddwiy0.fsf@gnus.org> 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:185685 Archived-At: Am Do., 20. Aug. 2020 um 15:23 Uhr schrieb Lars Ingebrigtsen : > > Eli Zaretskii writes: > > > looks like stack overflow? I guess the recursive nature of compareseq > > is got to cause this at some point? > > Yup. > > I'm not sure what to do about it, though. One easy way to "fix this" > would be to not use replace-region-contents in json-pretty-print if the > region is very large... but that's kinda just wallpapering over the > problem. > > replace-region-contents itself could decide to not do all its fancy > stuff if the region is very large, and just replace the contents in the > normal way instead? I guess the underlying function (compareseq) should protect against unbounded recursion and fall back to a more coarse diff if necessary.