From: SourceForge.net <no...@so...> - 2012-04-11 20:48:03
|
Bugs item #3448512, was opened at 2011-12-02 10:19 Message generated for change (Comment added) made by nijtmans You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3448512&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 06. Time Measurement Group: current: 8.5.11 >Status: Pending >Resolution: Fixed Priority: 5 Private: No Submitted By: Thomas Perschak (tombert) Assigned to: Jan Nijtmans (nijtmans) Summary: clock scan "1958-01-01" fails only in debug compilation Initial Comment: The command: clock scan "1958-01-01" fails with the error: time value too large/small to represent but only in my debug compilation. The release compilation returns a valid result. Environment: WinXP, Tcl 8.5.11, MinGW thx ---------------------------------------------------------------------- >Comment By: Jan Nijtmans (nijtmans) Date: 2012-04-11 13:48 Message: Should be fixed now in core-8-4-branch, core-8-5-branch and trunk. Thomas, can you please test? ---------------------------------------------------------------------- Comment By: Thomas Perschak (tombert) Date: 2012-04-11 02:53 Message: Yes of course I read, but I overreacted by Jans statement "nothing we can do about that" ... ---------------------------------------------------------------------- Comment By: Serg G. Brester (sebres) Date: 2012-04-11 02:26 Message: Thomas, did you read our comments before you post your question? Presumption is the system time zone is not set (possible because package registry is not loaded). Because of bug with ::tcl_platform(debug) - to temporary bypass this in debug mode change your lib\tcl8.5\reg\pkgIndex.tcl to load correct tclreg.dll. ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2012-04-11 02:20 Message: > So I thought that this is intended behaviour - but why is it available in >the release but not in the debug code? Because of the bug mentioned below. The real problem here was that the timezone could not be determined because the registry package couldn't be loaded. That is something we can correct (and I will do that). The fallback uses mktime, which only works >=1970, nothing we can do about that. ---------------------------------------------------------------------- Comment By: Thomas Perschak (tombert) Date: 2012-04-11 02:11 Message: The release compilation returns -378694800 with no error and this number is exactly 12 Years i.e. 1970-1958. So I thought that this is intended behaviour - but why is it available in the release but not in the debug code? thx ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2012-04-11 01:14 Message: See also: <http://msdn.microsoft.com/en-us/library/d1y53h2a%28v=vs.80%29.aspx> So, the reason why ConvertLocalToUTCUsingC returns an error is simply that the function mktime is documented to handle only dates after midnight, January 1, 1970, nothing we can do about that. ---------------------------------------------------------------------- Comment By: Jan Nijtmans (nijtmans) Date: 2012-04-11 00:57 Message: sebres, good questions! Tried to reproduced this, and indeed I could. So - yes - there is a real bug here. First analysis pointed to line 535 of tclWinInit.c: #ifdef _DEBUG This should have been #ifdef TCL_CFG_DEBUG (The _DEBUG is probably microsoft-specific) Further on, in library/reg/pkgIndex.tcl: if {[info exists ::tcl_platform(debug)]} { The tcl8.5+ way of doing this is: if {[::tcl::pkgconfig get debug]} { (dde has the same problem) Then - third - there is no reason why ConvertLocalToUTCUsingC returns this error, in spite of the timezone not being found. Now investigating that. ---------------------------------------------------------------------- Comment By: Serg G. Brester (sebres) Date: 2012-04-10 23:44 Message: check your debug constellation: - which value returns ::tcl::clock::GetSystemTimeZone? - could you load package "registry"? ---------------------------------------------------------------------- Comment By: Thomas Perschak (tombert) Date: 2012-04-10 12:56 Message: Still valid in latest head tcl 8.5.11, but only in the debug compilation. Tested in XP and W7. ---------------------------------------------------------------------- Comment By: Thomas Perschak (tombert) Date: 2011-12-02 12:15 Message: In linux my debug compilation returns -378694800 seems to fail only in windows ---------------------------------------------------------------------- Comment By: Alexandre Ferrieux (ferrieux) Date: 2011-12-02 10:45 Message: FWIW, I can't seem to repro on Linux, tip of core-8-5-branch. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3448512&group_id=10894 |