Artifacts Associated With Ticket 96e5c814
Ticket change [07cb8ca210] (rid 245690) by chrstphrchvz on 2025-09-20 18:27:44:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
UBSan `-fsanitize=signed-integer-overflow` errors as encountered during these tests: * clock-6.9: `generic/tclClockFmt.c:192:21: runtime error: signed integer overflow: -9223372036854775800 - 9 cannot be represented in type 'Tcl_WideInt' (aka 'long long')` * clock-6.10: `generic/tclClockFmt.c:182:21: runtime error: signed integer overflow: 9223372036854775800 + 8 cannot be represented in type 'Tcl_WideInt' (aka 'long long')` * clock-6.10a: `generic/tclClockFmt.c:182:16: runtime error: signed integer overflow: 2767011611056432742 * 10 cannot be represented in type 'Tcl_WideInt' (aka 'long long')` * clock-6.10a-: `generic/tclClockFmt.c:192:16: runtime error: signed integer overflow: -2767011611056432742 * 10 cannot be represented in type 'Tcl_WideInt' (aka 'long long')` But maybe this is won't-fix, given the usage of `# pragma GCC optimize("no-trapv")`. - foundin initialized to: "core-9-0-branch"
- 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: "16. Commands A-H"
- title initialized to: "Signed integer overflow in Clock_str2wideInt()"
- type initialized to: "Bug"
Ticket change [ddd78a2f06] (rid 250020) by sebres on 2025-12-29 20:39:15:
- icomment:
This is not directly won't-fix, but the overflow is indeed covered below by check whether original is smaller/larger (depending on sign) than result after operation. We can surely rewrite it more strict to pass the sanitizer.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [c15be4499a] (rid 250182) by cdubois on 2026-01-06 03:56:16:
- icomment:
I’d like to help make this UBSan-clean. Based on sebres’ note, it seems the current logic is fine but UBSan is flagging intermediate signed overflow. Do you have a preferred direction for addressing this — e.g., restructuring the arithmetic to avoid overflow in signed space (pre-checks / bounds checks), or another approach you consider idiomatic here? If you’re OK with it, I can draft a patch and validate it with UBSan, focusing on the reported tests (clock-6.9/6.10/6.10a).
- login: "cdubois"
- mimetype: "text/plain"
- icomment:
Ticket change [5a0a3fdafa] (rid 250184) by apnadkarni on 2026-01-06 06:09:42:
- icomment:
I too would prefer these to be fixed even if benign just to avoid clutter and missing real warnings.
- login: "apnadkarni"
- mimetype: "text/plain"
- icomment:
Ticket change [1c67613203] (rid 250657) by sebres on 2026-01-18 02:00:11:
- closedate changed to: "2461058.58347086"
- closer changed to: "sebres"
- foundin changed to: "8.7+"
- icomment:
Shall be fixed in all branches (based on new clock-engine), starting from [f954da0082db5ac1], thus close now.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"