[webkit-help] VectorBufferBase alignment issue on AIX using compiler xlC_r

Pankaj Jangid pankaj.jangid at gmail.com
Mon Feb 1 22:27:03 PST 2010


I have successfully built Qt 4.5.3, with --webkit, on AIX (5.3) using xlC_r
(v7). But the sample (webkit) browser is crashing in qwebview->setHtml() API
call.

Looking at the debugger call trace I discovered that it is ultimately
crashing in function "fastMalloc(size_t n)" in
JavaScriptCore/wtf/Fastmalloc.cpp. This function is getting called through
one or the other function of VectorBufferBase class in
JavaScriptCore/wtf/Vector.h.

When I use these macros,

        #define WTF_ALIGN_OF(type) __alignof__(type)
        #define WTF_ALIGNED(variable_type, variable, n) variable_type
variable __attribute__((__aligned__(n)))

The crash occurs on line

        m_buffer = static_cast<T*>(fastMalloc(newCapacity * sizeof(T))); //
inside function VectorBufferBase::allocateBuffer(size_t) in Vector.h

When I use no null macro,

        #define WTF_ALIGN_OF(type)   0

and following AlignedBuffer structure,

        template <size_t size, size_t> struct AlignedBuffer
        {
            AlignedBufferChar oversizebuffer[size + 128];
            AlignedBufferChar *buffer()
            {
                AlignedBufferChar *ptr = oversizebuffer;
                ptr += 128 - (reinterpret_cast<size_t>(ptr) & 0x7f);
                return ptr;
            }
        };

the crash occurs  on line,

        T* buffer() { return m_buffer; } // inside VectorBufferBase in
Vector.h

I tried changing 128 to 64 or 32 in the above code. In all cases it is
crashing in some or the other function of VectorBufferBase.

Any clue on what is causing the crash?

--
Regards
Pankaj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100202/8962cc57/attachment.html>


More information about the webkit-help mailing list