Opened 9 years ago

Last modified 9 years ago

#3572 new Bugs

mapped_file: reading/writing mapped memory can throw (structured) exceptions? (windows)

Reported by: xurux1-mail@… Owned by: Jonathan Turkanis
Milestone: Boost 1.41.0 Component: iostreams
Version: Boost 1.40.0 Severity: Problem
Keywords: mapped_file, documentation Cc:


msdn: "Reading and Writing From a File View" (

"Reading from or writing to a file view can cause an EXCEPTION_IN_PAGE_ERROR exception. For example, accessing a mapped file that resides on a remote server can generate an exception if the connection to the server is lost. Exceptions can also occur because of a full disk, an underlying device failure, or a memory allocation failure. When writing to a file view, exceptions can also occur because the file is shared and a different process has locked a byte range. To guard against exceptions due to input and output (I/O) errors, all attempts to access memory mapped files should be wrapped in structured exception handlers"

DWORD dwLength; try {

dwLength = *((LPDWORD) lpMapAddress);

} except(GetExceptionCode?()==EXCEPTION_IN_PAGE_ERROR ?



Failed to read from the view.


... so it should be mentioned in the documentation? (windows specific)

Change History (1)

comment:1 Changed 9 years ago by anonymous


java has a get method, to access bytes in a FileChannel? (=mmap'ed file), which should do the checking ...

Note: See TracTickets for help on using tickets.