Boost C++ Libraries: Ticket #9172: Crash when not preserving FPU https://svn.boost.org/trac10/ticket/9172 <p> I get a SIGBUS when executing the following code: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/coroutine/coroutine.hpp&gt; typedef boost::coroutines::coroutine&lt;int()&gt; generator; void foo(generator::caller_type&amp; yield) { for (std::size_t i = 0; i &lt; 10; ++i) yield(i); } int main() { boost::coroutines::attributes attr(false /*don't preserve FPU registers*/); generator gen(foo, attr); while (gen) { std::cout &lt;&lt; gen.get() &lt;&lt; std::endl; gen(); } return 0; }; </pre><p> I tried with gcc 4.8 and clang 3.3 on Mac OS X 10.8 and with gcc 4.8 on Linux (CentOS 6). I also tried with the latest Boost trunk (<a class="changeset" href="https://svn.boost.org/trac10/changeset/85977" title="coroutine: fix noinline attribute for MSVC in segmented-stack example ">r85977</a>) on Mac OS X 10.8. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9172 Trac 1.4.3 olli Sat, 28 Sep 2013 07:54:46 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9172#comment:1 https://svn.boost.org/trac10/ticket/9172#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> parameter type for disabling FPU is not a bool - it is a enumeration. correct code: boost::coroutines::attributes attr(boost::coroutines::fpu_not_preserved /*don't preserve FPU registers*/); </p> Ticket Alexandre Hamez <alexandre.hamez@…> Sat, 28 Sep 2013 08:02:02 GMT <link>https://svn.boost.org/trac10/ticket/9172#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9172#comment:2</guid> <description> <p> OK, thanks. In this case, this is a bug in the documentation. It is stated that the parameter type is a bool (<a href="http://www.boost.org/doc/libs/1_54_0/libs/coroutine/doc/html/coroutine/attributes.html">http://www.boost.org/doc/libs/1_54_0/libs/coroutine/doc/html/coroutine/attributes.html</a>), not a enumeration. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>olli</dc:creator> <pubDate>Sat, 28 Sep 2013 19:11:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9172#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9172#comment:3</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/9172#comment:2" title="Comment 2">Alexandre Hamez &lt;alexandre.hamez@…&gt;</a>: </p> <blockquote class="citation"> <p> OK, thanks. In this case, this is a bug in the documentation. It is stated that the parameter type is a bool (<a href="http://www.boost.org/doc/libs/1_54_0/libs/coroutine/doc/html/coroutine/attributes.html">http://www.boost.org/doc/libs/1_54_0/libs/coroutine/doc/html/coroutine/attributes.html</a>), not a enumeration. </p> </blockquote> <p> OK - I've fixed it in the docu, thx. </p> </description> <category>Ticket</category> </item> </channel> </rss>