[Issue 6308] Destruction of temporaries on exception causes unhandled access violation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 26 09:25:20 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6308



--- Comment #11 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2011-08-26 09:25:16 PDT ---
This code:

import std.file;
void main()
{
    string[] dirs;
    foreach (string dir; dirEntries(r"C:\", SpanMode.shallow))
    {
        if (dir.isDir)
            dirs ~= dir;
    }
}


Compiled via DMD 2.055 commit cfab198ee186f6e69c364aaf4206434220d83204 (Aug
15), enters an infinite loop at runtime where exceptions are kept throwing:

=== Bypassed ===
std.file.FileException at std\file.d(1156): C:\pagefile.sys: The process cannot
access the file because it is being used by
another process.
----------------
42A540
42A3B7
402A7D
40206D
402950
40298F
40258B
45B855
45B7AC
----------------
object.Error: Access Violation
----------------
42A540
42A3B7
402950
40298F
40258B
45B855
45B7AC
----------------
Bypasses std.file.FileException at std\file.d(1156)
object.Error: Access Violation
----------------
42A540
42A3B7
402950
40298F
40258B
45B855
45B7AC
----------------
object.Error: Access Violation
----------------
42A540
42A3B7
402950
40298F
40258B
45B855
45B7AC

It seems after it tries to open the protected pagefile.sys it keeps rethrowing
exceptions and not exiting the foreach loop. It doesn't stop at all, just keeps
rethrowing.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list