Artifacts Associated With Ticket 9899c2
Ticket change [c3c6cedc50] (rid 196227) by dgp on 2021-10-28 15:20:04:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This can lead to an invalid ckrealloc call: Tcl_InitStringRep(objPtr, NULL, 0); Tcl_InitStringRep(objPtr, NULL, 0); Also, there's nothing in place to detect when a truncation call does not actually truncate, and to deal with possible memory allocation failure in that circumstance.
- foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "Tcl_InitStringRep design issues"
- type initialized to: "Bug"
Ticket change [1a875e99ba] (rid 196499) by dgp on 2021-11-08 00:13:58:
- assignee changed to: "dgp"
- closedate changed to: "2459526.50970539"
- closer changed to: "dgp"
- icomment:
Fix committed.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [3a679273e4] (rid 239684) by jan.nijtmans on 2025-05-02 09:53:40:
- closer changed to: "nobody"
- icomment:
It looks like this 'redesign' is only partially done. Yes, Tcl_InitStringRep can now handle allocation failures by returning NULL, but many callers of this function don't check for the NULL value. In other words: Tcl_InitStringRep() behaves like Tcl_AttemptInitStringRep(). This is OK, but callers should translate this NULL to either a panic or a proper error-handling. I'll have a look.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Open"
Ticket change [032363e771] (rid 239691) by jan.nijtmans on 2025-05-02 10:37:19:
- icomment:
Proposed further fix [e9231a4d4b0e4f19|here] Needs a TIP
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [577c42bc63] (rid 239692) by oehhar on 2025-05-02 10:49:01:
- icomment:
I think, the new "Attempt" series is a good idea. It is backward compatible and cleans-up a big drawback, that a library may not act on a memory issue. In the idea of a library, a panic should never happen, but always, an error should be reported... I can understand that cleaning this up in TCL and friends is a big task, as the error path is just often not there. It is a bit like "encoding now throws an error". New error path - many hidden issues. Thanks for going this way, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [b66748ef88] (rid 239695) by oehhar on 2025-05-02 11:59:07:
- icomment:
See ticket [78f44214]. This command is undocumented in the docs. But the introducing TIP documented the NULL return on memory error. It might be ok to do so and not to add an Attempt version of it. Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [f54d95232f] (rid 239696) by jan.nijtmans on 2025-05-02 12:09:47:
- icomment:
> It might be ok to do so and not to add an Attempt version of it Yeah, better fix the callers then. Thanks! Jan Nijtmans - login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [abf812b74a] (rid 239771) by jan.nijtmans on 2025-05-05 06:55:21:
- closedate changed to: "2460800.78843958"
- closer changed to: "jan.nijtmans"
- icomment:
I think [8d88d3e10ed4a91b|this] fixes all callers. Closing
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"