Boost C++ Libraries: Ticket #3951: assertion failed calling find<> in managed_shared_memory (might be a bug in g++) https://svn.boost.org/trac10/ticket/3951 <p> I am getting the following assertion failed </p> <p> /usr/local/include/boost/interprocess/sync/posix/interprocess_recursive_mutex.hpp:107: void boost::interprocess::interprocess_recursive_mutex::unlock(): Assertion `res == 0' failed. </p> <p> when compiling the extremely simple attached program in GCC 4.4.3 with optimization on (-O2 or -O3) </p> <p> it doesn't happen with -O0 or -O1, or if I use -fno-strict-aliasing on top of -O2. </p> <p> I have also got this assertion failed error with GCC 4.4.1, but I wasn't able to isolate it into a simple program. </p> <p> The bug depends a lot on the GCC version and the optimization options, so I guess it is a bug in the compiler, but it affects the usability of boost, so I think it is worth reporting it here </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3951 Trac 1.4.3 Xavi Gratal <gratal@…> Mon, 22 Feb 2010 01:03:57 GMT attachment set https://svn.boost.org/trac10/ticket/3951 https://svn.boost.org/trac10/ticket/3951 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">ipc.cc</span> </li> </ul> <p> source code that triggers the error </p> Ticket Xavi Gratal <gratal@…> Mon, 22 Feb 2010 01:24:59 GMT <link>https://svn.boost.org/trac10/ticket/3951#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3951#comment:1</guid> <description> <p> I forgot to say that I am using linux, and I tried this in both the Ubuntu Lucid Lynx alpha, which comes with gcc 4.4.3, and compiling gcc 4.4.3 myself in Ubuntu Karmic Koala. </p> <p> As I said, the bug is triggered for the attaches source code only in gcc 4.4.3, but the same problem appears in more complex programs also in the gcc 4.4.1 which ships with Karmic Koala. </p> <p> It happens both in boost 1.42.0 and 1.41.0. Actually I think the interprocess library didn't change between them. </p> <p> Looking at the code of interprocess, it doesn't seem a strict aliasing problem, and the code compiles without warning with -Wstrict-aliasing=2 enabled. </p> </description> <category>Ticket</category> </item> <item> <author>Lénaïc Huard <lhuard@…></author> <pubDate>Wed, 24 Feb 2010 22:34:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3951#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3951#comment:2</guid> <description> <p> Hello, </p> <p> This issue and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3950" title="#3950: Bugs: boost::interprocess::mapped_region destructor deletes shm where it ... (closed: fixed)">#3950</a> look like dupes. It seems that some gcc optimizations are breaking the boost code attempting to emulate Rvalue references. When your piece of code is compiled with -std=c++x0 or -std=gnu++0x, gcc handles Rvalue references, boost tricks become useless and the piece of code works. </p> </description> <category>Ticket</category> </item> <item> <author>Lénaïc Huard <lhuard@…></author> <pubDate>Fri, 21 May 2010 20:16:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3951#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3951#comment:3</guid> <description> <p> Hello Xavi, </p> <p> Could you please try the <a class="ext-link" href="https://svn.boost.org/trac/boost/raw-attachment/ticket/3950/boost_interprocess.patch"><span class="icon">​</span>boost_interprocess.patch</a> attached in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3950" title="#3950: Bugs: boost::interprocess::mapped_region destructor deletes shm where it ... (closed: fixed)">#3950</a> and validate that it fixes all your issues? </p> <p> Thanks Lénaïc. </p> </description> <category>Ticket</category> </item> <item> <author>gratal@…</author> <pubDate>Fri, 21 May 2010 21:31:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3951#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3951#comment:4</guid> <description> <p> Hi, </p> <p> I tried it with some examples and everything worked fine. </p> <p> Do you know when this will make it into the svn trunk? </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Thu, 26 Aug 2010 10:19:25 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/3951#comment:5 https://svn.boost.org/trac10/ticket/3951#comment:5 <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> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.43.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> <p> Fixed for Boost 1.45 in release branch </p> Ticket