Boost C++ Libraries: Ticket #9207: different sizeof atomic_count (boost/asio/detail/atomic_count.hpp) type after comilation with --std=c++11 than after comilation without --std=c++11 (gcc, x86_64). https://svn.boost.org/trac10/ticket/9207 <p> atomic_count has different size when compiling with --std==c++11 (sizeof(long)) than compiling without --std=c++11 (sizof(int)). Hence classes which use atomic_count have different memory layout of members depending on --std compilation option. This leads to troubles when program is built from object files compiled with --std=c++11 and files compiled without --std=c++11. </p> <p> This phenomena is not visible for clang (clang std lib contains std::atomic) Problem is also not visible on i386 (sizeof(long) == sizeof(int)) </p> <p> Problem exists in 1.54 and on the trunk. </p> <p> In attached example task_io_service has different size in two compilation units. This leads to segmentation fault. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9207 Trac 1.4.3 Karol Nowacki <karol.nowacki@…> Mon, 07 Oct 2013 11:46:32 GMT attachment set https://svn.boost.org/trac10/ticket/9207 https://svn.boost.org/trac10/ticket/9207 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.tar.gz</span> </li> </ul> <p> program with segmentation fault due to different size of atomic_count in task_io_service class </p> Ticket chris_kohlhoff Mon, 05 May 2014 08:31:29 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9207#comment:1 https://svn.boost.org/trac10/ticket/9207#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">invalid</span> </li> </ul> <p> Don't mix and match language versions. Or if you really really must, define BOOST_ASIO_DISABLE_STD_ATOMIC. </p> Ticket leon@… Fri, 31 Jul 2015 22:55:12 GMT <link>https://svn.boost.org/trac10/ticket/9207#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9207#comment:2</guid> <description> <p> The assertion that the phenomena is not visible if using clang is incorrect. The test program would crash on OS/X (10.10.4) with brew installed Boost 1.58.0, too. </p> <p> Clang version: </p> <pre class="wiki">mac: clang --version Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.4.0 Thread model: posix </pre> </description> <category>Ticket</category> </item> </channel> </rss>