[Interest] ASSERT / Debug Crash in Qt 5.3.2. WTF, Windows x64, LLIntData.cpp at bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint32_t) + 1] == 42)

Allan Sandfeld Jensen kde at carewolf.com
Fri Oct 10 16:24:58 CEST 2014


Hi Andre

That all looks reasonable, but what is in castResult[3] ?

It expected to look like this:
void * m_buffer [int index 0-1]
uint m_capacity [int index 2]
int m_size [int index 3]

where m_capacity on Linux is 44, but m_size is 42.

`Allan

On Friday 10 October 2014, Andre Barth wrote:
> Hi Allan,
> 
> Thanks for the prompt response. I will go ahead & log a bug.
> 
> FWIW - Below is some test output.
> 
> Thanks,
> Andre
> 
> //some changed test code:
> Vector<int> testVector;
> testVector.resize(42);
> 
> auto sizeOfCalc = (sizeof(void*)/sizeof(uint32_t) + 1);
> 
> auto address  = &testVector;
> auto castResult = bitwise_cast<uint32_t*>(&testVector);
> auto indexedResult = castResult[sizeOfCalc];
> 
> bool result = (indexedResult == 42);
> 
> //and the corresponding "online" checks & results...
> 
> sizeof(void*)
> 0x0000000000000008
> 
> sizeof(uint32_t)
> 0x0000000000000004
> 
> sizeOfCalc
> 0x0000000000000003
> 
> address
> 0x00000000002ce7d8 {m_size=0x0000002a }
>     WTF::VectorBuffer<int,0>: {...}
>     m_size: 0x0000002a
> 
> castResult
> 0x00000000002ce7d8 {0x083f8450}
> 
> indexedResult
> 0xcccccccc
> 
> castResult[0]
> 0x083f8450
> 
> castResult[1]
> 0x00000000
> 
> castResult[2]
> 0x0000002a
> 
> 
> -----Original Message-----
> From: Allan Sandfeld Jensen [mailto:carewolf at gmail.com] On Behalf Of Allan
> Sandfeld Jensen Sent: Friday, October 10, 2014 3:09 PM
> To: interest at qt-project.org
> Cc: Andre Barth
> Subject: Re: [Interest] ASSERT / Debug Crash in Qt 5.3.2. WTF, Windows x64,
> LLIntData.cpp at
> bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint32_t) + 1]
> == 42)
> 
> On Friday 10 October 2014, Andre Barth wrote:
> > Hi all,
> > 
> > I built a JIT-free version of Qt 5.3.2 (Win64) and now run into this
> > assertion in
> > 
> > ..\Qt\qtwebkit\Source\JavaScriptCore\llint\LLIntData.cpp
> > 
> > Vector<int> testVector;
> > testVector.resize(42);
> > ASSERT(bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint3
> > 2_t)+
> > 
> >  1] == 42);
> > 
> > Here is a bug report / changeset I've found wrt this:
> > 
> > http://trac.webkit.org/changeset/148896/trunk/Source/JavaScriptCore/ll
> > int/L
> > LIntData.cpp
> > 
> > and
> > 
> > https://bugs.webkit.org/show_bug.cgi?id=97268
> > 
> > The assert is supposed to check, that the Vector's m_size variable is
> > at the correct address, I guess?!
> > 
> > If not, anyone can shed a light on this and explain the purpose of it
> > and where I might have incorrect compilation settings applied?
> > 
> > Am I missing somewhere an alignment pragma or something to make this
> > (sizeof(void*)/sizeof(uint32_t))
> > always calculate the right address - regardless of whether its x86 or
> > x64?
> 
> There are some differences between alignment and exact types between linux
> x64 and win x64. Could you test what (sizeof(void*)/sizeof(uint32_t)) is,
> and what is on the first few ints of the address of Vector<int> after a
> resize(42)?
> 
> Anyway, it might we worth opening a bug for to track the issue. Even if the
> assert turns out to be harmless, the binaries should be able to run in
> debug versions (even win64).
> 
> `Allan




More information about the Interest mailing list