Boost C++ Libraries: Ticket #9877: freelist test crashes on Linux/GCC/release/x86 https://svn.boost.org/trac10/ticket/9877 <p> Hello, </p> <p> on a Redhat 6.5 system with GCC 4.4.7 I compiled the latest trunk with these parameters: <em>toolset=gcc architecture=x86 address-model=32 variant=release</em> </p> <p> I get the following error in the testsuite: </p> <pre class="wiki">unknown location(0): fatal error in "fixed_size_freelist_test": memory access violation at address: 0x1c93bbed: no mapping at fault address freelist_test.cpp(113): last checkpoint </pre><pre class="wiki">(gdb) bt #0 0x0805d652 in boost::lockfree::queue&lt;dummy*, boost::parameter::void_, boost::parameter::void_, boost::parameter::void_&gt;::push(dummy* const&amp;) () #1 0x0805f1f2 in freelist_tester&lt;boost::lockfree::detail::fixed_size_freelist&lt;dummy, boost::lockfree::detail::runtime_sized_freelist_storage&lt;dummy, std::allocator&lt;dummy&gt; &gt; &gt;, true&gt;::allocate() () #2 0x08054367 in boost::detail::thread_data&lt;boost::_bi::bind_t&lt;void, boost::_mfi::mf0&lt;void, freelist_tester&lt;boost::lockfree::detail::fixed_size_freelist&lt;dummy, boost::lockfree::detail::runtime_sized_freelist_storage&lt;dummy, std::allocator&lt;dummy&gt; &gt; &gt;, true&gt; &gt;, boost::_bi::list1&lt;boost::_bi::value&lt;freelist_tester&lt;boost::lockfree::detail::fixed_size_freelist&lt;dummy, boost::lockfree::detail::runtime_sized_freelist_storage&lt;dummy, std::allocator&lt;dummy&gt; &gt; &gt;, true&gt;*&gt; &gt; &gt; &gt;::run() () #3 0x00125b26 in thread_proxy () from /uhome/gjasny/src/modular-boost/bin.v2/libs/thread/build/gcc-4.4.7/release/address-model-32/architecture-x86/threading-multi/libboost_thread.so.1.56.0 #4 0x00cd1b39 in start_thread () from /lib/libpthread.so.0 #5 0x00c14d6e in clone () from /lib/libc.so.6 </pre><p> I an <strong>not</strong> able to reproduce the crash in x86 debug mode or any x64 mode. </p> <pre class="wiki">[gjasny@drsbuild05.drs atomic]$ git describe fatal: No tags can describe '95c083ddfd990f7c848b785e5a0e9d282da5359b'. Try --always, or create some tags. [gjasny@drsbuild05.drs lockfree]$ git describe fatal: No tags can describe '8ffc9b3f26cd5802655ceb7d4188911f1cf7067d'. Try --always, or create some tags. </pre><p> Thanks, Gregor </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9877 Trac 1.4.3 gregor.jasny@… Sun, 13 Apr 2014 10:37:04 GMT <link>https://svn.boost.org/trac10/ticket/9877#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:1</guid> <description> <p> queue test fails, too: </p> <pre class="wiki">[gjasny@drsbuild05.drs test]$ ../../../bin.v2/libs/lockfree/test/queue_test.test/gcc-4.4.7/release/address-model-32/architecture-x86/threading-multi/queue_test Running 7 test cases... queue_test.cpp(31): fatal error in "simple_queue_test": critical check f.empty() failed </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Sun, 13 Apr 2014 10:47:35 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9877#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:2</guid> <description> <p> i cannot reproduce this with gcc-4.8 and the boost develop branch. does it also crash with a different compiler? </p> </description> <category>Ticket</category> </item> <item> <author>gregor.jasny@…</author> <pubDate>Sun, 13 Apr 2014 11:43:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9877#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:3</guid> <description> <p> I cannot reproduce it with clang 3.4 which is also installed on the machine. </p> <p> To reproduce I will build you an Amazon AWS node tomorrow where you can see the problem. </p> <p> Thanks, Gregor </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Sun, 13 Apr 2014 11:56:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9877#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:4</guid> <description> <p> hmm ... could be a compiler bug ... fwiw, gcc-4.4 has been released 5 years ago and hasn't received any updates for the last 2 years. so i tend to close it as wontfix, though i'd happily accept a patch ... </p> <p> do you have a strong requirement to use gcc-4.4 and no other/newer gcc? </p> </description> <category>Ticket</category> </item> <item> <author>gjasny@…</author> <pubDate>Wed, 23 Apr 2014 11:43:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9877#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:5</guid> <description> <p> Hello Tim, </p> <p> it looks indeed more like a compiler bug. As far as I can see the queue::initialize function does not work properly. For a brand new queue the _head and _tail values must be identical. With GCC 4.4 this is not the case. I tried to introduce some memory fences but this did not change anything. Adding some logging code makes the bug go away. </p> <p> Unfortunately we're stuck with GCC 4.4.7 because it is the default compiler in Redhat EL6. But maybe with EL7 around the corner we should strive for an early migration. </p> <p> Boost 1.55.0 still declares GCC 4.4.7 as a primary compiler. But in the dashboard I see only one Ubuntu system with 4.4.7 and I suspect it builds the 64 bit variant only. </p> <p> Is there anything I could try to convince GCC to produce the proper code? </p> <p> Thanks, Gregor </p> </description> <category>Ticket</category> </item> <item> <dc:creator>timblechmann</dc:creator> <pubDate>Wed, 23 Apr 2014 13:09:39 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9877#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9877#comment:6</guid> <description> <p> you could try to configure the data structure as fixed_sized, which should select a different code path and avoids the generation of cmpxchg8b instructions, though it will limit the possible size of the queue. </p> <p> hth </p> </description> <category>Ticket</category> </item> </channel> </rss>