[Webkit-unassigned] [Bug 129429] [Win32][LLINT] Crash when running JSC stress tests.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 4 15:23:16 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=129429





--- Comment #38 from peavo at outlook.com  2014-03-04 15:20:17 PST ---
(In reply to comment #37)
> (From update of attachment 225818 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=225818&action=review
> 
> > Source/JavaScriptCore/runtime/VM.cpp:790
> > +    MEMORY_BASIC_INFORMATION uncommittedMemory;
> > +    if (VirtualQuery(stackLimit, &uncommittedMemory, sizeof(uncommittedMemory)) > 0)
> > +        if (uncommittedMemory.State == MEM_RESERVE) {
> > +            int size = uncommittedMemory.RegionSize;
> > +            // Commit memory
> > +            OSAllocator::commit(stackLimit, size, true, false);
> > +
> > +            // Move guard page
> > +            MEMORY_BASIC_INFORMATION guardPage;
> > +            char* guardPagePointer = reinterpret_cast<char*>(stackLimit) + size;
> > +            if (VirtualQuery(guardPagePointer, &guardPage, sizeof(guardPage)) > 0) {
> > +                ASSERT(guardPage.Protect & PAGE_GUARD);
> > +                DWORD oldProtect;
> > +                // Remove guard flag from old guard page
> > +                BOOL retval = VirtualProtect(guardPagePointer, guardPage.RegionSize, PAGE_READWRITE, &oldProtect);
> > +                ASSERT(retval);
> > +                char* newGuardPagePointer = reinterpret_cast<char*>(stackLimit) - guardPage.RegionSize;
> > +                // Commit new guard page
> > +                OSAllocator::commit(newGuardPagePointer, guardPage.RegionSize, true, false);
> > +                // Set guard flag on new guard page
> > +                retval = VirtualProtect(newGuardPagePointer, guardPage.RegionSize, PAGE_READWRITE | PAGE_GUARD, &oldProtect);
> > +                ASSERT(retval);
> > +            }
> > +        }
> 
> Are we just duplicating _chckstck here? Should we just call _chckstck instead?

I think calling _chkstk() from C/C++ is a bit tricky, since it requires the stack allocation size in eax, and we can't use inline assembly because of 64-bit.
Also, _chkstk() moves the stack guard page, one page at a time, while this does it just once.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list