Boost logo

Boost Interest :

Subject: Re: [Boost-cmake] placement_new test failure under VC++8
From: David Wolfe (dwolfe_at_[hidden])
Date: 2009-05-16 19:25:56

> Debug Error!
> File
> c:\projects\boost\libs\numeric\ublas\placement_new.cpp
> Line: 63
> Run-Time Check Failure #2 - Stack around the variable 'a' was
> corrupted.

On 5/16/2009 7:59 AM, Mike Jackson wrote:
> So I am going to assume that there is an actual bug in the code. Is it
> possible to debug the program with a debugger and get the line of code
> that VS is bombing on?

It's definitely the creation of the 1-element UDT array at the same
address as the scalar instance that's causing the runtime check to

     udt a;
     udt* ap = &a;

     // Capture placement new offsets for a udt
     new (ap) udt;
     int new_offset = int (udt::base_pointer - ap);
     new (ap) udt [1];
     int array_new_offset = int (udt::base_pointer - ap);

If I comment out the line that reads 'new (ap) udt[1]', the assertion
doesn't trigger.

Boost-cmake list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at