Artifacts Associated With Ticket 2845535
Ticket change [dfb26b4704] (rid 115054) by mistachkin on 2009-08-27 12:38:31:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The following command triggers a crash in 8.4, 8.5, and HEAD: format "%.2147483647f" 2 The following command triggers a crash in 8.5 and HEAD (in 8.4 it produces some kind of result): format "%2147483647.f" 2 The following code (near line 2187) in "generic\tclStringObj.c" is a bit problematic due to unchecked usage of sprintf with a fixed size buffer: char spec[2*TCL_INTEGER_SPACE + 9], *p = spec; <snip> if (width) { p += sprintf(p, "%d", width); if (width > length) { length = width; } } if (gotPrecision) { *p++ = '.'; p += sprintf(p, "%d", precision); length += precision; } - foundin initialized to: "obsolete: 8.6b1.1"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mistachkin"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "crash issue with [format]"
- type initialized to: "Bug"
Ticket change [0a0700d4e7] (rid 113744) by dkf on 2009-08-27 19:45:47:
- assignee changed to: "dgp"
- subsystem changed to: "10. Objects"
Ticket change [325e5d69b0] (rid 93603) by mistachkin on 2009-08-27 19:58:58:
- icomment:
Further analysis reveals that I am tired. The actual line (near 2235) which causes the problem is: Tcl_SetObjLength(segment, sprintf(bytes, spec, d));
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [81795d0871] (rid 117044) by dgp on 2009-08-27 21:05:40:
- icomment:
Any relation to 2838354 ?
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [efbd17b214] (rid 109051) by dgp on 2009-08-27 21:05:41:
- priority changed to: "9 Immediate"
Ticket change [ac0cdaece9] (rid 101226) by dgp on 2009-08-27 23:23:04:
- icomment:
on the 8.5 and HEAD branches I see a panic, not a crash: % format %.2147483647f 2 Tcl_SetObjLength: negative length requested: -2147483329 (integer overflow?) In 8.4, I see: % format %.2147483647f 2 %
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9c4ad130b3] (rid 96127) by dgp on 2009-08-27 23:23:05:
- title changed to: "string overflow panic in [format]"
Ticket change [f6b1070a59] (rid 130338) by dgp on 2009-08-27 23:30:50:
- icomment:
For the second example, on a system where I avoid a mem alloc panic, I also see a panic, not a crash: % format "%2147483647.f" 2 Tcl_SetObjLength: negative length requested: -1 (integer overflow?)
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [fbbc128828] (rid 92118) by dgp on 2009-08-28 01:34:29:
- icomment:
The Tcl code is not written with the possibility that sprintf() might raise an error, which according to the linux platform docs is done by returning a negative value.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "2845535.patch" [04c6492719] (rid 88930) by dgp on 2009-08-28 02:21:58.
Ticket change [5d4946999b] (rid 115438) by dgp on 2009-08-28 02:21:58:
- icomment:
File Added - 340830: 2845535.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3088fedff2] (rid 93273) by dgp on 2009-08-28 02:22:14:
- icomment:
patch attached
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [07aaffd86f] (rid 89446) by dgp on 2009-08-28 02:35:09:
- icomment:
patch committed to fix in 8.5.8+ consider either Works For Me or Wont Fix for 8.4.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [9fc0ac7aed] (rid 96695) by dgp on 2009-08-28 02:35:14:
- closedate changed to: "2009-08-27T19:35:14"
- closer changed to: "dgp"
- icomment:
allow_comments - 1
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dgp"