Boost C++ Libraries: Ticket #8863: BOOST_ATTRIBUTE_NORETURN causes stack pointer corruption https://svn.boost.org/trac10/ticket/8863 <p> Hello, i ran into a strange problem with a very small project of mine. Whenever an exception is thrown in a boost package using boost::throw_exception and my program terminates (no exceptions are beeing catched yet) i get a message box saying: </p> <blockquote> <p> Run-Time Check Failure <a class="missing ticket">#0</a> - The value of ESP was not properly saved across a function call ... </p> </blockquote> <p> I was able to track this down to the BOOST_ATTRIBUTE_NORETURN declaration of boost::throw_exception. When i remove this from a copy of this function, the problem disappears. </p> <p> I am compiling with the following settings: </p> <ul><li>Compiler: MS Visual Studio C++ 2010 Express </li><li>Multithreading: yes </li><li>Runtime-linking: static </li><li>Build-type: debug </li></ul><p> My minimal test-program looks like this: </p> <blockquote> <p> #include "boost/throw_exception.hpp" </p> </blockquote> <p> </p> <blockquote> <p> int main(int argc, char* argv[]) { </p> <blockquote> <p> boost::throw_exception(std::exception("foo")); <em> &lt;-- this will produce the problem </em></p> </blockquote> </blockquote> <p> </p> <blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> </blockquote> <p> I originally asked about the problem here: <a class="ext-link" href="http://stackoverflow.com/questions/17599772/boost-exceptions-lead-to-stack-pointer-corruption-run-time-check-failure-0"><span class="icon">​</span>http://stackoverflow.com/questions/17599772/boost-exceptions-lead-to-stack-pointer-corruption-run-time-check-failure-0</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8863 Trac 1.4.3 Janosch <gagabla0@…> Fri, 19 Jul 2013 21:37:35 GMT version changed https://svn.boost.org/trac10/ticket/8863#comment:1 https://svn.boost.org/trac10/ticket/8863#comment:1 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.54.0</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> </ul> Ticket Emil Dotchevski Sat, 20 Jul 2013 00:40:42 GMT <link>https://svn.boost.org/trac10/ticket/8863#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8863#comment:2</guid> <description> <p> I ran your program against the current trunk revision of Boost and it worked fine. I was going to add this as a test in Boost Exception, however I realized that the string constructor of std::exception is not standard, so I didn't. </p> <p> It probably makes sense for you to run libs/exception/test/1-throw_exception_test.cpp with your setup. If that crashes too, then most likely the problem is specific to your system. </p> </description> <category>Ticket</category> </item> <item> <author>vpozdyayev+boost@…</author> <pubDate>Wed, 20 Apr 2016 07:09:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8863#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8863#comment:3</guid> <description> <p> This issue is still there for Boost 1.60.0 under MSVC2015.2 (configuration=Debug, platform=x86). </p> </description> <category>Ticket</category> </item> <item> <author>vpozdyayev+boost@…</author> <pubDate>Wed, 20 Apr 2016 07:15:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8863#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8863#comment:4</guid> <description> <p> Note: the "minimal test-program" fails (with "The value of ESP..."), libs/exception/test/1-throw_exception_test.cpp does not. </p> </description> <category>Ticket</category> </item> </channel> </rss>