Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-07-13 12:33:34 +0400
committerCorinna Vinschen <corinna@vinschen.de>2006-07-13 12:33:34 +0400
commitf6105f89d5a809cb2fbcac318da9fa8981576a51 (patch)
tree0758a73e314ae10f937f6e6ca9bd983fa7f28242 /winsup/cygwin/exceptions.cc
parentd44b979536f0e922713ab132a871c062f61ea376 (diff)
* exceptions.cc (_cygtls::handle_exceptions): Call new
mmap_is_attached_or_noreserve_page function in case of access violation and allow application to retry access on noreserve pages. * mmap.cc (mmap_is_attached_or_noreserve_page): Changed from mmap_is_attached_page. Handle also noreserve pages now. Change comment accordingly. * winsup.h (mmap_is_attached_or_noreserve_page): Declare instead of mmap_is_attached_page.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 4d078dd10..12c6e0687 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -526,17 +526,21 @@ _cygtls::handle_exceptions (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT
break;
case STATUS_ACCESS_VIOLATION:
- if (mmap_is_attached_page (e->ExceptionInformation[1]))
- {
+ switch (mmap_is_attached_or_noreserve_page (e->ExceptionInformation[1]))
+ {
+ case 2: /* MAP_NORESERVE page, now commited. */
+ return 0;
+ case 1: /* MAP_NORESERVE page, commit failed, or
+ access to mmap page beyond EOF. */
si.si_signo = SIGBUS;
si.si_code = BUS_OBJERR;
- }
- else
- {
+ break;
+ default:
MEMORY_BASIC_INFORMATION m;
VirtualQuery ((PVOID) e->ExceptionInformation[1], &m, sizeof m);
si.si_signo = SIGSEGV;
si.si_code = m.State == MEM_FREE ? SEGV_MAPERR : SEGV_ACCERR;
+ break;
}
break;