Artifacts Associated With Ticket abd489a1c
Ticket change [ddd2f1ed33] (rid 219364) by chrstphrchvz on 2023-10-13 07:20:01:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Example UBSan <tt>-fsanitize=function</tt> error: <pre> % string compare a b <span style="font-weight:bold">tcl/generic/tclCmdMZ.c:2863:10: <span style="color:firebrick">runtime error:</span> call to function TclpUtfNcmp2 through pointer to incorrect function type 'int (*)(const void *, const void *, unsigned long)' tclUtf.c:1233: <span style="color:gray">note:</span></span> TclpUtfNcmp2 defined here SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior tcl/generic/tclCmdMZ.c:2863:10 in -1 </pre> Some of the compare functions are public APIs, so I would suggest either using an enum to call functions directly, or wrapper functions (as done by the attached patch).
- foundin initialized to: "8.6.13"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- private_contact initialized to: "6133eb3026f9b10aa9b7b48da92ae2834fc225b0"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to:
TclStringCmp() calls functions through pointer to incorrect type
- type initialized to: "Patch"
Add attachment "abd489a1cf47.diff" [71b201fb6a] (rid 219366) by chrstphrchvz on 2023-10-13 07:22:56.
Add attachment "abd489a1cf47.diff" [c077eb7cc3] (rid 219368) by chrstphrchvz on 2023-10-13 07:24:30.
Ticket change [70a87b05c5] (rid 219389) by jan.nijtmans on 2023-10-13 14:09:39:
- assignee changed to: "jan.nijtmans"
- icomment:
Thanks for the patch! Looks good. In this case, it's slightly better to do the wrapping slightly different: [6d9d5ac6a75d7832].
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [db46df55c3] (rid 221090) by jan.nijtmans on 2023-12-30 00:20:14:
- closedate changed to: "2460308.51405524"
- closer changed to: "jan.nijtmans"
- icomment: "This should be fixed in all branches now"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"