Changeset 163595 in webkit


Ignore:
Timestamp:
Feb 6, 2014 6:03:26 PM (10 years ago)
Author:
msaboff@apple.com
Message:

Workaround REGRESSION(r163195-r163227): Crash beneath NSErrorUserInfoFromJSException when installing AppleInternal.mpkg
https://bugs.webkit.org/show_bug.cgi?id=128347

Reviewed by Geoffrey Garen.

Added a flag to VM class called m_ignoreStackLimit that disables stack limit checks.
We set this flag in JSContextGroupCreate() and JSGlobalContextCreateInGroup().

Disabled stack overflow tests in testapi.js since it uses these paths.

THis patch will be reverted as part of a comprehensive solution to the problem.

  • API/JSContextRef.cpp:

(JSContextGroupCreate):
(JSGlobalContextCreateInGroup):

  • API/tests/testapi.js:
  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::updateStackLimitWithReservedZoneSize):

  • runtime/VM.h:

(JSC::VM::ignoreStackLimit):

Location:
trunk/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r160099 r163595  
    5858{
    5959    initializeThreading();
    60     return toRef(VM::createContextGroup().leakRef());
     60    VM* vm = VM::createContextGroup().leakRef();
     61    vm->ignoreStackLimit();
     62    return toRef(vm);
    6163}
    6264
     
    130132    initializeThreading();
    131133
    132     RefPtr<VM> vm = group ? PassRefPtr<VM>(toJS(group)) : VM::createContextGroup();
     134    RefPtr<VM> vm;
     135    if (group)
     136        vm = PassRefPtr<VM>(toJS(group));
     137    else {
     138        vm = VM::createContextGroup();
     139        vm->ignoreStackLimit();
     140    }
    133141
    134142    APIEntryShim entryShim(vm.get(), false);
  • trunk/Source/JavaScriptCore/API/tests/testapi.js

    r148162 r163595  
    243243
    244244shouldBe("undefined instanceof MyObject", false);
     245/*
    245246EvilExceptionObject.hasInstance = function f() { return f(); };
    246247EvilExceptionObject.__proto__ = undefined;
     
    253254EvilExceptionObject.toStringExplicit = function f() { return f(); }
    254255shouldThrow("String(EvilExceptionObject)");
     256 */
    255257
    256258shouldBe("EmptyObject", "[object CallbackObject]");
  • trunk/Source/JavaScriptCore/ChangeLog

    r163590 r163595  
     12014-02-06  Michael Saboff  <msaboff@apple.com>
     2
     3        Workaround REGRESSION(r163195-r163227): Crash beneath NSErrorUserInfoFromJSException when installing AppleInternal.mpkg
     4        https://bugs.webkit.org/show_bug.cgi?id=128347
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Added a flag to VM class called m_ignoreStackLimit that disables stack limit checks.
     9        We set this flag in JSContextGroupCreate() and JSGlobalContextCreateInGroup().
     10
     11        Disabled stack overflow tests in testapi.js since it uses these paths.
     12
     13        THis patch will be reverted as part of a comprehensive solution to the problem.
     14
     15        * API/JSContextRef.cpp:
     16        (JSContextGroupCreate):
     17        (JSGlobalContextCreateInGroup):
     18        * API/tests/testapi.js:
     19        * runtime/VM.cpp:
     20        (JSC::VM::VM):
     21        (JSC::VM::updateStackLimitWithReservedZoneSize):
     22        * runtime/VM.h:
     23        (JSC::VM::ignoreStackLimit):
     24
    1252014-02-06  Mark Hahnenberg  <mhahnenberg@apple.com>
    226
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r163428 r163595  
    220220    , m_initializingObjectClass(0)
    221221#endif
     222    , m_ignoreStackLimit(false)
    222223    , m_stackLimit(0)
    223224#if ENABLE(LLINT_C_LOOP)
     
    739740size_t VM::updateStackLimitWithReservedZoneSize(size_t reservedZoneSize)
    740741{
     742    if (m_ignoreStackLimit) {
     743        setStackLimit(0);
     744        return 0;
     745    }
     746
    741747    size_t oldReservedZoneSize = m_reservedZoneSize;
    742748    m_reservedZoneSize = reservedZoneSize;
  • trunk/Source/JavaScriptCore/runtime/VM.h

    r163225 r163595  
    388388        void* stackLimit() { return m_stackLimit; }
    389389
     390        void ignoreStackLimit() { m_ignoreStackLimit = true; }
     391
    390392        bool isSafeToRecurse(size_t neededStackInBytes = 0) const
    391393        {
     
    522524        const ClassInfo* m_initializingObjectClass;
    523525#endif
     526        bool m_ignoreStackLimit;
    524527        size_t m_reservedZoneSize;
    525528#if ENABLE(LLINT_C_LOOP)
Note: See TracChangeset for help on using the changeset viewer.