lmi
[Top][All Lists]
Advanced

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

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


From: Greg Chicares
Subject: Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling
Date: Thu, 26 Feb 2009 06:04:18 +0000
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

On 2009-02-25 22:29Z, Vadim Zeitlin wrote:
> 
>  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++
[...]
>  What happens is that CurrentCoiMultiplier_ is empty but
> curr_coi_multiplier (and hence CCoiMultiplier_) is not in
> MortalityRates::SetNonguaranteedRates(). This means that
> 
>     std::transform
[...]
> tries to dereference CurrentCoiMultiplier_.begin() which is invalid.

Does "lmi_wx.exe!MortalityRates..." mean you're using msvc? If so,
then does it work with gcc? My fear is that we might have discovered
some area where lmi unintentionally relies on implementation-defined
behavior of gcc.

Can you run
  make cli_tests
successfully? That would exercise the code that's failing here, in a
way that doesn't use wx at all.

>  Unfortunately I don't know where exactly the problem lies, in particular I
> don't really understand what does MortalityRates::fetch_parameters() do. I

Class MortalityRates is instantiated in the context of the state of a
BasicValues object. That state is transported by fetch_parameters().
This lets us write a standalone unit test for MortalityRates that
doesn't bring in BasicValues and all its dependencies, by using a
special ctor that injects that state by other means, without calling
fetch_parameters(). Thus, 'mortality_rates_fetch.cpp' segregates all
the BasicValues-dependent code so that it can be excluded from the
unit test.

> 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?

'install_msw.sh' contains all the steps and is well tested. It takes
an hour or so to run, and builds its own libraries, which I know you
would rather avoid, but it does work for me. See:
  http://lists.nongnu.org/archive/html/lmi/2007-12/msg00002.html
This would rule out any differences between compilers, library
versions, and data files. But I don't suspect that any missing data
file would explain what you're seeing.

>  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.

Yes, I'd expect assertions downstream to fire in that case.

It is interesting that similar failures are observed in classes
InterestRates and MortalityRates, under similar circumstances.
Below is an experimental patch that tests the data at various
points for the MortalityRates case, which fails first. Privately
I'll send you an archived copy of this patch, because long lines
might be broken on the mailing list.

Index: input_realization.cpp
===================================================================
RCS file: /sources/lmi/lmi/input_realization.cpp,v
retrieving revision 1.16
diff -U 3 -r1.16 input_realization.cpp
--- input_realization.cpp       23 Feb 2009 15:55:47 -0000      1.16
+++ input_realization.cpp       26 Feb 2009 05:47:47 -0000
@@ -430,6 +430,16 @@
         ,CurrentCoiMultiplierRealized_
         ,CurrentCoiMultiplier
         );
+warning()
+  << CurrentCoiMultiplierRealized_.size()
+  << " is CurrentCoiMultiplierRealized_.size()\n"
+  << years_to_maturity() << " is years_to_maturity()\n"
+  << issue_age        () << " is issue_age        ()\n"
+  << retirement_age   () << " is retirement_age   ()\n"
+  << inforce_year     () << " is inforce_year     ()\n"
+  << effective_year   () << " is effective_year   ()\n"
+  << LMI_FLUSH
+  ;
     if(s.size())
         {
         return s;
Index: mortality_rates_fetch.cpp
===================================================================
RCS file: /sources/lmi/lmi/mortality_rates_fetch.cpp,v
retrieving revision 1.3
diff -U 3 -r1.3 mortality_rates_fetch.cpp
--- mortality_rates_fetch.cpp   27 Dec 2008 02:56:49 -0000      1.3
+++ mortality_rates_fetch.cpp   26 Feb 2009 05:47:47 -0000
@@ -28,6 +28,7 @@

 #include "mortality_rates.hpp"

+#include "alert.hpp"
 #include "basic_values.hpp"
 #include "database.hpp"
 #include "dbnames.hpp"
@@ -73,6 +74,13 @@
     SubstandardTable_     = basic_values.yare_input_.SubstandardTable;

     CurrentCoiMultiplier_ = basic_values.yare_input_.CurrentCoiMultiplier;
+warning()
+  << basic_values.yare_input_.CurrentCoiMultiplier.size()
+  << " is basic_values.yare_input_.CurrentCoiMultiplier.size()\n"
+  << CurrentCoiMultiplier_.size()
+  << " is CurrentCoiMultiplier_.size()\n"
+  << LMI_FLUSH
+  ;
     MonthlyFlatExtra_     = basic_values.yare_input_.FlatExtra;

     // TODO ?? Defectively, this data member is not yet used.
Index: yare_input.cpp
===================================================================
RCS file: /sources/lmi/lmi/yare_input.cpp,v
retrieving revision 1.16
diff -U 3 -r1.16 yare_input.cpp
--- yare_input.cpp      27 Dec 2008 02:57:00 -0000      1.16
+++ yare_input.cpp      26 Feb 2009 05:47:47 -0000
@@ -28,6 +28,7 @@

 #include "yare_input.hpp"

+#include "alert.hpp"
 #include "input.hpp"
 #include "miscellany.hpp" // each_equal()

@@ -167,6 +168,13 @@
     ExtraCompensationOnPremium      = convert_vector_type<double              
>(z.ExtraCompensationOnPremiumRealized_     );
     PartialMortalityMultiplier      = convert_vector_type<double              
>(z.PartialMortalityMultiplierRealized_     );
     CurrentCoiMultiplier            = convert_vector_type<double              
>(z.CurrentCoiMultiplierRealized_           );
+warning()
+  << z.CurrentCoiMultiplierRealized_.size()
+  << " is z.CurrentCoiMultiplierRealized_.size()\n"
+  << CurrentCoiMultiplier.size()
+  << " is CurrentCoiMultiplier.size()\n"
+  << LMI_FLUSH
+  ;
     CorporationTaxBracket           = convert_vector_type<double              
>(z.CorporationTaxBracketRealized_          );
     TaxBracket                      = convert_vector_type<double              
>(z.TaxBracketRealized_                     );
     ProjectedSalary                 = convert_vector_type<double              
>(z.ProjectedSalaryRealized_                );




reply via email to

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