Ignore:
Timestamp:
May 5, 2010, 6:08:53 PM (15 years ago)
Author:
[email protected]
Message:

Bug 38604 - workers-gc2 crashing on Qt

Reviewed by Darin Adler.

This appears to be due to a couple of issues.
(1) When the atomic string table is deleted it does not clear the 'inTable' bit
on AtomicStrings - it implicitly assumes that all AtomicStrings have already
been deleted at this point (otherwise they will crash in their destructor when
they try to remove themselves from the atomic string table).
(2) We don't fix the ordering in which WTF::WTFThreadData and
WebCore::ThreadGlobalData are destructed.

We should make sure that ThreadGlobalData is cleaned up before worker threads
terminate and WTF::WTFThreadData is destroyed, and we should clear the inTable
bit of members on atomic string table destruction.

JavaScriptCore:

WTF changes (fix issue 1, above) - ensure inTable property is cleared when the
atomic string table is destroyed (also, rename InTable to IsAtomic, to make it
clear which table we are refering to!)

  • wtf/text/AtomicString.cpp:

(WebCore::AtomicStringTable::destroy):
(WebCore::CStringTranslator::translate):
(WebCore::UCharBufferTranslator::translate):
(WebCore::HashAndCharactersTranslator::translate):
(WebCore::AtomicString::add):

  • wtf/text/StringImpl.cpp:

(WebCore::StringImpl::~StringImpl):

  • wtf/text/StringImpl.h:

(WebCore::StringImpl::isAtomic):
(WebCore::StringImpl::setIsAtomic):

  • wtf/text/StringImplBase.h:

WebCore:

WTF changes (fix issue 2, above) - clean up the thread data on worker termination.

  • platform/ThreadGlobalData.cpp:

(WebCore::ThreadGlobalData::~ThreadGlobalData):
(WebCore::ThreadGlobalData::destroy):

  • platform/ThreadGlobalData.h:
  • workers/WorkerThread.cpp:

(WebCore::WorkerThread::workerThread):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/text/StringImpl.h

    r58712 r58851  
    224224    bool hasTerminatingNullCharacter() const { return m_refCountAndFlags & s_refCountFlagHasTerminatingNullCharacter; }
    225225
    226     bool inTable() const { return m_refCountAndFlags & s_refCountFlagInTable; }
    227     void setInTable() { m_refCountAndFlags |= s_refCountFlagInTable; }
     226    bool isAtomic() const { return m_refCountAndFlags & s_refCountFlagIsAtomic; }
     227    void setIsAtomic(bool isIdentifier)
     228    {
     229        ASSERT(!isStatic());
     230        if (isIdentifier)
     231            m_refCountAndFlags |= s_refCountFlagIsAtomic;
     232        else
     233            m_refCountAndFlags &= ~s_refCountFlagIsAtomic;
     234    }
    228235
    229236    unsigned hash() const { if (!m_hash) m_hash = computeHash(m_data, m_length); return m_hash; }
Note: See TracChangeset for help on using the changeset viewer.