Opened 5 years ago

Closed 4 years ago

#7795 closed Bugs (fixed)

Bug creating structures in files mapped with small sizes

Reported by: lodos@… Owned by: igaztanaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.52.0 Severity: Problem
Keywords: mapped file size Cc:


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


with "non-elegant", your application crashses? Nevertheless, mapping


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.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by igaztanaga

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in revision #82245 in trunk

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.