digitalmars.D.bugs - [Issue 7244] New: Access Violation with optimized build when using memory-mapped file
- d-bugmail puremagic.com (49/49) Jan 07 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7244
- d-bugmail puremagic.com (6/6) Apr 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7244
http://d.puremagic.com/issues/show_bug.cgi?id=7244 Summary: Access Violation with optimized build when using memory-mapped file Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: andrej.mitrovich gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-07 19:53:30 PST --- I am *not* sure if the following code is correct, it's copied from another source and I've never used memory-mapped files before: module test; import std.algorithm; import std.mmfile; void readfile(string filename) { string[] lines; auto fFile = new MmFile(filename); auto fBuffer = cast(char*)(fFile[].ptr); auto fLength = cast(size_t)fFile.length; auto textData = fBuffer[0 .. fLength]; foreach (char[] line; splitter(textData, "\n")) lines ~= line.idup; } void main() { readfile("datetime.d"); } This only happens when reading large files like std.datetime: $ dmd test.d && test.exe ok $ dmd -O test.d && test.exe object.Error: Access Violation ---------------- ---------------- ddbg says: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at std.algorithm.find!(pred,ubyte[],ubyte[]).find D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d:2885 (0x00402b23) thread(2408) That's why I've labeled is as a Phobos bug. But maybe it's a bug in the user code? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 07 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7244 --- Comment #2 from SomeDude <lovelydear mailmetrash.com> 2012-04-21 06:28:21 PDT --- See also issue 7689 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 21 2012