From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30626: 26.0.91; Crash when traversing a `stream-of-directory-files' Date: Tue, 27 Feb 2018 20:08:56 +0200 Message-ID: <83zi3uz4nb.fsf@gnu.org> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1519754936 16294 195.159.176.226 (27 Feb 2018 18:08:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2018 18:08:56 +0000 (UTC) Cc: 30626@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 27 19:08:52 2018 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 1eqjgI-0003jP-Sd for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Feb 2018 19:08:50 +0100 Original-Received: from localhost ([::1]:39237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqjiL-0001KH-DW for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Feb 2018 13:10:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqjhX-0000kg-PL for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:10:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqjhS-0004A7-P6 for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:10:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56258) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqjhS-00049k-L8 for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eqjhS-0002sj-FG for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Feb 2018 18:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, 30626@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.151975495711022 (code B ref -1); Tue, 27 Feb 2018 18:10:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Feb 2018 18:09:17 +0000 Original-Received: from localhost ([127.0.0.1]:35922 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqjgi-0002ri-NF for submit@debbugs.gnu.org; Tue, 27 Feb 2018 13:09:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqjgg-0002rV-SY for submit@debbugs.gnu.org; Tue, 27 Feb 2018 13:09:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqjga-0003PT-S6 for submit@debbugs.gnu.org; Tue, 27 Feb 2018 13:09:09 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqjga-0003PF-Oz for submit@debbugs.gnu.org; Tue, 27 Feb 2018 13:09:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqjgV-0000D0-Nq for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:09:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqjgU-0003N1-Qp for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2018 13:09:03 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqjgK-0003F4-CH; Tue, 27 Feb 2018 13:08:52 -0500 Original-Received: from [176.228.60.248] (port=2496 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eqjgI-0008NF-UI; Tue, 27 Feb 2018 13:08:51 -0500 In-reply-to: <877eqyocro.fsf@web.de> (message from Michael Heerdegen on Tue, 27 Feb 2018 13:08:59 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:143712 Archived-At: > From: Michael Heerdegen > Cc: bug-gnu-emacs@gnu.org, 30626@debbugs.gnu.org > Date: Tue, 27 Feb 2018 13:08:59 +0100 > > #+begin_src emacs-lisp > (seq-doseq (_ (stream-range 1 1000000)) nil) > #+end_src > > Note that this is executed as a loop due how to streams are implemented, > although the definition of `seq-doseq' looks recursive. But it seems > that gc has a problem with the large number of conses created when > processing that. What can we do instead in such cases? Stack-overflow protection cannot work in GC, so you are shooting yourself in the foot by creating such large recursive structures. By the time we get to GC, where the problem will happen, it's too late, because the memory was already allocated. Does anyone has a reasonable idea for avoiding the crash in such programs?