Using:<br>
<br>
CLI&amp; CLI::GetSingleton()<br>
{<br>
  static CLI instance;<br>
  Log::Info &lt;&lt; &quot;Getting Singleton\n&quot;; ////modified for test///////////<br>
  return instance;<br>
}<br>
<br>
<br>
The call stack I get on crash is<br>
<br>
mlpack_allknn.exe!std::operator&lt;&lt;&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;<br>
&gt;... Line 177    C++<br>
     mlpack_allknn.exe!mlpack::util::PrefixedOutStream::BaseLogic&lt;char<br>
const * __ptr64&gt;... Line 76    C++<br>
     mlpack_allknn.exe!mlpack::util::PrefixedOutStream::operator&lt;&lt;... Line<br>
93    C++<br>
     mlpack_allknn.exe!mlpack::CLI::GetSingleton... Line 342    C++<br>
     mlpack_allknn.exe!mlpack::CLI::RegisterProgramDoc... Line 670    C++<br>
     mlpack_allknn.exe!mlpack::util::ProgramDoc::ProgramDoc... Line 33<br>
C++<br>
     mlpack_allknn.exe!`dynamic initializer for<br>
&#39;io_programdoc_dummy_object&#39;&#39;... Line 26    C++<br>
<br>
ProgramDoc is initialized before<br>
CLI::Singleton which is initialized before<br>
Log::Info<br>
<br>
The last two are out of order and hence the crash. Removing my mod will<br>
cause the crash at the end rather than at the beginning.<br>
<br>
(a) My first suggestion, which I am not sure about, is to move PROGRAM_INFO<br>
etc., to inside main.<br>
<br>
(b) The other option is to go back to CLI_Deleter, except declare the<br>
CLI_Deleter static instance in log.cpp after Log::Fatal<br>
<br>
I&#39;ll test my second suggestion and get back to you.<br>
<br>
On Thu, Feb 25, 2016 at 1:33 AM, Ryan Curtin &lt;notifications@github.com&gt;<br>
wrote:<br>
<br>
&gt; No specific dataset needed; you can make a very simple csv:<br>
&gt;<br>
&gt; 1, 2<br>
&gt; 3, 4<br>
&gt; 5, 6<br>
&gt;<br>
&gt; Then, on the systems I&#39;ve tried, I get<br>
&gt;<br>
&gt; $ bin/mlpack_allknn -r f.csv -v -k 3<br>
&gt; [DEBUG] Compiled with debugging symbols.<br>
&gt; [WARN ] Neither --neighbors_file nor --distances_file is specified, so the nearest neighbor search results will not be saved!<br>
&gt; [INFO ] Loading &#39;f.csv&#39; as CSV data.  Size is 2 x 3.<br>
&gt; [INFO ] Loaded reference data from &#39;f.csv&#39; (2 x 3).<br>
&gt; [INFO ] Building reference tree...<br>
&gt; [INFO ] Tree built.<br>
&gt; [INFO ] Searching for 3 nearest neighbors with dual-tree kd-tree search...<br>
&gt; [INFO ] 3 node combinations were scored.<br>
&gt; [INFO ] 6 base cases were calculated.<br>
&gt; [INFO ] Search complete.<br>
&gt; pÛyg_neighbors<br>
&gt; pÛyg_neighborsExecution parameters:<br>
&gt; pÛyn parameter  distances_file: &quot;&quot;<br>
&gt; pÛyn parameter  help: false<br>
&gt; pÛyrameter  info: &quot;&quot;<br>
&gt; pÛyrameter  input_model_file: &quot;&quot;<br>
&gt; pÛydel_fileer  k: 3<br>
&gt; pÛyfileer  leaf_size: 20<br>
&gt; pÛyfileer  naive: false<br>
&gt; pÛyfileer  neighbors_file: &quot;&quot;<br>
&gt; pÛyfileer  output_model_file: &quot;&quot;<br>
&gt; pÛyodel_filer  query_file: &quot;&quot;<br>
&gt; pÛyodel_filer  random_basis: false<br>
&gt; pÛyodel_filer  reference_file: f.csv<br>
&gt; pÛyodel_filer  seed: 0<br>
&gt; pÛy_filer  single_mode: false<br>
&gt; pÛy_filer  tree_type: kd<br>
&gt; pÛy_filer  verbose: true<br>
&gt; pÛy_filer  version: false<br>
&gt; pÛy_filer<br>
&gt; pÛy_filerProgram timers:<br>
&gt; pÛy_filer  computing_neighbors: 0.000053s<br>
&gt; pÛyg_neighbors  loading_data: 0.000186s<br>
&gt; pÛyg_neighbors  total_time: 0.001866s<br>
&gt; pÛyg_neighbors  tree_building: 0.000051s<br>
&gt;<br>
&gt; —<br>
&gt; Reply to this email directly or view it on GitHub<br>
&gt; &lt;https://github.com/mlpack/mlpack/pull/521#issuecomment-188279136&gt;.<br>
&gt;<br>
<br>
<br>
<br>
-- <br>
Joseph Chakravarti Mariadassou<br>
http://thesundayprogrammer.com<br>


<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/521#issuecomment-188481366">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPID5ZmqyfXVhlvICF-F_PHRurqXks5pniTMgaJpZM4HX7Db.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/521#issuecomment-188481366"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>