Boost C++ Libraries: Ticket #9930: Copy-constructed mt19937_64 segfaults https://svn.boost.org/trac10/ticket/9930 <p> The copy constructor for mt19937_64 seems to leave the copy in a corrupt state. Trying to generate random numbers from the copy consistently results in a segmentation fault. </p> <p> The attached file exhibits the problem: </p> <p> $ g++ -std=c++11 -g -O0 main.cpp &amp;&amp; ./a.out 5 5 $ g++ -std=c++11 -g -O0 -DUSE_64BIT main.cpp &amp;&amp; ./a.out 1 Segmentation fault (core dumped) </p> <p> The version of g++ used is "g++-4.8 (Ubuntu 4.8.1-2ubuntu1~12.04) 4.8.1". </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9930 Trac 1.4.3 Tim Cooijmans <t.cooijmans@…> Sat, 19 Apr 2014 21:33:11 GMT attachment set https://svn.boost.org/trac10/ticket/9930 https://svn.boost.org/trac10/ticket/9930 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> Ticket Tim Cooijmans <t.cooijmans@…> Sat, 19 Apr 2014 21:35:49 GMT <link>https://svn.boost.org/trac10/ticket/9930#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9930#comment:1</guid> <description> <p> Okay, I should have previewed. This is the terminal session with proper formatting: </p> <pre class="wiki">$ g++ -std=c++11 -g -O0 main.cpp &amp;&amp; ./a.out 5 5 $ g++ -std=c++11 -g -O0 -DUSE_64BIT main.cpp &amp;&amp; ./a.out 1 Segmentation fault (core dumped) </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sat, 19 Apr 2014 21:58:11 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9930#comment:2 https://svn.boost.org/trac10/ticket/9930#comment:2 <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> return_generator returns a dangling reference to the local generator. </p> Ticket