lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling


From: Vadim Zeitlin
Subject: Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling
Date: Wed, 25 Feb 2009 23:29:27 +0100

On Wed, 25 Feb 2009 02:03:21 +0000 Greg Chicares <address@hidden> wrote:

GC> Here's a refinement that I have sketched out and compiled,
GC> but have not yet been able to test:
GC> 
GC> Index: actuarial_table.cpp
GC> ===================================================================
GC> RCS file: /sources/lmi/lmi/actuarial_table.cpp,v
GC> retrieving revision 1.51
GC> diff -U 3 -r1.51 actuarial_table.cpp
GC> --- actuarial_table.cpp     27 Dec 2008 02:56:35 -0000      1.51
GC> +++ actuarial_table.cpp     25 Feb 2009 01:14:22 -0000
GC> @@ -215,6 +215,15 @@
GC>      fs::path index_path(filename_);
GC>      index_path = fs::change_extension(index_path, ".ndx");
GC>      fs::ifstream index_ifs(index_path, ios_in_binary());
GC> +    if(!index_ifs)
GC> +        {
GC> +        fatal_error()
GC> +            << "Unable to open file '"
GC> +            << filename_
GC> +            << "'."
GC> +            << LMI_FLUSH
GC> +            ;
GC> +        }

 This looks much better, thanks!

GC> A more thorough refinement would probably test 'data_ifs',
GC> later in the same file:
GC> 
GC>     fs::path data_path(filename_);
GC>     data_path = fs::change_extension(data_path, ".dat");
GC>     fs::ifstream data_ifs(data_path, ios_in_binary());
GC> +   // INSERT TEST HERE
GC> 
GC> much as 'index_ifs' was tested in the patch above.

 Yes, this would be nice too.


GC> >  But unfortunately -- and sorry if I'm missing something obvious again --
GC> > even after unpacking the contents of
GC> > 
GC> > GC> 
http://download.savannah.gnu.org/releases-noredirect/lmi/lmi-data-20050618T1440Z.tar.bz2
GC> 
GC> That archive contains 'sample.dat' and 'sample.ndx'
GC> (which becomes significant below).

 This is psychic debugging at its best... It turns out that I did unpack
these files to the wrong location which explained the error. Sorry for
wasting your time with this.

GC> >   Table 8 in file './sample': offset -1 is invalid.
GC> >   [file .\actuarial_table.cpp, line 275]
GC> 
GC> That's very similar to the previous error message you reported:
GC> 
GC> On 2009-02-24 19:33Z, Vadim Zeitlin wrote:
GC> | Table 57 in file './qx_cso': offset -1 is invalid.
GC> | [file .\actuarial_table.cpp, line 275]
GC> 
GC> Same line, same function, different data file.

 I'd also like to propose to use the real file name here instead of just
the base name. It's impossible to know which file exactly it failed to read
otherwise.


 Unfortunately my troubles are still not over, now I get a crash here:

        lmi_wx.exe!std::multiplies<double>::operator()(const double & 
_Left=0.50000000000000000, const double & _Right=)  Line 62 + 0x8 C++
        lmi_wx.exe!std::transform<std::vector<double,std::allocator<double> 
>::iterator,std::vector<double,std::allocator<double> 
>::iterator,std::vector<double,std::allocator<double> 
>::iterator,std::multiplies<double> >()  Line 401 + 0x1a        
>       lmi_wx.exe!MortalityRates::SetNonguaranteedRates()  Line 188 + 0x4c     
> C++
        lmi_wx.exe!MortalityRates::initialize()  Line 73        C++
        lmi_wx.exe!MortalityRates::MortalityRates(const BasicValues & 
basic_values={...})  Line 46      C++
        lmi_wx.exe!BasicValues::Init()  Line 261 + 0x32 C++
        lmi_wx.exe!BasicValues::BasicValues(const Input & input={...})  Line 98 
C++
        lmi_wx.exe!AccountValue::AccountValue(const Input & input={...})  Line 
113 + 0xb7       C++
        lmi_wx.exe!IllusVal::run()  Line 52 + 0x11      
        lmi_wx.exe!illustrator::operator()()  Line 125 + 0xc    
        lmi_wx.exe!IllustrationView::Run(Input * overriding_input=0x00000000)  
Line 302 + 0x84  C++
        lmi_wx.exe!IllustrationView::OnCreate(wxDocument * doc=0x01df8450, long 
flags=0x00000001)  Line 211     C++
        ...

 What happens is that CurrentCoiMultiplier_ is empty but
curr_coi_multiplier (and hence CCoiMultiplier_) is not in
MortalityRates::SetNonguaranteedRates(). This means that

    std::transform
        (curr_coi_multiplier.begin()
        ,curr_coi_multiplier.end()
        ,CurrentCoiMultiplier_.begin()
        ,curr_coi_multiplier.begin()
        ,std::multiplies<double>()
        );

tries to dereference CurrentCoiMultiplier_.begin() which is invalid.

 Unfortunately I don't know where exactly the problem lies, in particular I
don't really understand what does MortalityRates::fetch_parameters() do. I
can continue looking at it but, again, as this is just a side (albeit
important as it prevents me from going forward) issue for me I'd be glad
for any help with this. I just hope it's not my error again (although
admittedly the program shouldn't crash anyhow...) but I don't know what
else could I have done wrongly: I copied the .ndx and .dat files in the
right location and I regenerated the product data files again just to be
sure. Should I have done anything else?


 And FWIW the problem doesn't happen only here but also arises in
InterestRates::Initialize() with a transform() call involving
ExtraSepAcctCharge_ and v.yare_input_.ExtraCompensationOnAssets. And if I
skip over this one as well I get LMI_ASSERT failures in death_benefits ctor
but I thought that maybe this one was a consequence of skipping over the
previous crashes so I stopped debugging there.

 Thanks in advance,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]