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: Sat, 17 Mar 2018 13:28:22 -0400 Message-ID: <87y3iqtxvt.fsf@gmail.com> References: <87inaiss6l.fsf@web.de> <87po4pnl0a.fsf@web.de> <837eqxyqoe.fsf@gnu.org> <87lgfdnf86.fsf@web.de> <87muzs11hk.fsf@web.de> <87606e4lel.fsf@gmail.com> <87lgf83gun.fsf@gmail.com> <87fu5f3kcr.fsf@gmail.com> <83lgf7u644.fsf@gnu.org> <87bmfuzbq1.fsf@gmail.com> <83vae2s6b6.fsf@gnu.org> <876062z3fs.fsf@gmail.com> <83sh96rmzw.fsf@gnu.org> <87lgewybtu.fsf@gmail.com> <834llkrmdc.fsf@gnu.org> <87in9zy0uq.fsf@gmail.com> <83605xqovr.fsf@gnu.org> <871sgivgu7.fsf@gmail.com> <83d102ptsf.fsf@gnu.org> <83bmfmpszp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1521307636 29585 195.159.176.226 (17 Mar 2018 17:27:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Mar 2018 17:27:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: michael_heerdegen@web.de, john.b.mastro@gmail.com, nicolas@petton.fr, 30626@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 17 18:27:11 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 1exFbp-0007Yd-Dn for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Mar 2018 18:27:09 +0100 Original-Received: from localhost ([::1]:34449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exFds-0001sv-Eo for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Mar 2018 13:29:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exFdh-0001sb-RA for bug-gnu-emacs@gnu.org; Sat, 17 Mar 2018 13:29:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exFde-0004u6-Ni for bug-gnu-emacs@gnu.org; Sat, 17 Mar 2018 13:29:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58949) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exFde-0004sQ-Ji for bug-gnu-emacs@gnu.org; Sat, 17 Mar 2018 13:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1exFde-0004JH-Ae for bug-gnu-emacs@gnu.org; Sat, 17 Mar 2018 13:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Mar 2018 17:29: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.152130771216522 (code B ref 30626); Sat, 17 Mar 2018 17:29:02 +0000 Original-Received: (at 30626) by debbugs.gnu.org; 17 Mar 2018 17:28:32 +0000 Original-Received: from localhost ([127.0.0.1]:38613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exFd9-0004IQ-NU for submit@debbugs.gnu.org; Sat, 17 Mar 2018 13:28:31 -0400 Original-Received: from mail-io0-f170.google.com ([209.85.223.170]:46757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exFd8-0004IB-1C for 30626@debbugs.gnu.org; Sat, 17 Mar 2018 13:28:30 -0400 Original-Received: by mail-io0-f170.google.com with SMTP id g14so7249483iob.13 for <30626@debbugs.gnu.org>; Sat, 17 Mar 2018 10:28:29 -0700 (PDT) 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=rotUGgFAkrC/uSFnRYSgOiyyyTgUJbmE2pNmgesDGiw=; b=rIqJHFNYGmYVbY3hEI8ddXXBPNGAytLgWxeWHXDxrPfdJb6zYk4+vK6CmJajl71yD4 hKE4b0MHXh36vQHLqtHXR5cLYPGAFcwb2Vnzaj+0A/i74tCRxZarwuAufm3xxp2juc+j 1ztIhaybP3KVjPL0rs6eei+XcXB15fRP6qxYismVDAPBRy73X4ESPK62zzNIYnj07y8a k0NwWSQLjJQQQTFPlnzwxRT93RjlKOnFQ8xRUfnG6z9MnMLXCfJ0kV0dz/CPT208sypz +akoMktp0noCm2X0tO7GhO0CM9k/yQZa/s1Bq8qceMObqMjuBsfIj9Ek1OW8QoxSC1k4 sLHg== 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=rotUGgFAkrC/uSFnRYSgOiyyyTgUJbmE2pNmgesDGiw=; b=IuBGFbpWIAStL8+mEBiF3ZhDwkbUeHn1CtxaWfjFvg1HZi3DEqUpGs5YZ9Xx3YA4yw mUpIUBWx3lAu4ikXV6jYc8ZHkoDzi1XvxstNrx5xpDTrrV6JbNX0dabN/df9vALhpH3m +bG15R8aTHnzLifm2pv+Z8PyZoIXf7/FlnVtg67jszz9SI08uPJH0/027gUjXyTpqZgB 7XRz6k47727lUOCzXmHS/typ3KHuE5MMGckp3Atv1hP+jQzFq8QNq6hE1DUy48U/hyoJ zSYAnvQ1sZ/OJj1BrHM5o56TLYMxHMcPfJ1vs0T5E4F6FdKoMCMWCRcbc88dIPTvshlk fdYQ== X-Gm-Message-State: AElRT7HUSDjukflhfMyPKrrwtvKJgrZMIQlhxuPxbghhyjPaZl3kpsTO 9tMUSsA1MtDihTNIpFXN2JcQ/6KS X-Google-Smtp-Source: AG47ELuZuFV72WAJatudTQBi+5iLq+yFNroqcRx9SclTtz0rHB80lj5NdvoBAQWEqFoYLiAcUkFifQ== X-Received: by 10.107.51.78 with SMTP id z75mr6629859ioz.291.1521307704229; Sat, 17 Mar 2018 10:28:24 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id 12-v6sm2846047itm.0.2018.03.17.10.28.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Mar 2018 10:28:23 -0700 (PDT) In-Reply-To: <83bmfmpszp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Mar 2018 18:27:38 +0200") 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:144374 Archived-At: Eli Zaretskii writes: >> The goal was to find out which variable holds a reference to the >> entire long stream, right? So it sounds like a pointer to it is kept >> in an automatic variable on the stack of exec_byte_code, right? Which >> kinda makes sense, since the stream is still being processed, I >> think. Yeah, but which variable exactly? I'd like to find it and add 'X = Qnil;' to confirm we've found where it is. > Actually, there's still some mystery: if this object is a 7-element > vector, where do all the other GC frame come from? Hmm... how > long/deep is each of the cons cells in elements 1 through 4 of the > vector? If they are deeply nested, then that's the answer we've been > looking for, I think. It's a bit confusing because of the indirection: stream-range uses the stream-cons macro, which uses the stream-make macro, which uses the thunk-delay macro. I believe the end result is that the lexical environment of the resulting closure has access to the next stream-element in the chain, so the nesting depth is the length of the stream (i.e., 100000 in the example). Perhaps this example makes it clearer: (setq print-circle t) (let* ((s0 (stream-range 1 2)) (s1 (stream-rest s0))) (list s0 s1)) ;=> ((--stream-- #[256 "\211\203..." [(1) 2 (1) (t) ((1 . #1=(--stream-- #[256 "\211\203..." [(nil) (nil) nil t] 3 "\n\n(fn &optional CHECK)"]))) stream-range t] 7 "\n\n(fn &optional CHECK)"]) #1#)