Boost C++ Libraries: Ticket #7235: mapped_region not accepting size = 0 https://svn.boost.org/trac10/ticket/7235 <p> Since Linux 2.6.12, and on other platforms, mmap is supposed to fail if the specified "size" parameter is 0. This causes some problems in all the Boost.Interprocess library since pretty much all the high-level structures (managed_shared_memory, for instance) use mapped_region (thus mmap) with size = 0, usually when the object is created with the "open_only" flag. </p> <p> I have observed this bug on <a class="missing wiki">BlueGene</a>/P's CNK environment, with gcc 4.1.2. It seems logical to me that, when opening an existing shared structure, the size doesn't have to be known. I don't have any solution yet... </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7235 Trac 1.4.3 Ion Gaztañaga Wed, 15 Aug 2012 20:38:29 GMT <link>https://svn.boost.org/trac10/ticket/7235#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7235#comment:1</guid> <description> <p> AFAIK, when mapped_region is called iwth size = 0 the file descriptor is fstat-ed to obtain the size of the device and mmap is called with this size. Could you debug a bit more to make sure that's the problem? Thanks </p> </description> <category>Ticket</category> </item> <item> <author>matthieu.dorier@…</author> <pubDate>Wed, 15 Aug 2012 21:18:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7235#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7235#comment:2</guid> <description> <p> Indeed you're right: fstat is the call that fails. When I pass the file descriptor of a shared memory object opened with shm_open, I get the error "Value too large for defined data type" (even though the size of the segment is only about 2500 bytes). </p> <p> If I understand the documentation of <a class="missing wiki">BlueGene</a>/P, the filesystems functions (such as fstat) are all redirected to the parallel filesystem on remote nodes, without checking if the file descriptor corresponds to something local (such as a file in /dev/shm), which may explain why the call fails. </p> </description> <category>Ticket</category> </item> </channel> </rss>