Artifacts Associated With Ticket 3413857
Ticket change [8e4aa232d9] (rid 120092) by ferrieux on 2011-09-25 21:17:44:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Kindly reported and analyzed by Roman Puls on tcl-core. The cleanup of the returned-extra-args array involves the following sequence: ckfree(leftovers); leftovers[nrem] = NULL; This is just plain wrong, and has been so since the first implementation (TIP 265). The purpose of this ckfree (at this place, where nrem might be nonzero) is unclear to me. Assigning to the initial committer.
- foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "ferrieux"
- subsystem initialized to: "None"
- title initialized to: "Tcl_ParseArgsObjv segfaults"
- type initialized to: "Bug"
Ticket change [c27d742c51] (rid 111493) by ferrieux on 2011-09-26 04:44:01:
- icomment:
High prio as low-hanging fruit. BTW, why NULL-terminated the remObjPtr array ? No such contract appears in the manpage, and it is unneeded since the length is transmitted elsewhere.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [357e6a98af] (rid 106945) by ferrieux on 2011-09-26 04:44:02:
- priority changed to: "9 Immediate"
Add attachment "parseargs.patch" [51127b8601] (rid 126078) by ferrieux on 2011-09-26 04:59:28.
Ticket change [f32a2ea80a] (rid 129655) by ferrieux on 2011-09-26 04:59:28:
- icomment:
File Added - 424492: parseargs.patch
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [f7f7c1df30] (rid 91459) by ferrieux on 2011-09-26 04:59:47:
- icomment:
Please review attached patch.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [69125a359b] (rid 103181) by dkf on 2011-09-26 17:11:48:
- icomment:
Try what I've committed to the bug-3413857 branch; we could do with a test before merging back into trunk. (I think there was an off-by-one bug in the code; for example, if the only thing left was the command name, *objcPtr should only be set to 1, not to 2, as the trailing NULL is not counted.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [af6643834a] (rid 97805) by ropuls on 2011-09-26 17:43:21:
- icomment:
Could you assist? The patch fails for me, and I cannot find the branch in sf cvs: patch --dry-run --strip 1 < parseargs.patch patching file tclIndexObj.c Hunk #1 FAILED at 1111. Hunk #2 FAILED at 1180. Hunk #3 FAILED at 1293. Thanks, R.
- login: "ropuls"
- mimetype: "text/plain"
- username: "ropuls"
- icomment:
Ticket change [42e3031504] (rid 116449) by dkf on 2011-09-26 17:51:39:
- icomment:
It's in fossil on http://core.tcl.tk/ (All our development has been there for about 6 months or so.) Download link... http://core.tcl.tk/tcl/zip/Tcl%20Source%20Code-8edb5ef770d0de1f.zip?uuid=8edb5ef770d0de1f32ba001970f32a71554f1197
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [f4724614bb] (rid 129919) by ferrieux on 2011-09-26 23:04:10:
- icomment:
Roman, the patch I attached is against 8.6 trunk tip.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [b75b6cb12a] (rid 125575) by ferrieux on 2011-09-26 23:06:47:
- icomment:
To be clear: you can just as well download Donal's commit, which is equivalent AFAICT (right, Donal ?)
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [e8a12b0da4] (rid 104679) by dkf on 2011-09-27 04:06:24:
- icomment:
Not quite. I reviewed the patch and made some small adjustments (hence my comment below about an off-by-one error). What we need though is a test that detects the problems (possibly only during a memdebug/valgrind run, but even so) so that we can be _sure_ that this is fixed. I've no problem with that requiring more things in tclTest.c if necessary, of course...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [4f7619a90f] (rid 125831) by ferrieux on 2011-09-27 04:13:37:
- icomment:
Oops, right. Missed your comment in the flow, sorry.
- login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [9cb704a11e] (rid 96190) by ropuls on 2011-09-27 05:20:47:
- icomment:
Thanks for clarification. I have taken dkf's version and ported back to 8.6b1.1, which seems to work as expected. However, I kept the non-memcpy assignment at the end for the sake of readability (instead of performance).
- login: "ropuls"
- mimetype: "text/plain"
- username: "ropuls"
- icomment:
Ticket change [aa9dbde861] (rid 100955) by ropuls on 2011-09-27 05:35:00:
- icomment:
and a last one: does it make sense to downsize the leftovers / remObjv array? leftovers[nrem] = NULL; *objcPtr = nrem++; *remObjv = (Tcl_Obj **)ckrealloc((char *)leftovers, nrem * sizeof(Tcl_Obj *)); I'd probably pass it back as is: - ckrealloc might fail and is "relatively" expensive - memory saving is expected to be relatively low, maximum is : objc * sizeof(Tcl_Obj *), which would typically be some 40 bytes or so. ... but of course this is a serious question of style :) - login: "ropuls"
- mimetype: "text/plain"
- username: "ropuls"
- icomment:
Ticket change [114cce80ee] (rid 95114) by dkf on 2011-09-27 16:07:37:
- icomment:
Downsizing is probably not very important, and should be quick (the memory manager can just note the change in used size in its metadata block; it doesn't need to actually allocate). It does help with subsequent use of valgrind though. :-) The take-home message: as long as we have some tests, we're good to go.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [b78d34aad3] (rid 125620) by dkf on 2011-09-27 16:07:52:
- subsystem changed to: "13. Index Object"
Ticket change [5c351b8e1e] (rid 115259) by dkf on 2011-09-27 16:08:07:
- foundin changed to: "obsolete: 8.6b2"
Ticket change [6bf84832a0] (rid 128418) by dkf on 2011-09-27 16:52:03:
- closedate changed to: "2011-09-27T09:52:03"
- closer changed to: "dkf"
- icomment:
allow_comments - 1 Tests added. Everything merged back to trunk. (And TCL_ARGV_AUTO_REST macro now works! Found that during testing.) Download link for version with merge done: https://core.tcl.tk/tcl/zip/Tcl%20Source%20Code-06c0436f0421b3ee.zip?uuid=06c0436f0421b3ee5c7fac0bd919e7dde362d3a6
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"