From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#30626: 26.0.91; Crash when traversing a `stream-of-directory-files' Date: Thu, 25 Apr 2019 07:19:29 +0200 Message-ID: <87y33ybr1a.fsf@web.de> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <87lgfd52by.fsf@gmail.com> <87bmg91ity.fsf@web.de> <87imv2rcs3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="110526"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Nicolas Petton , 30626@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 25 08:31:40 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJXv2-000RkL-D3 for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Apr 2019 08:31:40 +0200 Original-Received: from localhost ([127.0.0.1]:52169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJXDC-0003xo-IK for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Apr 2019 01:46:22 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJX4A-0003hD-SM for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2019 01:37:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJWni-00026K-Qy for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2019 01:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43646) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJWni-00025Y-Nt for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2019 01:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJWni-0006B5-Db for bug-gnu-emacs@gnu.org; Thu, 25 Apr 2019 01:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Apr 2019 05:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30626 X-GNU-PR-Package: emacs Original-Received: via spool by 30626-submit@debbugs.gnu.org id=B30626.155616958523721 (code B ref 30626); Thu, 25 Apr 2019 05:20:02 +0000 Original-Received: (at 30626) by debbugs.gnu.org; 25 Apr 2019 05:19:45 +0000 Original-Received: from localhost ([127.0.0.1]:57190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJWnR-0006AX-1Y for submit@debbugs.gnu.org; Thu, 25 Apr 2019 01:19:45 -0400 Original-Received: from mout.web.de ([212.227.17.12]:57307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hJWnN-0006AI-OU for 30626@debbugs.gnu.org; Thu, 25 Apr 2019 01:19:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1556169572; bh=v6n8kdiJ/RtjD9IUkmoXiexax+3YXqsXRQrWOAczMw4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=gRbPvWiSpqkMnV5UJ0ZU5YMOs/nSda0/pZ8oxPxwJ39H4HGhVsBGTEcM4JrCAUWFR 7t8lZBQmCh2kJKhAH2tkCjQHPmKidUeBGzCgQKoFTf1v6adSSZPKlJ8Pyxpvi6Gid9 vH7MmnbRF8cI+fjJRnJbBl/vqs5uwXylArYEET3w= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([92.208.87.27]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LsyRS-1geOG93ogE-012WbG; Thu, 25 Apr 2019 07:19:32 +0200 In-Reply-To: <87imv2rcs3.fsf@gmail.com> (Noam Postavsky's message of "Wed, 24 Apr 2019 23:20:44 -0400") X-Provags-ID: V03:K1:GZ3hp7V2dZLnUhpXb2T5jiArBSLqmaVMGCbLHpFwqxjnxn6mFo+ CbbGP/dPmIB+gVRVvrWpBfEkRJA9VGX6B2zsPGHU2lg4sC+uAMLMoaosw+2gLWDCfNOVBcZ /gmUDAiLjuYdGqQcBpvZudCIBWeyUJrSjvVL7wz0ZS7QJFKY6j4pm7v0QNpAHKfHhhIVolM JlOz8WiYiOp4pIfnajZAA== X-UI-Out-Filterresults: notjunk:1;V03:K0:PKtHVc7jjCs=:CHM/QdDvhyGNWgwcNULUkU hT5WCP7sWuBE7ywIt5QxDM067dXN6M3n1V9mzMg2YbcoepOXObooIk/tRG274V5r+CyZigeDu Eu/IO7BiI522OgMfXXz6L7qFOHKsz1nuJPW+y/lzT5qlKtUgw+65i6ug5aqvCjzyAZQLpS4tq Rh7OAp6N7Gf5Z9rkgAtpAA41WNYSanu2h/dn/FJ7rmCy+8/Gr8Aal+8IAHeJEtCAmZJp9TCoN 8vrzusGjOMyshy2AGnRr5OmEUJDuiQpexQgKRUpH6ETKTnKgWlnbbgHKZ1fVInKosAm8A99z6 ZO8PsvoXbgiyKhWGnlW4ggOOJGNGBtDuiEonzswTZZ32dtO7QuV6AZoEV37CrY4i7SdyQa7fz lb2Cr4AgJ5jxe4d3aitav1TrGoftkUVBQomCvlcoZxPpDHspvC02cARWAZjqawyxytDsa/qDo hW0lE25TAQs6UOniHu9NMJBEoR44UkHOlb+PAil46e9guW74CsG6DcguxbSn7gkuRSVahzLEy cDGfsVDFTI1JZVtkBES3Eg6ja/E2/DZ/I2k0JJ4vM704N3Jdag1Zo9zgxCnI25In3ECibnqRR Q9WMKlCG3YFWT77CEDgmdImhjMmrmiG1QPzRYCvZw44d0i1941xEIcLLzAlFdPwC8rUOhPZMp Ydl2o3fWHitZcsRXWFC/U7z9j9A2TW7AbeMio+3yTmvFRfWyK8sHv2UzYhWVY53HbEGcyBnU8 7N8X9Rr0MUN5RIW9ZcpZDGOeK1JculBSdGXjzh5Y9BK+UUU28sLjU47enUfQ/NiYljGBih4J 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: 209.51.188.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:158226 Archived-At: Noam Postavsky writes: > Coming back to this again. I think I got lost in the weeds of the > byte-code function objects before. The core problem is that streams > are not exactly encoded like the above, because even after forcing it > you don't have just a plain SECOND-VALUE stored in the stream. The > original FUNCTION-TO-PRODUCE-MORE-REST-OF-LIST stays around and keeps > referencing all the code and all the following elements. So a > possible solution is change the stream to get rid of the lambda part > and just leave the computed value after it's forced. With the > following patch (stream-flush (stream-range 1 1000000)) succeeds: > > [Patch...] Works for me, and it makes sense. As a test case I recompiled el-search.el (it uses streams for several things) with your patch applied to stream.el, and it worked well. > Some additional things that I thought of changing, but I didn't yet: > - stream--identifier vs just using '--stream-- directly, I don't see > what's the benefit of indirection here. A matter of taste I guess. > - stream-make should use cons instead of list (or maybe a struct?). I think cons would be ok. Would a struct make things slower? > - stream-empty should just be a constant. Dunno if there are cases where this would be problematic, but I guess we could do this as well. Anyway, thanks for looking into this again, I like your solution. Maybe Nicolas can also chime in. Michael.