[Boost-bugs] [Boost C++ Libraries] #7795: Bug creating structures in files mapped with small sizes

Subject: [Boost-bugs] [Boost C++ Libraries] #7795: Bug creating structures in files mapped with small sizes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-14 00:05:31


#7795: Bug creating structures in files mapped with small sizes
----------------------------------+-----------------------------------------
 Reporter: lodos@… | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: mapped file size |
----------------------------------+-----------------------------------------
 To reproduce the bug one could use doc_managed_mapped_file.cpp in the
 example folder. Set the FileSize variable to small values (less than 100
 for instance) and the construct method will cause a crash. An exception is
 expected instead.

 For completeness I include below our exchange in the boost developer list.
 Thank you.

> > > When the size to map is too small, take 1 or 2 bytes for
> > > instance, the library fails in a non elegant way. This is a corner
> > > case, but I could not find this documented. Is this a bug?
> >
> > You need a minimum size to construct managed memory's internal
> > structures. Maybe the behaviour should be documented. What do you
> mean
> > with "non-elegant", your application crashses? Nevertheless, mapping
> 1
> > or 2 bytes you waste resources, as the OS will map at least one page
> > (4K on most 32 bit systems and 64 K on Windows).

> Yes, the application crashes. I am mapping large complex containers
> with different sizes, the crashes took place when I was developing
> tests. I would expect an exception when the size of the mapping is not
> enough.
> It is time consuming to develop a structure that would need more than
> 4Kb for its initial mapping. if I create a ticket with a sample using a
> few bytes just to demonstrate the problem, would you consider it? I
> understand this is not a show stopper :-) Thank you for your answers
> and again for boost::interprocess.

 This seems a bug, please fill another ticket with your example.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7795>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC