Also note that in the current 'master' cliDeleter is static declared<br>
outside a class. AFAIK every translation unit that #includes cli.hpp has an<br>
instance of cliDeleter. This is not what you want.<br>
<br>
On Thu, Feb 25, 2016 at 9:22 AM, Joe Mariadassou <joe.mariadassou@gmail.com><br>
wrote:<br>
<br>
> Using:<br>
><br>
> CLI& CLI::GetSingleton()<br>
> {<br>
> static CLI instance;<br>
> Log::Info << "Getting Singleton\n"; ////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<<<char,std::char_traits<char>,std::allocator<char><br>
> >... Line 177 C++<br>
> mlpack_allknn.exe!mlpack::util::PrefixedOutStream::BaseLogic<char<br>
> const * __ptr64>... Line 76 C++<br>
> mlpack_allknn.exe!mlpack::util::PrefixedOutStream::operator<<... 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>
> 'io_programdoc_dummy_object''... 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<br>
> PROGRAM_INFO 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'll test my second suggestion and get back to you.<br>
><br>
> On Thu, Feb 25, 2016 at 1:33 AM, Ryan Curtin <notifications@github.com><br>
> wrote:<br>
><br>
>> No specific dataset needed; you can make a very simple csv:<br>
>><br>
>> 1, 2<br>
>> 3, 4<br>
>> 5, 6<br>
>><br>
>> Then, on the systems I've tried, I get<br>
>><br>
>> $ bin/mlpack_allknn -r f.csv -v -k 3<br>
>> [DEBUG] Compiled with debugging symbols.<br>
>> [WARN ] Neither --neighbors_file nor --distances_file is specified, so the nearest neighbor search results will not be saved!<br>
>> [INFO ] Loading 'f.csv' as CSV data. Size is 2 x 3.<br>
>> [INFO ] Loaded reference data from 'f.csv' (2 x 3).<br>
>> [INFO ] Building reference tree...<br>
>> [INFO ] Tree built.<br>
>> [INFO ] Searching for 3 nearest neighbors with dual-tree kd-tree search...<br>
>> [INFO ] 3 node combinations were scored.<br>
>> [INFO ] 6 base cases were calculated.<br>
>> [INFO ] Search complete.<br>
>> pÛyg_neighbors<br>
>> pÛyg_neighborsExecution parameters:<br>
>> pÛyn parameter distances_file: ""<br>
>> pÛyn parameter help: false<br>
>> pÛyrameter info: ""<br>
>> pÛyrameter input_model_file: ""<br>
>> pÛydel_fileer k: 3<br>
>> pÛyfileer leaf_size: 20<br>
>> pÛyfileer naive: false<br>
>> pÛyfileer neighbors_file: ""<br>
>> pÛyfileer output_model_file: ""<br>
>> pÛyodel_filer query_file: ""<br>
>> pÛyodel_filer random_basis: false<br>
>> pÛyodel_filer reference_file: f.csv<br>
>> pÛyodel_filer seed: 0<br>
>> pÛy_filer single_mode: false<br>
>> pÛy_filer tree_type: kd<br>
>> pÛy_filer verbose: true<br>
>> pÛy_filer version: false<br>
>> pÛy_filer<br>
>> pÛy_filerProgram timers:<br>
>> pÛy_filer computing_neighbors: 0.000053s<br>
>> pÛyg_neighbors loading_data: 0.000186s<br>
>> pÛyg_neighbors total_time: 0.001866s<br>
>> pÛyg_neighbors tree_building: 0.000051s<br>
>><br>
>> —<br>
>> Reply to this email directly or view it on GitHub<br>
>> <https://github.com/mlpack/mlpack/pull/521#issuecomment-188279136>.<br>
>><br>
><br>
><br>
><br>
> --<br>
> Joseph Chakravarti Mariadassou<br>
> http://thesundayprogrammer.com<br>
><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;">—<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/521#issuecomment-188535026">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFBnpieMwiC9UR6-3iKEuGRlvSZb4ks5pnkQlgaJpZM4HX7Db.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-188535026"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>