Skip to content
Tcl Source Code Artifact [b48d59721d]
Login

Artifact [b48d59721d]

Artifact b48d59721d08e894ee503d9607d4b3c6650aa74f02d1de93c21fc67bad1c8424:

Manifest of check-in [b48d59721d] - This patch fixes the failing case reported, but is really a work around of a considerably deeper bug. When GetEndOffsetFromObj() needs to do index arithmetic calculations with bignum arguments, rather than code all of that directly, it tries to call on the routine we already have for that, Tcl_ExprObj(). Problem is that apparently a call to Tcl_ExprObj() in certain scenarios leads to nested (?) calls of TclNRExecuteByteCode() and somehow this mangles the expectations of the TclStack(Alloc|Free) routines in their abuse of the execution stack space. It's very complicated and I haven't figured it out yet. We can accept this patch as a fix for the reported bug. But if so, we should open a new bug that Tcl_ExprObj() has undocumented conditions on when it can be safely called. That's bad for a public routine. by dgp on 2020-09-01 22:26:32.
B 539d9dcf7e9ee0deb2a35b6c53b69f1019aabce9d006f3e0d04e2a91ddd9bccb
C This\spatch\sfixes\sthe\sfailing\scase\sreported,\sbut\sis\sreally\sa\swork\saround\sof\na\sconsiderably\sdeeper\sbug.\n\nWhen\sGetEndOffsetFromObj()\sneeds\sto\sdo\sindex\sarithmetic\scalculations\swith\nbignum\sarguments,\srather\sthan\scode\sall\sof\sthat\sdirectly,\sit\stries\sto\scall\non\sthe\sroutine\swe\salready\shave\sfor\sthat,\sTcl_ExprObj().\n\nProblem\sis\sthat\sapparently\sa\scall\sto\sTcl_ExprObj()\sin\scertain\sscenarios\sleads\nto\snested\s(?)\scalls\sof\sTclNRExecuteByteCode()\sand\ssomehow\sthis\smangles\sthe\nexpectations\sof\sthe\sTclStack(Alloc|Free)\sroutines\sin\stheir\sabuse\sof\sthe\nexecution\sstack\sspace.\n\nIt's\svery\scomplicated\sand\sI\shaven't\sfigured\sit\sout\syet.\n\nWe\scan\saccept\sthis\spatch\sas\sa\sfix\sfor\sthe\sreported\sbug.\s\sBut\sif\sso,\swe\sshould\nopen\sa\snew\sbug\sthat\sTcl_ExprObj()\shas\sundocumented\sconditions\son\swhen\sit\ncan\sbe\ssafely\scalled.\s\sThat's\sbad\sfor\sa\spublic\sroutine.
D 2020-09-01T22:26:32.076
F .fossil-settings/ignore-glob 54db70a51154f9ea4254dfabc6b835256bf8ed4bdf34159ea7605132c2349b9f
F .travis.yml 68aef1bafaa7967438b3e8e8bba7690636233a441c40395cd8cbdb2be4a0b76c
F generic/tclBasic.c d19b72729496a8ea51a1bf76f191f83c438350598a6788ad1552688ecf3a25f3
F generic/tclUtil.c 0c04271efece203ac11f5ef652ae1fdd616e1614fc57b4f27f00ea3d7eb58fe4
F tests/io.test 88efc8fbafffee2b1fd4c5120e6f525bb4f2afcbec210d1fb097f1c29fe86d97
F tests/util.test 32b30b2b8067f0aa88bacc50b2e278282fcdd4231d4b32b6c009c9ea6312d5c9
F win/nmakehlp.c 190bf8b40f6f90eeb6cbc1e5c13a19fc7ad870e479e0314c88174f71bf9e28a7
P f1fba2e12fd33ed521780638524ade50be06c16195bc30faaffaab248d32cb11
R e37e9cc3041534cc9cd50f77cc55b3c5
U dgp
Z 8fd81f0240b1792ca003e7759ce36e0e