Artifacts Associated With Ticket 1090869
Ticket change [f726d1393d] (rid 91326) by sanjeev_singh on 2004-12-24 15:43:52:
- assignee initialized to: "msofer"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hi, I am running on Opteron ie Amd 64 bit mc. While porting my 32 bit code I am running into this problem with reading 32 bit numbers that have bit 31 set. Basically the code below fails if the user passed 0x8000000 as the arguments. int tb_test(ClientData dummy, Tcl_Interp *interp, int argc, char **argv) { int code = TCL_OK; int value[2]; Tcl_GetInt(interp, argv[1], &value[0]); Tcl_GetInt(interp, argv[2], &value[1]); printf("VALUE0=0x%x\n", value[0]); printf("VALUE1=0x%x\n", value[1]); return code; } When run in tclsh this gives % myCmd 0x7fffffff 0x80000000 VALUE0=0x7fffffff VALUE1=0x0 integer value too large to represent % The problem seems to be in file tclGet.c in the following line- if ((errno == ERANGE) || (((long)(int) i) != i)) { It should be instead if ((errno == ERANGE) || (((long)(unsigned int) i) != i)) { -sanjeev - foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "sanjeev_singh"
- subsystem initialized to: "45. Parsing and Eval"
- title initialized to: "Tcl_GetInt Returns Illegal Overlfow On AMD64"
- type initialized to: "Bug"
Ticket change [7699895b9d] (rid 105616) by msofer on 2005-04-16 22:44:44:
- assignee changed to: "kennykb"
Ticket change [5c342a5c81] (rid 115258) by dgp on 2005-04-20 00:33:01:
- icomment:
Logged In: YES user_id=80530 That proposed patch fails 54 tests in the test suite.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c906dc9f14] (rid 122218) by dgp on 2005-04-20 00:36:30:
- icomment:
Logged In: YES user_id=80530 In particular, after that patch the value "-1" becomes "too large to represent"
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [aefe3d73fe] (rid 97734) by dgp on 2005-04-20 01:20:10:
- icomment:
Logged In: YES user_id=80530 Here's a different patch to try.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [75a90e2fca] (rid 105424) by dgp on 2005-04-20 01:20:12:
- icomment:
File Added - 130943: 1090869.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [cd60bd58b5] (rid 95880) by dgp on 2005-04-20 02:44:30:
- icomment:
Logged In: YES user_id=80530 New patch also fixes (and simplifies) Tcl_GetIntFromObj(). Please review and commit if acceptable.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9fa4317326] (rid 96672) by dgp on 2005-04-20 02:44:31:
- icomment:
File Deleted - 130943: File Added - 130958: 1090869.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [31270bd8a1] (rid 93375) by dgp on 2005-04-20 04:08:15:
- icomment:
Logged In: YES user_id=80530 ok, try this patch instead.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "1090869.patch" [e2ff146173] (rid 87717) by dgp on 2005-04-20 04:08:17.
Ticket change [59fccfea5c] (rid 118064) by dgp on 2005-04-20 04:08:19:
- icomment:
File Deleted - 130958: File Added - 130971: 1090869.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [f51bc939f7] (rid 130049) by dgp on 2005-04-20 23:05:17:
- assignee changed to: "dgp"
- closedate changed to: "2005-04-20T16:05:17"
- closer changed to: "dgp"
- icomment:
Logged In: YES user_id=80530 Fixed for 8.4.10 and 8.5a3
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- subsystem changed to: "11. Conversions from String"
- username: "dgp"