I have looked into these errors and have found the problem, the windows
version of strftime does not support all the format flags on Linux and so
the errors.

There are two places I see this error..
The first is from function gnc_ctime at line 234 of gnc-date.cpp, the
format string uses a %e for the day of the month with a leading space. This
I think can be changed to %d, a leading zero if required, as searching for
that function shows it is only used in PINFO statements.

The second is generate_statusbar_lastmodified_message at line 1654 of
gnc-main-window.cpp, again the format string uses %e so could be replaced
with %d but also uses %P for a lower case am/pm but this could be changed
to %p for upper case.

I looked at these references...
http://www.boost.org/doc/libs/1_60_0/doc/html/date_time/date_time_io.html#date_time.format_flags
https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx

Robert


On 1 May 2016 at 13:21, Robert Fewell <14ubo...@gmail.com> wrote:

> John,
>
> Here are the first 8 frames, I was a bit to keen on cutting output...
>
> #0  0x74c4e420 in OutputDebugStringA () from
> C:\WINDOWS\SYSTEM32\KernelBase.dll
> #1  0x754489f4 in msvcrt!_invalid_parameter () from
> C:\WINDOWS\SYSTEM32\msvcrt.dll
> #2  0x753f4e60 in wctype () from C:\WINDOWS\SYSTEM32\msvcrt.dll
> #3  0x00010001 in ?? ()
> #4  0x7547b72a in msvcrt!_Strftime () from C:\WINDOWS\SYSTEM32\msvcrt.dll
> #5  0x7547b76a in strftime () from C:\WINDOWS\SYSTEM32\msvcrt.dll
> #6  0x00ecf89a in libstdc++-6!_ZNKSt11__timepunctIcE6_M_putEPcjPKcPK2tm
> ()   from c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
> #7  0x00ee3193 in
> libstdc++-6!_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPK2tmcc
> () from c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
> #8  0x00ee3022 in
> libstdc++-6!_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecPK2tmPKcSB_
> () from c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
>
>
> Robert
>
> On 29 April 2016 at 16:13, John Ralls <jra...@ceridwen.us> wrote:
>
>>
>> > On Apr 29, 2016, at 4:09 AM, Robert Fewell <14ubo...@gmail.com> wrote:
>> >
>> > Hi,
>> >
>> > After a recent install of Windows10, I tried to install the latest
>> nightly
>> > build, this installs OK but fails to run with the following error...
>> >
>> > terminate called after throwing an instance of 'std::out_of_range'
>> >  what():  Year 2016 isn't covered by this time zone.
>> >
>> > I then set about building my own, this built OK but fails to start from
>> the
>> > inst directory with the same error as above.
>> >
>> > Running it from GDB, I get a back trace of...
>> >
>> > #8  0x008c77df in libstdc++-6!.cxa_throw () from
>> > c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
>> >
>> > #9  0x00a6efc6 in TimeZoneProvider::get (this=0xb3957c <tzp>, year=2016)
>> > at c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:661
>> > #10 0x00a6f6d8 in LDT_from_unix_local (time=1461847455) at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:106
>> > #11 0x00a91796 in GncDateTimeImpl::GncDateTimeImpl (this=0x733d638,
>> > time=1461847455)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:136
>> > #12 0x00a70561 in GncDateTime::GncDateTime (this=0x64ea5c,
>> > time=1461847455)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:272
>> > #13 0x00a6280a in gnc_localtime_r (secs=0x64eab8, time=0x64ea94)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-date.cpp:117
>> > #14 0x00a635b6 in timespecCanonicalDayTime (t=...) at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-date.cpp:459
>> >
>> > #15 0x635e799c in _wrap_timespecCanonicalDayTime (s_0=0x8690a80) at
>> > swig-engine.c:19965
>> >
>> > As a test, I changed my Time Zone from 'UTC Dublin' to 'UTC+1 Amsterdam'
>> > and got the same output.
>> >
>> > Changing it to 'UTC+2 Cairo', the out put is different as below...
>> >
>> > #5  0x00f377ec in libstdc++-6!.cxa_throw () from
>> > c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
>> >
>> > #6  0x008d79fc in boost::throw_exception<boost::gregorian::bad_month>
>> > (e=...)    at c:/gcdev/boost/include/boost/throw_exception.hpp:70
>> > #7  0x008dc6da in boost::CV::simple_exception_policy<unsigned short,
>> > (unsigned short)1, (unsigned short)12,
>> > boost::gregorian::bad_month>::on_error () at
>> > c:/gcdev/boost/include/boost/date_time/constrained_value.hpp:110
>> > #8  0x008dc39d in
>> > boost::CV::constrained_value<boost::CV::simple_exception_policy<unsigned
>> > short, (unsigned short)1, (unsigned short)12,
>> boost::gregorian::bad_month>
>> >> ::assign (this=0x64f5e8, value=0)    at
>> > c:/gcdev/boost/include/boost/date_time/constrained_value.hpp:69
>> > #9  0x008dc410 in
>> > boost::CV::constrained_value<boost::CV::simple_exception_policy<unsigned
>> > short, (unsigned short)1, (unsigned short)12,
>> boost::gregorian::bad_month>
>> >> ::constrained_value (this=0x64f5e8, value=0)    at
>> > c:/gcdev/boost/include/boost/date_time/constrained_value.hpp:48
>> > #10 0x00903f2d in boost::gregorian::greg_month::greg_month
>> (this=0x64f5e8,
>> > theMonth=0)    at
>> > c:/gcdev/boost/include/boost/date_time/gregorian/greg_month.hpp:64
>> > #11 0x008adedc in zone_from_regtzi (regtzi=..., names=...) at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:161
>> > #12 0x008ae387 in TimeZoneProvider::load_windows_dynamic_tz
>> (this=0x97957c
>> > <tzp>, key=0x17c, names=...)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:199
>> > #13 0x008aecab in TimeZoneProvider::TimeZoneProvider (this=0x97957c
>> <tzp>,
>> > identifier=...)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.cpp:283
>> > #14 0x008d1823 in TimeZoneProvider::TimeZoneProvider (this=0x97957c
>> > <tzp>)    at c:/gcdev/gnucash.git/src/libqof/qof/gnc-timezone.hpp:51
>> > #15 0x008b088c in __static_initialization_and_destruction_0
>> > (__initialize_p=1, __priority=65535)    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:47
>> > #16 0x008b0a8c in _GLOBAL__sub_I__ZNK11GncDateImpl14year_month_dayEv ()
>> > at c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:317
>> >
>> > #17 0x008cc0ba in __do_global_ctors () from
>> > c:\gcdev\gnucash\inst\bin\libgnc-qof-1.dll
>> >
>> > BUT if I change to 'UTC-1 Azores' or ANY other 'UTC-' Gnucash would
>> start
>> > up but in GDB I was getting this error three times "warning: Invalid
>> > parameter passed to C runtime function."
>> > This is the back trace...
>> >
>> > #8  0x00ee3022 in
>> >
>> libstdc++-6!_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_RSt8ios_basecPK2tmPKcSB_
>> > () from c:\gcdev\gnucash\inst\bin\libstdc++-6.dll
>> >
>> > #9  0x008fe711 in boost::date_time::date_facet<boost::gregorian::date,
>> > char, std::ostreambuf_iterator<char, std::char_traits<char> >
>> >::do_put_tm
>> > (this=0x7e0e720, next=..., a_ios=..., fill_char=32 ' ', tm_value=...,
>> > a_format=...)    at
>> > c:/gcdev/boost/include/boost/date_time/date_facet.hpp:346
>> > #10 0x008ff0f0 in
>> >
>> boost::date_time::time_facet<boost::local_time::local_date_time_base<boost::posix_time::ptime,
>> > boost::date_time::time_zone_base<boost::posix_time::ptime, char> >,
>> char,
>> > std::ostreambuf_iterator<char, std::char_traits<char> > >::put
>> > (this=0x7e0e720, next_arg=..., ios_arg=..., fill_arg=32 ' ',
>> > time_arg=...)    at
>> > c:/gcdev/boost/include/boost/date_time/time_facet.hpp:428
>> > #11 0x008c5120 in boost::local_time::operator<< <char,
>> > std::char_traits<char> > (os=..., ldt=...)    at
>> > c:/gcdev/boost/include/boost/date_time/local_time/local_time_io.hpp:43
>> > #12 0x008a0285 in GncDateTimeImpl::format (this=0x7e0e8e8,
>> > format=0x91884b <boost::container::default_init+23> "%a %b %e %H:%M:%S
>> > %Y")    at c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:233
>> > #13 0x008a080d in GncDateTime::format (this=0x64f538,    format=0x91884b
>> > <boost::container::default_init+23> "%a %b %e %H:%M:%S %Y")    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-datetime.cpp:316
>> > #14 0x00893131 in gnc_print_time64 (time=1461891600,    format=0x91884b
>> > <boost::container::default_init+23> "%a %b %e %H:%M:%S %Y")    at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-date.cpp:346
>> > #15 0x00892e32 in gnc_ctime (secs=0x64f5b0) at
>> > c:/gcdev/gnucash.git/src/libqof/qof/gnc-date.cpp:234
>> >
>> > #16 0x635a7e2b in xaccTransSetDateInternal (trans=0x7dae520,
>> > dadate=0x7dae548, val=...)    at
>> > c:/gcdev/gnucash.git/src/engine/Transaction.c:1939
>> > #17 0x635a80cb in xaccTransSetDatePostedGDate (trans=0x7dae520,
>> > date=...)    at c:/gcdev/gnucash.git/src/engine/Transaction.c:1995
>> > #18 0x635a7ffa in xaccTransSetDatePostedSecsNormalized (trans=0x7dae520,
>> > time=1461891600)    at
>> c:/gcdev/gnucash.git/src/engine/Transaction.c:1979
>> >
>> > Will investigate further...
>>
>> Robert,
>>
>> The first failure would seem to be that windows_default_timezone isn't
>> getting a valid timezone, maybe because MS changed the registry key.
>>
>> Please show the first 8 frames of the second backtrace; you're not even
>> showing what C runtime function is getting the bad parameter.
>>
>> Regards,
>> John Ralls
>>
>>
>
_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to