Boost logo

Boost :

Subject: Re: [boost] [simple_segregated_storage] segfault
From: Chris Newbold (Chris.Newbold_at_[hidden])
Date: 2008-10-01 09:27:26


> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Chris Newbold
> Sent: Wednesday, October 01, 2008 7:58 AM

> With your latest updates to the shifted_ptr code I've been able to compile
> w/ GCC 4.1.2 and reproduce a crash; it looks a little different than the
> one you posted, but at least now I've got something to dig into. Stay
> tuned.

Phil--

I believe that this crash is actually a bug in your code. In boost::detail::sh::pool::allocate you are dividing the specified size by the pool's chunk size. However, in deallocate, you are just passing the size directly to the underlying pool. The result is that you are trying to free twice as many chunks as you allocated.

Take a look and let me know what you think.

-Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk