Ignore:
Timestamp:
Feb 4, 2010, 12:48:07 PM (11 years ago)
Author:
gb
Message:

Try to address ticket:649 by clearly distinguishing between UnMapMemory?()
(which completely deallocates an entire memory region created by MapMemory?()
or MapMemoryForStack?()) from UnCommitMemory?() (which leaves a previously
mapped and accessible range of pages mapped but inaccessible/uncommitted.)

Follow Alexander Gavrilov's suggestions (and use his patch) to ensure
that thread handles are closed on Windows. Make create_system_thread()
return a Boolean, since no callers care about the exact value and the
value that was returned on Windows was a handle that needed to be closed.

Ensure that create_system_thread() observes its stack_size argument.
Make the size of vstack soft protected area ("the yellow zone") larger.

Use a readable/writable PAGE_GUARD page at the bottom of the
cstack/tstack yellow zone and handle the Windows exception that's
raised when a PAGE_GUARD page is written to, so that stack overflow
detection has a prayer of working on Windows.

UNTESTED ANYWHERE BUT WIN32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-exceptions.c

    r13295 r13431  
    18381838    return SIGILL;
    18391839  case EXCEPTION_IN_PAGE_ERROR:
     1840  case STATUS_GUARD_PAGE_VIOLATION:
    18401841    return SIGBUS;
    18411842  default:
     
    36583659    int err;
    36593660
    3660 /* can't use UnMapMemory() beacuse it only uses MEM_DECOMMIT */
    3661 #ifdef WINDOWS
    3662     err = VirtualFree(base, nbytes, MEM_RELEASE);
    3663 #else
    3664     err = munmap(base, nbytes);
    3665 #endif
     3661    err = UnMapMemory(base, nbytes);
    36663662    if (err != 0)
    36673663      Fatal("munmap in delete_watched_area", "");
Note: See TracChangeset for help on using the changeset viewer.