⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181542 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 4:22:32 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r181457 - Assertion failure in bmalloc::LargeObject::validateSelf on Mavericks Debug layout test bot
https://bugs.webkit.org/show_bug.cgi?id=142642

Reviewed by Michael Saboff.

The typical backtrace to this crash shows the main thread trying to
realloc a large string while a DFG compiler thread tries to
free a large vector buffer.

I believe that this is a race condition -- at least in debug builds --
since the main thread will try to validate its object's neighbors
without holding a lock, even though those neighbors might be in the
midst of changing.

In general, there may be sneaky times when it is valid to look at an
object's metadata without holding the heap lock, but it is best not to
do so unless we have a really really good reason to.

  • bmalloc/Allocator.cpp:

(bmalloc::Allocator::reallocate): Take a lock before reading the metadata
for this object, since we generally require any access to shared heap
metadata to take a lock.

Location:
releases/WebKitGTK/webkit-2.8/Source/bmalloc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/bmalloc/ChangeLog

    r181377 r181542  
     12015-03-12  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Assertion failure in bmalloc::LargeObject::validateSelf on Mavericks Debug layout test bot
     4        https://bugs.webkit.org/show_bug.cgi?id=142642
     5
     6        Reviewed by Michael Saboff.
     7
     8        The typical backtrace to this crash shows the main thread trying to
     9        realloc a large string while a DFG compiler thread tries to
     10        free a large vector buffer.
     11
     12        I believe that this is a race condition -- at least in debug builds --
     13        since the main thread will try to validate its object's neighbors
     14        without holding a lock, even though those neighbors might be in the
     15        midst of changing.
     16
     17        In general, there may be sneaky times when it is valid to look at an
     18        object's metadata without holding the heap lock, but it is best not to
     19        do so unless we have a really really good reason to.
     20
     21        * bmalloc/Allocator.cpp:
     22        (bmalloc::Allocator::reallocate): Take a lock before reading the metadata
     23        for this object, since we generally require any access to shared heap
     24        metadata to take a lock.
     25
    1262015-03-10  Geoffrey Garen  <ggaren@apple.com>
    227
  • releases/WebKitGTK/webkit-2.8/Source/bmalloc/bmalloc/Allocator.cpp

    r181377 r181542  
    130130    }
    131131    case Large: {
     132        std::lock_guard<StaticMutex> lock(PerProcess<Heap>::mutex());
    132133        LargeObject largeObject(object);
    133134        oldSize = largeObject.size();
Note: See TracChangeset for help on using the changeset viewer.