Boost logo

Boost :

Subject: Re: [boost] [interprocess] Arithmetic error
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-16 19:00:28


Henrik Sundberg wrote:
> Disclaimer: I have no minimal reproducing program.
> The problem occurs at line 458 in mapped_region.hpp:
> 456 //We calculate the difference between demanded and valid offset
> 457 std::size_t page_size = this->get_page_size();
> 458 m_extra_offset = (offset - (offset / page_size) * page_size);
> I've found out that page_size gets the value 0. It only seems to
> happen in my single core computer. It works for other Kubuntu 8.10
> systems.
> The code is needed during so-load. The library is used from two other
> libraries that are loaded by the program (like a diamond library
> load).
> I've been discussing the problem in this forum:
> The code is open (available from the site of the forum). It is a whole
> framework though, not just a small program.
> I don't know if this is a compiler bug, a Boost bug or a bug in the program.
> I think that the page size is supposed to be cached, but that this
> somehow doesn't happen in this setup. I get the error every time.
> Preloading the library avoids the problem. I.e. starting like this
> works: dobexplorer

This is a Boost.Interprocess bug. It has been fixed in the trunk.
You can either patch 1.35 by changing line 531 ff. from

inline std::size_t mapped_region::get_page_size()
{ return page_size_holder<0>::PageSize; }


inline std::size_t mapped_region::get_page_size()
      return page_size_holder<0>::get_page_size();
      return page_size_holder<0>::PageSize;

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at