2023-09-12
| ||
12:40 | • Closed ticket [b3628609ad]: concatenating strings is broken when the "bytes" field of a Tcl_Obj contains invalid data and the type is not tclStringType plus 6 other changes artifact: 695c5061ed user: jan.nijtmans | |
2023-05-02
| ||
19:58 | Fix issue [b3628609ad73a105], by allowing TclStringCat to assume that each Tcl_Obj.bytes value is co... check-in: 29108f928e user: pooryorick tags: unchained | |
15:26 | • Pending ticket [b3628609ad]: concatenating strings is broken when the "bytes" field of a Tcl_Obj contains invalid data and the type is not tclStringType plus 3 other changes artifact: 668a3b4a34 user: pooryorick | |
15:25 | • Ticket [b3628609ad]: 3 changes artifact: 5385a97373 user: pooryorick | |
12:47 | Fix issue [b3628609ad73a105], by allowing TclStringCat to assume that each Tcl_Obj.bytes value is co... Closed-Leaf check-in: 2ddc0c3fa9 user: pooryorick tags: pyk-b3628609ad | |
2023-04-23
| ||
22:37 | • Ticket [b3628609ad] concatenating strings is broken when the "bytes" field of a Tcl_Obj contains invalid data and the type is not tclStringType status still Open with 3 other changes artifact: d001c93fed user: pooryorick | |
18:50 | • Ticket [b3628609ad]: 3 changes artifact: 27438671e6 user: pooryorick | |
2023-04-22
| ||
16:17 | • Ticket [b3628609ad]: 3 changes artifact: 32bf1dc73f user: jan.nijtmans | |
05:35 | • Open ticket [b3628609ad]. artifact: eed28b98f0 user: apnadkarni | |
2023-04-21
| ||
22:14 | • Pending ticket [b3628609ad]. artifact: b22b9b706c user: pooryorick | |
22:10 | Fix issue [b3628609ad73a105] by scrapping most of TclStringCat() in favor of Tcl_AppendObjToObj(). ... check-in: b699959d62 user: pooryorick tags: pyk-b3628609ad | |
21:25 | • New ticket [b3628609ad] concatening strings is broken when the "bytes" field of a Tcl_Obj contains invalid data and the type is not tclStringType. artifact: 3ab3ed9a7e user: pooryorick | |
Ticket UUID: | b3628609ad73a105f0e51435e0e0ac5b8205fad7 | |||
Title: | concatenating strings is broken when the "bytes" field of a Tcl_Obj contains invalid data and the type is not tclStringType | |||
Type: | Bug | Version: | ||
Submitter: | pooryorick | Created on: | 2023-04-21 21:25:11 | |
Subsystem: | - New Builtin Commands | Assigned To: | pooryorick | |
Priority: | 5 Medium | Severity: | Important | |
Status: | Closed | Last Modified: | 2023-09-12 12:40:23 | |
Resolution: | Invalid | Closed By: | jan.nijtmans | |
Closed on: | 2023-09-12 12:40:23 | |||
Description: |
When the following script is evaluated by trunk build of tcltest,
For For If the body of | |||
User Comments: |
jan.nijtmans added on 2023-09-12 12:40:23:
> Fixed in [b699959d62]. I looked into trying to make the .... > Fixed in [2ddc0c3fa9] by allowing TclStringCat() to assume that all Tcl_Obj.bytes values can be safely catenated as-is. Since TclStringCat() concatenates Unicode code-points - not bytes - this is a nun-bug. Your latest 'fix' was merged to the 'unchained' branch. Please keep it there and all is well. pooryorick added on 2023-05-02 15:25:23:
I agree that Tcl should be able to retain efficient functions such as
In 2021 the commits [fd66e6e20e] and [a7df881994] modified
As I stated a couple of years ago in [7f1162a867], any third party that stores
improperly-encoded data in Either third parties pay a relatively small penalty of properly-encoding values at the boundary of Tcl, or Tcl pays a relatively large penalty throughout its internal routines, and at a cost of greater code complexity. Fixed in [2ddc0c3fa9] by allowing jan.nijtmans added on 2023-04-22 16:17:22: I share Ashok's concern. In addition, the build with TCL_UTF+MAX=3 was broken by this 'fix'. Therefore I moved it away from trunk. apnadkarni added on 2023-04-22 05:35:07: I have concerns with this fix. I suspect After your fix:
Here's the same with the commit prior to your fix.
That difference is not to be dismissed. Moreover, it does not even take into account that Unicode strings will be shimmered, possibly impacting performance of further calls. Correctness obviously trumps performance. However, here it seems it would be worthwhile to fix TclStringCat rather than throw it all away. It is also not entirely clear to me what it means that Tcl is not consistent on invalid input data and whether that needs correcting. pooryorick added on 2023-04-21 22:14:47: Fixed in [b699959d62]. I looked into trying to make the existing code for TclStringCat work, but it eventually became clear that it would have to mostly become a clone of Tcl_AppendObjToObj() in order to work correctly. There are a couple added benefits to this fix: First, it reduces the number of code paths that perform concatenation. Second, all callers of Tcl_AppendObjToObj will benefit from the reduction in generation of string representations. |