Boost C++ Libraries: Ticket #9833: "leaking exception" (eg. geometric distribution) https://svn.boost.org/trac10/ticket/9833 <p> Sorry to label this outright as a "bug" ... it might just be my misunderstanding. </p> <p> Consider the code included below ... please save it as-is as test.cpp and build it with: g++ -o test test.cpp. Then uncomment the #define USE_CONFIG_FILE on the first line and repeat the above process to see the issue. </p> <p> Thank you.<br /> HS </p> <pre class="wiki">// #define USE_CONFIG_FILE 1 #ifdef USE_CONFIG_FILE #include &lt;boost/math/distributions.hpp&gt; #include &lt;boost/math/policies/policy.hpp&gt; namespace test { using namespace boost::math::policies; typedef policy&lt; domain_error&lt; ignore_error &gt;, overflow_error&lt; ignore_error &gt;, discrete_quantile&lt; integer_round_up &gt; &gt; my_boost_policy; BOOST_MATH_DECLARE_DISTRIBUTIONS( double, my_boost_policy ); } #else #define BOOST_MATH_DOMAIN_ERROR_POLICY ignore_error #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error #define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_up #endif #include &lt;cstdlib&gt; #include &lt;cstdio&gt; #include &lt;boost/math/distributions/geometric.hpp&gt; int main() { double _p0 = 1.0; double _x = 0.0; #ifdef USE_CONFIG_FILE test::geometric _dist( _p0 ); #else boost::math::geometric_distribution&lt;&gt; _dist( _p0 ); #endif /* USE_CONFIG_FILE */ std::printf( "\n" " 1-CDF(0,false): %g\n", boost::math::cdf( boost::math::complement( _dist, _x ) ) ); std::printf( " CDF(0,false): %g\n\n", boost::math::cdf( _dist, _x ) ); return EXIT_SUCCESS; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9833 Trac 1.4.3 John Maddock Fri, 04 Apr 2014 14:09:42 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9833#comment:1 https://svn.boost.org/trac10/ticket/9833#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">fixed</span> </li> </ul> <p> Definitely a bug, fixed in <a class="ext-link" href="https://github.com/boostorg/math/commit/9199b09304fe6d6d11aa7ac9cc9ea3127f6d91d1"><span class="icon">​</span>https://github.com/boostorg/math/commit/9199b09304fe6d6d11aa7ac9cc9ea3127f6d91d1</a> </p> Ticket HS <tan@…> Sat, 05 Apr 2014 05:54:01 GMT <link>https://svn.boost.org/trac10/ticket/9833#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9833#comment:2</guid> <description> <p> Thanks for the quick action! </p> <p> With best regards,<br /> HS </p> </description> <category>Ticket</category> </item> </channel> </rss>