Boost C++ Libraries: Ticket #7795: Bug creating structures in files mapped with small sizes https://svn.boost.org/trac10/ticket/7795 <p> To reproduce the bug one could use doc_managed_mapped_file.cpp in the example folder. Set the <a class="missing wiki">FileSize</a> variable to small values (less than 100 for instance) and the construct method will cause a crash. An exception is expected instead. </p> <p> For completeness I include below our exchange in the boost developer list. Thank you. </p> <blockquote class="citation"> <blockquote class="citation"> <blockquote class="citation"> <p> 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? </p> </blockquote> <p> You need a minimum size to construct managed memory's internal structures. Maybe the behaviour should be documented. What do you </p> </blockquote> <p> mean </p> <blockquote class="citation"> <p> with "non-elegant", your application crashses? Nevertheless, mapping </p> </blockquote> <p> 1 </p> <blockquote class="citation"> <p> 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). </p> </blockquote> </blockquote> <blockquote class="citation"> <p> 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. </p> </blockquote> <p> This seems a bug, please fill another ticket with your example. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7795 Trac 1.4.3 Ion Gaztañaga Fri, 28 Dec 2012 22:44:08 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7795#comment:1 https://svn.boost.org/trac10/ticket/7795#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in revision <a class="missing ticket">#82245</a> in trunk </p> Ticket