Skip to content
Tcl Source Code Artifact [473fc1ecbe]
Login

Artifact [473fc1ecbe]

Artifact 473fc1ecbe07da9b76da8ce503340dd1d2e558401e13e5c578ef160f5747edd5:

Ticket change [473fc1ecbe] - Ticket [8ab8a138c9156e5a|8ab8a138c9] <i>Do not pass incompatible function pointers to Tcl_EventuallyFree()</i> status still Open with 3 other changes by chrstphrchvz on 2023-10-07 13:13:17.
D 2023-10-07T13:13:17.581
J comment LLVM\sClang\s17\smakes\s<tt>-fsanitize=function</tt>\savailable\sfor\sC\s(previously\sit\swas\sjust\sfor\sC++).\sIt\sis\simplied\sby\s<tt>-fsanitize=undefined</tt>.\sIt\scomplains\sabout\scalls\sto\s<tt>freeProc(clientData)</tt>\sfrom\s<tt>Tcl_EventuallyFree()</tt>\sand\s<tt>Tcl_Release()</tt>.\sUnlike\swarnings\sfrom\se.g.\s<tt>-Wincompatible-function-pointer-types</tt>,\sthis\sUBSan\serror\sis\snot\ssuppressed\sby\scasts\sto\s<tt>(Tcl_FreeProc\s*)</tt>.\sExample\swhen\sexiting\stclsh:\r\n<pre>\r\n<span\sstyle="font-weight:bold">tcl/generic/tclPreserve.c:229:3:\s<span\sstyle="color:firebrick">runtime\serror:</span>\scall\sto\sfunction\sDeleteInterpProc\sthrough\spointer\sto\sincorrect\sfunction\stype\s'void\s(*)(char\s*)'\r\ntclBasic.c:1422:\s<span\sstyle="color:gray">note:</span></span>\sDeleteInterpProc\sdefined\shere\r\nSUMMARY:\sUndefinedBehaviorSanitizer:\sundefined-behavior\stcl/generic/tclPreserve.c:229:3\sin\s\r\n</pre>\r\nThere\sare\sonly\sa\sfew\sinstances\sof\sthis\sin\score\sTcl;\sto\spatch\sthese,\sI\sremove\scasts\sto\s<tt>(Tcl_FreeProc\s*)</tt>,\sthen\suse\sthe\s<tt>Tcl_FreeProc</tt>\stypedef\sfor\sfunction\sdeclarations,\sand\sthen\sfix\sfunction\sdefinitions.\sThere\sare\sseveral\smore\sinstances\sin\score\sTk\swhich\sI\sam\slooking\sinto\spatching.\sAny\sextensions\spassing\sincompatible\sfunction\spointers\sto\s<tt>Tcl_EventuallyFree()</tt>\swill\salso\strigger\sthis\sUBSan\serror.
J login chrstphrchvz
J mimetype text/plain
K 8ab8a138c9156e5a5a4a386310c6fd11608b8805
U chrstphrchvz
Z 5b51502f471a7ea25c0477f3c384d849