Artifacts Associated With Ticket 218705
Ticket change [8beb6044b5] (rid 127663) by nobody on 2000-10-26 01:04:23:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 1806 Bug Version: 8.1b3 SubmitDate: '1999-04-14' LastModified: '2000-01-12' Severity: SER Status: Released Submitter: pat ChangedBy: hobbs OS: Other OSVersion: ReliantUNIX-N 5.44C10 Machine: NA FixedDate: '2000-01-12' FixedInVersion: 8.3b2 ClosedDate: '2000-10-25' Name: Andrej Borsenkow CustomShell: I added block to configure.in to recognise ReliantUNIX for dynamic loading. The CFLAGS were set to enable 64 bit compile mode. ReproducibleScript: I've done a test drive for compiling Tcl 8.1b3 on ReliantUNIX (formerly SINIX) in 64 bit mode on MIPS R4400. The clock tests partially failed. At least in some cases the reason was wrong handling of time_t variables. On our system in 64 bit mode sizeof(long) == 8, but sizeof(time_t) == 4 (signed 32 bit value). The problem is, that FormatClock() gets unsigned long clockVal, than passes it by *reference* to TclpGetDate(), that converts pointers to clockVal to pointer to time_t. But in this case, only the first 4 bytes of clockVal are used; as ReliantUNIX is running in MSB mode, they are almost always zero. There is one more hidden bug here - the value of unsigned long can overflow time_t. It is hard to tell what to do - probably, Tcl should check for the largest possible value of time_t and return with an error if passed clockVal is too large. ObservedBehavior: clock command fails in most cases. Most of clock tests fail. Time/date manipulation is nearly impossible 4/15/99 - redman - OK, why is time_t an int on ReliantUNIX? This should probably be fixed anyway. -- From Clevenger (for tclClock.c): /* * Pointer must point to a variable of type time_t for proper endian * behavior. Cannot just caste address of clockVal. */ tclockVal = (time_t) clockVal; timeDataPtr = TclpGetDate((time_t *) &tclockVal, useGMT); The noted problem, along with one similar occurrence in tclGetDate.y was fixed for 8.3b2. As for the potential overflow problem, one solution would be to check if sizeof(long) > sizeof(time_t), and use Tcl_GetIntFromObj if so. However, Tcl is only defined to work without standard POSIX parameters, which makes the overflow stuff undefined anyway. -- 01/12/2000 hobbs - foundin initialized to: "obsolete: 8.1b3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "48. Number Handling"
- title initialized to: "Bug in time_t handling on 64 bit Reliant UNIX"
- type initialized to: "Bug"
Ticket change [e74d85934d] (rid 104433) by welch on 2000-10-26 08:27:12:
- closedate changed to: "2000-10-26T01:27:12"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [a208aaa785] (rid 109826) by dgp on 2001-04-05 06:56:33:
- closedate changed to: "2001-04-04T23:56:33"
- closer changed to: "dgp"
- subsystem changed to: "06. Time Measurement"