[Top][All Lists]
[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: |
Wed, 25 Feb 2009 02:03:21 +0000 |
User-agent: |
Thunderbird 2.0.0.19 (Windows/20081209) |
On 2009-02-25 00:26Z, Vadim Zeitlin wrote:
> On Tue, 24 Feb 2009 20:54:33 +0000 Greg Chicares <address@hidden> wrote:
>
> GC> The directory that '--data_path' points to must contain
> GC> qx_cso.dat
> GC> qx_cso.ndx
> GC> among other files; I would speculate that it does not.
>
> You're absolutely right, sorry for not realizing this. In my defense, the
> error message might be a tad more clear...
Here's a refinement that I have sketched out and compiled,
but have not yet been able to test:
Index: actuarial_table.cpp
===================================================================
RCS file: /sources/lmi/lmi/actuarial_table.cpp,v
retrieving revision 1.51
diff -U 3 -r1.51 actuarial_table.cpp
--- actuarial_table.cpp 27 Dec 2008 02:56:35 -0000 1.51
+++ actuarial_table.cpp 25 Feb 2009 01:14:22 -0000
@@ -215,6 +215,15 @@
fs::path index_path(filename_);
index_path = fs::change_extension(index_path, ".ndx");
fs::ifstream index_ifs(index_path, ios_in_binary());
+ if(!index_ifs)
+ {
+ fatal_error()
+ << "Unable to open file '"
+ << filename_
+ << "'."
+ << LMI_FLUSH
+ ;
+ }
// TODO ?? Assert endianness too? SOA tables are not portable;
// probably they can easily be read only on x86 hardware.
A more thorough refinement would probably test 'data_ifs',
later in the same file:
fs::path data_path(filename_);
data_path = fs::change_extension(data_path, ".dat");
fs::ifstream data_ifs(data_path, ios_in_binary());
+ // INSERT TEST HERE
much as 'index_ifs' was tested in the patch above.
> But unfortunately -- and sorry if I'm missing something obvious again --
> even after unpacking the contents of
>
> GC>
> http://download.savannah.gnu.org/releases-noredirect/lmi/lmi-data-20050618T1440Z.tar.bz2
That archive contains 'sample.dat' and 'sample.ndx'
(which becomes significant below).
> in the data directory (which happens to be just "." as I don't use
> --data_path)
That's how our msw end-user distributions work, too, BTW.
> I still get an error (and a subsequent crash), albeit a
> different one:
>
> Table 8 in file './sample': offset -1 is invalid.
> [file .\actuarial_table.cpp, line 275]
That's very similar to the previous error message you reported:
On 2009-02-24 19:33Z, Vadim Zeitlin wrote:
| Table 57 in file './qx_cso': offset -1 is invalid.
| [file .\actuarial_table.cpp, line 275]
Same line, same function, different data file. The older error
message was apparently fixed by placing the 'qx_cso' files
('qx_cso.dat' and 'qx_cso.ndx') in the data directory. I don't
see how the later error message can arise, since you've placed
the 'sample.dat' and 'sample.ndx' files in that directory AIUI.
> Does this indicate something wrong with my product_files binary which I
> used to generate sample.{pol,rnd,db4,fnd,tir} files?
No, 'actuarial_table.?pp' reads 'sample.{dat,ndx}', but the
other 'sample' files enumerated above are read by other means.
> GC> > 1. safe_message_alert() doesn't seem to be safe
[...]
> The cause for (1) is in fact a MSVC-specific feature/bug: it translates
> Win32 SEH exceptions into C++ exceptions. So the crash, which happens
> during repainting of the window is caught and the program tries to report
> it and then the window is repainted again (while the message box is being
> shown) and it crashes again and so on. This particular problem is MSVC-
> specific but I do wonder if there shouldn't be some recursion safeguards in
> safe_message_alert() to prevent this kind of problem.
I'd consider a patch to guard against recursion, if you'd
like to write one. I couldn't test it myself because I
don't use that compiler.
- [lmi] wxmsw-2.9.0 regression: messagebox doubling, Greg Chicares, 2009/02/24
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Vadim Zeitlin, 2009/02/24
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Greg Chicares, 2009/02/24
- Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Vadim Zeitlin, 2009/02/24
- Message not available
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling,
Greg Chicares <=
- Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Vadim Zeitlin, 2009/02/25
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Greg Chicares, 2009/02/26
- Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Vadim Zeitlin, 2009/02/26
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Greg Chicares, 2009/02/26
- Re: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Greg Chicares, 2009/02/26
- Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling, Vadim Zeitlin, 2009/02/26
- Re[2]: Input copy ctor (was: [lmi] wxmsw-2.9.0 regression: messagebox doubling), Vadim Zeitlin, 2009/02/26
- [lmi] Re: Input copy ctor, Greg Chicares, 2009/02/26
- Re: [lmi] Re: Input copy ctor, Vadim Zeitlin, 2009/02/26
- Re: [lmi] Re: Input copy ctor, Greg Chicares, 2009/02/26