Artifacts Associated With Ticket 443938ffffffffffffffffffffffffffffffffff
Ticket change [a31a6b7b9e] (rid 110002) by nobody on 2001-07-23 22:34:35:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The malloc/ckalloc routines such as tcl_Allooc are defined with the size variable explicitly set to "unsigned int". They should be set to "size_t" (typdef in stdlib.h). When built on a 64 bit platform such as DEC TRU-64 or Solaris 8 (64 bit mode), this definition causes the programs to build improperly. There were also usages of strncmp and sizeof that were coded as if they were expected to return "unsigne int" instead of "size_t" (unsigned long). Compiled with gcc 3.0 as well as Solaris 8 Workshop 6.0 cc and DEC V5.1 cc
- foundin initialized to: "obsolete: 8.3.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "07. Variables"
- title initialized to: "malloc routines use wrong cast"
- type initialized to: "Bug"
Ticket change [497c4b71bd] (rid 100060) by dgp on 2001-07-25 05:47:44:
- subsystem changed to: "41. Memory Allocation"
Ticket change [f81a0efa78] (rid 91482) by hobbs on 2001-08-07 06:40:26:
- closedate changed to: "2001-08-06T23:40:26"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 Unfortunately you can't change those procedures because changing size decls would cause binary incompatability in the stubs mechanism. That they are declared as uints might not be optimal, but it is perfectly OK.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [0fc6b79ab9] (rid 94849) by sabbahillel on 2001-08-07 20:32:32:
- icomment:
Logged In: YES user_id=286923 The point is that when compiled in 64 bit mode, uint is actually fatal. In order to prevent errors, these "unsigned int" declarations must be changed to "unsigned long". When compiled in 32 bit mode, uint an ulong are the same. However, when compiled in DEC TRU64, or on Solaris 7 or 8 (gcc -m64), there is abinary incompatibility and it is a fatal compilation error not to use unsigned long. -- Said the fox to the fish, "Join me ashore". The fish are the Jews, Torah is our water. Hillel (Sabba) Markowitz [email protected], [email protected]
- login: "sabbahillel"
- mimetype: "text/plain"
- username: "sabbahillel"
- icomment:
Ticket change [94ce9327f0] (rid 106060) by hobbs on 2001-08-08 00:15:48:
- assignee changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 I'm still inclined to call this invalid, because I have compiled Tcl countless times on Solaris64 in 64-bit mode without fatal compilation errors (and it works), as well as Tru64. I'll look into it though (and make sure gcc isn't blowing smoke where the native compilers are OK).
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "hobbs"
Ticket change [18d2bfd015] (rid 122728) by sabbahillel on 2001-08-08 03:17:12:
- icomment:
Logged In: YES user_id=286923 The main problem seems to be that the size_t variables are declared as "(unsigned)" which defaults to "unsigned int". gcc points out that the parameters are a different width when long and int are different (in 64 bit mode). Even if it happens to work out, it should still be cased explicitly as (unsigned long) just to be certain. When compiled in 32 bit mode, it won't make a difference (since long = int) but it will make certain that 64 bit does not go bad. Even if it were not fatal, it would be better to do it correctly as the actual data passed through gets corrupted.
- login: "sabbahillel"
- mimetype: "text/plain"
- username: "sabbahillel"
- icomment:
Ticket change [80cec71a6d] (rid 116936) by davygrvy on 2001-11-13 14:48:29:
- icomment:
Logged In: YES user_id=7549 I agree with sabbahillel. If we let the native size of "The maximum number of bytes to which a pointer can refer" that size_t is (at least in ISO C), and express it to the outside, porting to 64 shouldn't be this hard as it is. Jeff, you refer to binary compatibility, but what is int??? Would that be the same as long, or __int32? Same problem for WIN64, too.
- login: "davygrvy"
- mimetype: "text/plain"
- username: "davygrvy"
- icomment:
Ticket change [c0a1f72a1b] (rid 102442) by hobbs on 2001-11-14 00:55:10:
- icomment:
Logged In: YES user_id=72656 int is 4 bytes on most systems, whereas size_t is 8. This will break binary compatability with all stubs-based extensions. IOW, no can do in 8.x.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "4"
- username: "hobbs"
- icomment:
Ticket change [005e8e4927] (rid 119310) by sabbahillel on 2001-11-14 04:52:55:
- icomment:
Logged In: YES user_id=286923 Then at the very least the "(unsigned) ckalloc" references should be changed to "(unsigned long) ckalloc" I went through the code by hand and the changes do appear to work correctly. [email protected] or [email protected]
- login: "sabbahillel"
- mimetype: "text/plain"
- username: "sabbahillel"
- icomment:
Ticket change [bc5db33c18] (rid 101736) by dkf on 2001-11-14 16:35:16:
- icomment:
Logged In: YES user_id=79902 It is possible to upgrade the stub table so that new compilations use the new-type API but existing extensions use the old-type API (this is one of the things that Stubs gives us that no ordinary link mechanism can) but it is quite a bit of work.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [d559f867e5] (rid 123608) by hobbs on 2002-02-26 05:11:55:
- assignee changed to: "dkf"
- icomment:
Logged In: YES user_id=72656 It has to be noted that ckalloc != malloc, so sticking with unsigned int is OK. You can't just always cast to long and think you are going to be able to alloc > 4GB of data on LP64 machines. This looks like something that may fall into the TIP 72 64-bit updates.
- login: "hobbs"
- mimetype: "text/plain"
- username: "hobbs"
Ticket change [d35289bb8e] (rid 123274) by dkf on 2002-02-26 22:58:37:
- icomment:
Logged In: YES user_id=79902 Not really; TIP#72 only really covers changes to get 64bits on 32bit machines. I'll have a look at fixing up *alloc sometime though.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [360e8e5995] (rid 107054) by dkf on 2002-04-25 19:18:37:
- icomment:
Logged In: YES user_id=79902 See also Bug #219196
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [f8479d0274] (rid 91513) by dkf on 2002-11-15 23:23:19:
- closedate changed to: "2002-11-15T16:23:19"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Addressed as part of TIP #115 - closing this bug because the fix will be driven from a different direction.
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Later"
- status changed to: "Closed"
- username: "dkf"