Artifacts Associated With Ticket 427196ffffffffff
Ticket change [305daba531] (rid 93241) by dgp on 2001-05-25 06:32:50:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The demo script reads part of a file, then changes the buffer size, then tries to read the rest of the file. Then, either a segfault or a POSIX error. To diagnose the memory problem, evaluate the demo script in a tclsh built with TCL_MEM_DEBUG: $ ./tclsh buffer.tcl hi guard byte 0 is 0x65 e hi guard byte 2 is 0x64 d hi guard byte 3 is 0x20 hi guard byte 4 is 0x24 $ hi guard byte 5 is 0x63 c total mallocs 1402 total frees 791 current packets allocated 611 current bytes allocated 49654 maximum packets allocated 759 maximum bytes allocated 87378 high guard failed at 80d9008, ./../generic/tclIO.c 4913 58 bytes allocated at (./../generic/tclIO.c 1659) Memory validation failure Aborted (core dumped) Apparently this problem first appeared in Tcl 8.1.
- foundin initialized to: "obsolete: 8.4a3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "25. Channel System"
- title initialized to: "fconfigure -buffer in midread =>segfault"
- type initialized to: "Bug"
Add attachment "buffer.tcl" [e3e53e6387] (rid 87873) by dgp on 2001-05-25 13:32:50.
Ticket change [59f87546a6] (rid 118059) by dgp on 2001-05-25 13:32:50:
- icomment:
File Added - 6648: buffer.tcl
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [29ee7f1342] (rid 118470) by andreas_kupries on 2001-07-18 00:10:07:
- assignee changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 The reason for the crash is a combination of two things: First, the buffer allocated when -buffersize 10 was set is reused in the second read. And second, the IO system blithely uses the set buffersize as the number of bytes to read and not the actual size of the buffer in use. This causes the overwrite beyond the end of the buffer and the subsequent crash when closing the channel. The relevant location is tclIO.c, line 5004 in "GetInput". A patch will follow shortly.
- login: "andreas_kupries"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "andreas_kupries"
Add attachment "tcl.427196.0.diff.txt" [f9f99ef42a] (rid 91788) by andreas_kupries on 2001-07-18 00:47:54.
Ticket change [d20ce36b4e] (rid 113460) by andreas_kupries on 2001-07-18 00:47:54:
- icomment:
File Added - 8523: tcl.427196.0.diff.txt
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [32610a53e1] (rid 93604) by andreas_kupries on 2001-07-18 00:54:25:
- closedate changed to: "2001-07-17T17:54:25"
- closer changed to: "andreas_kupries"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [5ecddd80de] (rid 115692) by andreas_kupries on 2001-07-18 01:45:01:
- closedate changed to: "2001-07-17T18:45:01"
- closer changed to: "andreas_kupries"
Add attachment "tcl.427196.1.diff.txt" [4d6437dda8] (rid 127043) by andreas_kupries on 2001-07-18 01:45:02.
Ticket change [6b2dbefba8] (rid 128274) by andreas_kupries on 2001-07-18 01:45:02:
- icomment:
File Added - 8526: tcl.427196.1.diff.txt
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "tcl.427196.2.diff.txt" [cc0c1d59e9] (rid 95622) by andreas_kupries on 2001-07-18 04:11:23.
Ticket change [c285c563e2] (rid 111500) by andreas_kupries on 2001-07-18 04:11:23:
- closedate changed to: "2001-07-17T21:11:23"
- closer changed to: "andreas_kupries"
- icomment:
File Added - 8533: tcl.427196.2.diff.txt Logged In: YES user_id=75003 Upload of patch which squashes the performance problem for dynamically changing buffersizes, by squashing buffers which are to small.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
Ticket change [6a3f158667] (rid 128115) by andreas_kupries on 2001-07-19 00:29:34:
- closedate changed to: "2001-07-18T17:29:34"
- closer changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 Performance patch committed to main and core-8-3-1-branch. This item is now completely closed.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"