D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8083 - Throwing in a loop results in infinite bypassing exception messages
Summary: Throwing in a loop results in infinite bypassing exception messages
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
: 8455 (view as issue list)
Depends on:
Blocks:
 
Reported: 2012-05-11 03:33 UTC by Denis Shelomovskii
Modified: 2020-06-06 07:27 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2012-05-11 03:33:14 UTC
---
import std.stdio;

void main() {
//  for (auto bc = File.ByChunk(File(""), 1); ; ) { } // as expected
//  for (auto bc = File("").byChunk(1);  false; ) { } // as expected
    for (auto bc = File("").byChunk(1); ; ) { } // infinite loop
    foreach(line; File("").byLine()) { }        // infinite loop too
}
---
It writes this in infinite loop:

Bypasses std.exception.ErrnoException@std\stdio.d(288)
=== Bypassed ===
std.exception.ErrnoException@std\stdio.d(288): Cannot open file `' in mode `rb' (No error)


Not sure is it dmd or druntime issue.
Comment 1 Denis Shelomovskii 2013-11-07 09:01:38 UTC
Original testcase works fine now but I'd like to keep it opened as source issue is still unknown.
Comment 2 Denis Shelomovskii 2013-11-07 09:29:30 UTC
*** Issue 8455 has been marked as a duplicate of this issue. ***
Comment 3 Vladimir Panteleev 2017-07-02 02:35:09 UTC
Fixed by https://github.com/dlang/dmd/pull/1645.