<i>Tcl_InitStubs() Broken As Designed</i> status still Open with 4 other changes
by
.
D 2012-12-07T03:27:40
J icomment Let's\sdo\san\sexperiment,\sto\sshow\swhat\sI\swant\sto\stell.\n\nPlease\scheck\sout\sthe\sbranche\s"novem-support".\sIt\sis\sa\nmodified\s8.6,\smainly\spkgb.so\sis\smodified\sto\suse\n\s\s\s\sTcl_PkgRequireEx(...,\s"8.6-".\s...),\sand\suses\sthe\nTcl_EvalEx()\sfunction.\sClearly\sthis\sis\swrong:\sIt\swould\nallow\spkgb.so\sto\sbe\sloaded\sby\sboth\sTcl\s8.6\sand\sTcl\s9.0,\nbut\sTcl_EvalEx\swill\shave\sa\sdifferent\ssignature,\sso\sthat\swill\nlead\sto\sa\scrash.\sI'll\sshow\sthat.\n\nThen\sthere\sis\sthe\sbranch\s"novem-demo-bug-3588687",\nwhich\sis\sa\smodified\s"novem"\swith\sa\sTcl_EvalEx\ssignature\nchange:\sthe\snumBytes\sparameter\sis\schanged\sto\sa\nTcl_WideInt\s(will\sbe\ssize_t\sin\sTcl9,\sbut\sthis\sway\sI\scan\ndemonstrate\sthe\scrash\son\s32-bit\splatforms\sas\swell)\n\nLet's\srun\sthis\stclsh9.0\sand\sload\sthe\spkgb.so\sfrom\nthe\s"novem-support"\s8.6\sbuild:\n\n$\stclsh9.0\n%\sload\s../../tcl8.6/unix/dltest/pkgb.so\n%\sinfo\scommands\spkgb_*\npkgb_unsafe\spkgb_sub\n%\spkgb_unsafe\nCrash!\nAborted\s(core\sdumped)\n$\s\n\nThis\spkgb.so\swas\scompiled\sand\slinked\sagainst\nthe\sunmodified\sTcl\s8.6\stcl.h\sand\slibtclstub86.a.\nHow\scome\sthat\sthis\swas\snot\sdetected?\sWhatever\ntest\sin\stclStubLib.c\scannot\sdetect\sthat:\spkgb.so\nwas\scompiled\swith\sa\slegacy\sstub\slibrary.\n\nSo,\sthe\sonly\sway\sI\ssee\sto\smake\sTcl_StubInit\sgive\na\snice\serror\smessage\sis\schange\sthe\sTCL_STUB_MAGIC\nmagic\svalue\sfor\s64-bit\sbuilds\sin\sTcl9.\sThen,\seven\nthough\spkgb.so\swas\slinked\swith\sa\slegacy\sstub\nlibrary\sit\swould\sdetect\sthat\sand\sgive:\n\s\s\s"interpreter\suses\san\sincompatible\sstubs\smechanism"\nin\sstead\sof\scrashing.\n\nIf\syou\shave\sanother\sidea\show\sto\sprevent\sa\scrash\nin\sthis\scase,\sI'm\sall\sear.\sThat's\swhy\smy\sconclusion\nis\sthat\sTCL_STUB_MAGIC\sshould\schange\son\n64-bit\splatforms,\sit\scan\sstay\sthe\ssame\son\s32-bit\nplatforms.\sDo\syou\sget\sthe\spoint\sfrom\sthis?\n\nRegards,\n\s\s\s\s\s\s\s\s\s\sJan\sNijtmans\n
J login nijtmans
J mimetype text/plain
J username nijtmans
K 3588687fffffffffffffffffffffffffffffffff
U nijtmans
Z 9ebeff0c65d144a7a25a9d51bfabc89d