From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30626: 26.0.91; Crash when traversing a `stream-of-directory-files' Date: Fri, 02 Mar 2018 08:01:16 -0500 Message-ID: <878tba4oo3.fsf@gmail.com> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <5d5ccb32-434a-cda9-67c4-c60abeb450df@dancol.org> <87muzrg2hq.fsf@web.de> <87fu5jeyyg.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1519995613 1709 195.159.176.226 (2 Mar 2018 13:00:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Mar 2018 13:00:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 30626@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 02 14:00:09 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 1erkIA-00086n-MY for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Mar 2018 14:00:06 +0100 Original-Received: from localhost ([::1]:34853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erkKD-0000ym-8F for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Mar 2018 08:02:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erkK7-0000yY-MV for bug-gnu-emacs@gnu.org; Fri, 02 Mar 2018 08:02:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erkK2-0006kt-Rp for bug-gnu-emacs@gnu.org; Fri, 02 Mar 2018 08:02:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:60564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erkK2-0006ke-Nh for bug-gnu-emacs@gnu.org; Fri, 02 Mar 2018 08:02:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1erkK2-00082g-A2 for bug-gnu-emacs@gnu.org; Fri, 02 Mar 2018 08:02:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Mar 2018 13:02: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: Original-Received: via spool by 30626-submit@debbugs.gnu.org id=B30626.151999568729219 (code B ref 30626); Fri, 02 Mar 2018 13:02:02 +0000 Original-Received: (at 30626) by debbugs.gnu.org; 2 Mar 2018 13:01:27 +0000 Original-Received: from localhost ([127.0.0.1]:40228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erkJT-0007ay-Bd for submit@debbugs.gnu.org; Fri, 02 Mar 2018 08:01:27 -0500 Original-Received: from mail-io0-f176.google.com ([209.85.223.176]:34433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1erkJS-0007Us-7L for 30626@debbugs.gnu.org; Fri, 02 Mar 2018 08:01:26 -0500 Original-Received: by mail-io0-f176.google.com with SMTP id e7so10552545ioj.1 for <30626@debbugs.gnu.org>; Fri, 02 Mar 2018 05:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=YmEavTgt1rdL9FdqjtV5K2D2HbFinXHIPeUDCwyhqCQ=; b=UStxfH5q48Z42aNUuenCp4aVPkitvVkNL7H6gVL0FiGjlrcTjLuxyVKzNyXAJ7f5rT Gpd2qZubzNA0SdBPypECjM57maNxFv7JRbR/8YvLUifbMVnUydNF5PIVclQF2FhNJtLR u9reQMWu5tvmXFvr3vPpbjxguq9wgoB3x+TdMFrA+BgvFk/pLUq5rZEMxxbTkOFAcZdf aLr+v0pXVLTnO/wgK87/sDc4+JwflvkUW7DIoki1dLMIwjFksBXBHh3VoBZusrEcGgwH D5w2i2+NV/BaVl16jd8xxDdRAuKbdfLY/jQ8mqWnE1FwmLdlZ3U/JY+NXW8sjLEoHkfS nU+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=YmEavTgt1rdL9FdqjtV5K2D2HbFinXHIPeUDCwyhqCQ=; b=WZEDTQwjspweakbq/VDdOJDZj1XKrOvHr53hD4jAB5ZyIuSD0tSSWEieQr9y6mE4L1 27lkIjnfrTfEzEjz0OPjw2vUUWWEMh1NgE9zgGyrqXwXX9mMzXZyFpfkh03gTQkD952H 8e1VhTU447i58H6nRHSekked3wUrj/2KjSaF331S8yYovw92LUntNINhdD47zFwa5NZs ZnVgz33qCBgqzz92wXUkhoWXvi/6t8Kv5SFowv3rB7SFLCL5LObrotNPic1xPDju7BpY VpS4YCXxx4t1T0velvuAG7V+LOQmImLqPb59ToxuAoqZM93q8CYotAChY4e/Py9SSZi5 Nuag== X-Gm-Message-State: AElRT7GPGLJuL1CpO5pcp8YOEjzLS6Jht5eu46uK+5fQ1qvkAHSkwBQ0 +eP4sagiNl8eaaIZor9qutA6kA== X-Google-Smtp-Source: AG47ELtdyf5b4JoyzIjI+Q5HQK34ZBQs+KQIWajDhqCHv/y8mJSgiFweQcs+wFNSoES+FO5NlU5uMg== X-Received: by 10.107.134.95 with SMTP id i92mr6332864iod.210.1519995680384; Fri, 02 Mar 2018 05:01:20 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id c91sm4425920iod.16.2018.03.02.05.01.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Mar 2018 05:01:18 -0800 (PST) In-Reply-To: <87fu5jeyyg.fsf@web.de> (Michael Heerdegen's message of "Fri, 02 Mar 2018 08:08:55 +0100") 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:143833 Archived-At: Michael Heerdegen writes: > Noam Postavsky writes: > >> Maybe I've misunderstood, but is it not the case that iterating over >> (stream-range 1 n) should require only a constant amount of memory, >> regardless of the value of n? > > Depends on your definition of `require'. Like, for example, > > (dolist (i 1000000) (message "%S" (cons i (1+ i)))) > > each iteration step creates and discards a new cons (or a constant > number of conses). Not a exceptional thing in Lisp. When iterating > over (stream-range 1 n), the garbage collector seems to have problems > with how the garbage is structured. Ah, so let me be more precise. Iterating over (stream-range 1 n) should require only a constant amount of *reachable* memory at any particular instant. So your example above is okay, but the following one would be not acceptable (I mean, it's fine if some random lisp code does that, but stream-range should not be creating such long lists, or equivalently large structures): (let ((list nil)) (dotimes (i 1000000) (push i list) (message "%S" (car list))))