Boost C++ Libraries: Ticket #967: [program_options] crash on release builds on windows using msvc-8.0 and msvc-8.0_64 https://svn.boost.org/trac10/ticket/967 <p> i compiled boost for windows using the msvc-8.0 and msvc-8.0_64 targets. the following code works perfectly on debug builds but crashes on the marked line in x64 mode and goes into an infinite loop in x86 mode. i used visual studio 2005 with and without service pack 1 and even tried the head version of boost from cvs. everytime the crash occurs. </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/program_options.hpp&gt; namespace po = boost::program_options; int main(int argc, char **argv) { int width; int height; try { po::options_description cmd_options("program options"); cmd_options.add_options() ("help", "show this help message") ("width", po::value&lt;int&gt;(&amp;width)-&gt;default_value(1024), "output width") ("height", po::value&lt;int&gt;(&amp;height)-&gt;default_value(640), "output height"); po::variables_map command_line; // the next line produces the crash po::store(po::parse_command_line(argc, argv, cmd_options), command_line); po::notify(command_line); if (command_line.count("help")) { std::cout &lt;&lt; "usage: " &lt;&lt; std::endl; std::cout &lt;&lt; cmd_options; return (0); } } catch (std::exception&amp; e) { std::cout &lt;&lt; e.what() &lt;&lt; std::endl; return (-1); } return (0); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/967 Trac 1.4.3 Christopher Lux Mon, 21 May 2007 18:17:01 GMT <link>https://svn.boost.org/trac10/ticket/967#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/967#comment:1</guid> <description> <p> i found the problem (well rediscovered it): <a class="ext-link" href="http://lists.boost.org/boost-users/2006/05/19342.php"><span class="icon">​</span>http://lists.boost.org/boost-users/2006/05/19342.php</a> </p> <p> when disabling _SECURE_SCL on VS8.0 store crashes. </p> <p> i hope this can be fixed somehow... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Christopher Lux</dc:creator> <pubDate>Mon, 21 May 2007 21:59:52 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/967#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/967#comment:2</guid> <description> <p> This ticket can be closed. The issue was that boost was compiles with all default compiler settings but the application using program options defined _SECURE_SCL=0 for the release builds. Building boost also with this defined everything workes as expected. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Witt</dc:creator> <pubDate>Tue, 22 May 2007 01:27:55 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/967#comment:3 https://svn.boost.org/trac10/ticket/967#comment:3 <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> Ticket