GNU bug report logs -
#30626
26.0.91; Crash when traversing a `stream-of-directory-files'
Previous Next
Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>
Date: Tue, 27 Feb 2018 09:23:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 26.0.91
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #184 received at control <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 30626 + patch
quit
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>> > - stream-make should use cons instead of list (or maybe a struct?).
>>
>> I think cons would be ok. Would a struct make things slower?
A struct might be slower, and cons has the advantage that the print
output is more readable for humans too. E.g., with this code:
(let ((s (stream-range 1 5)))
(stream-flush s)
s)
;; Using cons (patch in this message):
(--stream-evald-- 1 --stream-evald-- 2 --stream-evald-- 3 --stream-evald-- 4 --stream-evald--)
;; Using list (previous patch):
(--stream-evald-- (1 --stream-evald-- (2 --stream-evald-- (3 --stream-evald-- (4 --stream-evald-- nil)))))
;; I guess using a struct would look something like this:
#(--stream-evald-- (1 . #(--stream-evald-- (2 . #(--stream-evald-- (3 . #(--stream-evald-- (4 . #(--stream-evald-- nil)))))))))
;; Using list with thunk (current, v2.2.4)
(--stream-- #[256 "\211\203\007\0\303\242\207\303\242\204 \0\304\300\242\305\300\242\302\242\\\301\302\242#B\240\210\303\306\240\210\304\242\207" [(1) 5 (1) (t) ((1 --stream-- #[256 "\211\203\007\0\303\242\207\303\242\204 \0\304\300\242\305\300\242\302\242\\\301\302\242#B\240\210\303\306\240\210\304\242\207" [(2) 5 (1) (t) ((2 --stream-- #[256 "\211\203\007\0\303\242\207\303\242\204 \0\304\300\242\305\300\242\302\242\\\301\302\242#B\240\210\303\306\240\210\304\242\207" [(3) 5 (1) (t) ((3 --stream-- #[256 "\211\203\007\0\303\242\207\303\242\204 \0\304\300\242\305\300\242\302\242\\\301\302\242#B\240\210\303\306\240\210\304\242\207" [(4) 5 (1) (t) ((4 --stream-- #[256 "\211\203\007\0\300\242\207\300\242\204\024\0\301\302\240\210\300\303\240\210\301\242\207" [(t) (nil) nil t] 3 "
(fn &optional CHECK)"])) stream-range t] 7 "
(fn &optional CHECK)"])) stream-range t] 7 "
(fn &optional CHECK)"])) stream-range t] 7 "
(fn &optional CHECK)"])) stream-range t] 7 "
(fn &optional CHECK)"])
>> > - 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.
I've done this in the patch below. Passes all the tests, and I can't
see why it would be problematic.
> @Nicolas: Do you want us to care about this or do you want to have a
> look yourself? I don't want to hurry, I just don't want this to be
> forgotten. If you say you have time in four months, it's still ok.
Not getting any response; I'll wait another week for comments and then
push.
[0001-Drop-forced-lambda-s-from-stream-Bug-30626.patch (text/plain, attachment)]
This bug report was last modified 6 years and 44 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.