Changeset 93546 in webkit


Ignore:
Timestamp:
Aug 22, 2011 2:46:58 PM (13 years ago)
Author:
msaboff@apple.com
Message:

REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari
https://bugs.webkit.org/show_bug.cgi?id=66464

Changed ArgumentEncoder to use system malloc instead of fastMalloc.
FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with
mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY.
The system malloc has no such limitation.
Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it
doesn't have size limitations that MACH_MSG_PHYSICAL_COPY.

Reviewed by Anders Carlsson.

  • Platform/CoreIPC/ArgumentEncoder.cpp:

(CoreIPC::ArgumentEncoder::~ArgumentEncoder):
(CoreIPC::ArgumentEncoder::grow):

  • Platform/CoreIPC/mac/ConnectionMac.cpp:

(CoreIPC::Connection::sendOutgoingMessage):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r93544 r93546  
     12011-08-21  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari
     4        https://bugs.webkit.org/show_bug.cgi?id=66464
     5
     6        Changed ArgumentEncoder to use system malloc instead of fastMalloc.
     7        FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with
     8        mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY.
     9        The system malloc has no such limitation.
     10        Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it
     11        doesn't have size limitations that MACH_MSG_PHYSICAL_COPY.
     12       
     13        Reviewed by Anders Carlsson.
     14
     15        * Platform/CoreIPC/ArgumentEncoder.cpp:
     16        (CoreIPC::ArgumentEncoder::~ArgumentEncoder):
     17        (CoreIPC::ArgumentEncoder::grow):
     18        * Platform/CoreIPC/mac/ConnectionMac.cpp:
     19        (CoreIPC::Connection::sendOutgoingMessage):
     20
    1212011-08-22  Anders Carlsson  <andersca@apple.com>
    222
  • trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp

    r89177 r93546  
    5151{
    5252    if (m_buffer)
    53         fastFree(m_buffer);
     53        free(m_buffer);
    5454#if !USE(UNIX_DOMAIN_SOCKETS)
    5555    // FIXME: We need to dispose of the attachments in cases of failure.
     
    7171    if (alignedSize + size > m_bufferCapacity) {
    7272        size_t newCapacity = std::max(alignedSize + size, std::max(static_cast<size_t>(32), m_bufferCapacity + m_bufferCapacity / 4 + 1));
     73        // Use system malloc / realloc instead of fastMalloc due to
     74        // fastMalloc using MADV_FREE_REUSABLE doesn't work with
     75        // mach messages with OOL message and MACH_MSG_VIRTUAL_COPY.
    7376        if (!m_buffer)
    74             m_buffer = static_cast<uint8_t*>(fastMalloc(newCapacity));
     77            m_buffer = static_cast<uint8_t*>(malloc(newCapacity));
    7578        else
    76             m_buffer = static_cast<uint8_t*>(fastRealloc(m_buffer, newCapacity));
     79            m_buffer = static_cast<uint8_t*>(realloc(m_buffer, newCapacity));
    7780       
    7881        // FIXME: What should we do if allocating memory fails?
  • trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp

    r92231 r93546  
    156156        messageBodyIsOOL = true;
    157157
    158         attachments.append(Attachment(arguments->buffer(), arguments->bufferSize(), MACH_MSG_PHYSICAL_COPY, false));
     158        attachments.append(Attachment(arguments->buffer(), arguments->bufferSize(), MACH_MSG_VIRTUAL_COPY, false));
    159159        numberOfOOLMemoryDescriptors++;
    160160        messageSize = machMessageSize(0, numberOfPortDescriptors, numberOfOOLMemoryDescriptors);
Note: See TracChangeset for help on using the changeset viewer.