Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | [Bug 3398794]: Use Tcl errors in scripts, not panics. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
241cdd7be1f8e95f7dc8d6a9d5abd123 |
User & Date: | dkf 2011-08-30 00:23:16 |
Context
2011-09-01
| ||
17:29 | 3402540 Corrections to TclParseNumber() to make it reject invalid Nan(Hex). [scan Inf %g] is portabl... check-in: 79b3c9d044 user: dgp tags: trunk | |
2011-08-30
| ||
16:20 | Prevent leak of interps when using the [testthread exit] command. check-in: 3fc64e5692 user: dgp tags: dgp-thread-leaks | |
10:30 | Merge to feature branch check-in: d89eb1e656 user: dkf tags: dkf-utf16-branch | |
09:06 | Merge to feature branch check-in: 86b845ef50 user: dkf tags: dkf-notifier-poll | |
06:33 | Tcl_MainEx() (like Tk_MainEx()) Closed-Leaf check-in: 2f0a062d8f user: jan.nijtmans tags: rfe-1711975 | |
00:23 | [Bug 3398794]: Use Tcl errors in scripts, not panics. check-in: 241cdd7be1 user: dkf tags: trunk | |
00:05 | [Bug 3398794]: Use Tcl errors in scripts, not panics. check-in: b3333814a0 user: dkf tags: core-8-5-branch | |
2011-08-29
| ||
23:24 | Put back the check for server sockets (bug #3394732). check-in: 0722843420 user: max tags: trunk | |
Changes
Changes to ChangeLog.
1 2 | 2011-08-30 Reinhard Max <[email protected]> | > > > > > > > > | | | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | 2011-08-30 Donal K. Fellows <[email protected]> * generic/tclInterp.c (SlaveCommandLimitCmd, SlaveTimeLimitCmd): [Bug 3398794]: Ensure that low-level conditions in the limit API are enforced at the script level through errors, not a Tcl_Panic. This means that interpreters cannot read their own limits (writing already did not work). 2011-08-30 Reinhard Max <[email protected]> * unix/tclUnixSock.c (TcpWatchProc): [Bug 3394732]: Put back the check for server sockets. 2011-08-29 Don Porter <[email protected]> * generic/tclIORTrans.c: Leak of ReflectedTransformMap. 2011-08-27 Don Porter <[email protected]> * generic/tclStringObj.c: [RFE 3396731]: Revise the [string reverse] * tests/string.test: implementation to operate on the representation that comes in, avoid conversion to other reps. 2011-08-23 Don Porter <[email protected]> * generic/tclIORChan.c: [Bug 3396948]: Leak of ReflectedChannelMap. 2011-08-19 Don Porter <[email protected]> * generic/tclIORTrans.c: [Bugs 3393279, 3393280]: ReflectClose(.) is missing Tcl_EventuallyFree() calls at some of its exits. * generic/tclIO.c: [Bugs 3394654, 3393276]: Revise FlushChannel() to account for the possibility that the ChanWrite() call might recycle the buffer out from under us. * generic/tclIO.c: Preserve the chanPtr during FlushChannel so that channel drivers don't yank it away before we're done with it. 2011-08-19 Alexandre Ferrieux <[email protected]> * generic/tclTest.c: [Bug 2981154]: async-4.3 segfault. * tests/async.test: [Bug 1774689]: async-4.3 sometimes fails. 2011-08-18 Alexandre Ferrieux <[email protected]> * generic/tclIO.c: [Bug 3096275]: Sync fcopy buffers input. 2011-08-18 Jan Nijtmans <[email protected]> * generic/tclUniData.c: [Bug 3393714]: Overflow in toupper delta * tools/uniParse.tcl * tests/utf.test 2011-08-17 Alexandre Ferrieux <[email protected]> * generic/tclIO.c: [Bug 2946474]: Consistently resume backgrounded * tests/ioCmd.test: flushes+closes when exiting. 2011-08-17 Alexandre Ferrieux <[email protected]> * doc/interp.n: Document TIP 378's one-way-ness. 2011-08-17 Don Porter <[email protected]> * generic/tclGet.c: [Bug 3393150]: Overlooked free of intreps. (It matters for bignums!) 2011-08-16 Don Porter <[email protected]> * generic/tclCompile.c: [Bug 3392070]: More complete prevention of Tcl_Obj reference cycles when producing an intrep of ByteCode. 2011-08-16 Donal K. Fellows <[email protected]> * generic/tclListObj.c (TclLindexList, TclLsetFlat): Silence warnings about (unreachable) cases of uninitialized variables. * generic/tclCmdIL.c (SelectObjFromSublist): Improve the generation of |
︙ | ︙ | |||
177 178 179 180 181 182 183 | labels. 2011-08-04 Reinhard Max <[email protected]> * generic/tclIOSock.c (TclCreateSocketAddress): Don't bother using AI_ADDRCONFIG for now, as it was causing problems in various situations. | | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | labels. 2011-08-04 Reinhard Max <[email protected]> * generic/tclIOSock.c (TclCreateSocketAddress): Don't bother using AI_ADDRCONFIG for now, as it was causing problems in various situations. 2011-08-04 Donal K. Fellows <[email protected]> * generic/tclAssembly.c (AssembleOneLine, GetBooleanOperand) (GetIntegerOperand, GetListIndexOperand, FindLocalVar): [Bug 3384840]: A Tcl_Obj is allocated by GetNextOperand, so callers of it must not hold a reference to one in the 'out' parameter when calling it. This was causing a great many memory leaks. |
︙ | ︙ | |||
344 345 346 347 348 349 350 | * generic/tclTomMathDecls.h: * macosx/Tcl.xcode/project.pbxproj: * macosx/Tcl.xcodeproj/project.pbxproj: * tests/util.test: * unix/Makefile.in: * win/Makefile.in: * win/Makefile.vc: | | | | | | | | | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | * generic/tclTomMathDecls.h: * macosx/Tcl.xcode/project.pbxproj: * macosx/Tcl.xcodeproj/project.pbxproj: * tests/util.test: * unix/Makefile.in: * win/Makefile.in: * win/Makefile.vc: [Bug 3349507]: Fix a bug where bignum->double conversion is "round up" and not "round to nearest" (causing expr double(1[string repeat 0 23]) not to be 1e+23). 2011-06-28 Reinhard Max <[email protected]> * unix/tclUnixSock.c (CreateClientSocket): [Bug 3325339]: Fix and simplify posting of the writable fileevent at the end of an asynchronous connection attempt. Improve comments for some of the trickery around [socket -async]. * tests/socket.test: Adjust tests to the async code changes. Add more tests for corner cases of async sockets. 2011-06-22 Andreas Kupries <[email protected]> * library/platform/pkgIndex.tcl: Updated to platform 1.0.10. Added |
︙ | ︙ | |||
381 382 383 384 385 386 387 | is in progress. ***POTENTIAL INCOMPATIBILITY*** * tests/socket.test: Add a test for the above. * doc/socket: Document the fact that -async needs the event loop * generic/tclIOSock.c: AI_ADDRCONFIG is broken on HP-UX 2011-06-21 Don Porter <[email protected]> | | | | | 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | is in progress. ***POTENTIAL INCOMPATIBILITY*** * tests/socket.test: Add a test for the above. * doc/socket: Document the fact that -async needs the event loop * generic/tclIOSock.c: AI_ADDRCONFIG is broken on HP-UX 2011-06-21 Don Porter <[email protected]> * generic/tclLink.c: [Bug 3317466]: Prevent multiple links to a single Tcl variable when calling Tcl_LinkVar(). 2011-06-13 Don Porter <[email protected]> * generic/tclStrToD.c: [Bug 3315098]: Mem leak fix from Gustaf Neumann. 2011-06-08 Andreas Kupries <[email protected]> * generic/tclExecute.c: Reverted the fix for [Bug 3274728] committed on 2011-04-06 and replaced with one which is 64bit-safe. The existing fix crashed tclsh on Windows 64bit. |
︙ | ︙ | |||
742 743 744 745 746 747 748 | error codes (TclOO miscellany). * generic/tclCmdAH.c, generic/tclCmdIL.c: More generation of error codes (miscellaneous commands mostly already handled). 2011-04-04 Don Porter <[email protected]> | | | | | 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 | error codes (TclOO miscellany). * generic/tclCmdAH.c, generic/tclCmdIL.c: More generation of error codes (miscellaneous commands mostly already handled). 2011-04-04 Don Porter <[email protected]> * README: [Bug 3202030]: Updated README files, repairing broken * macosx/README:URLs and removing other bits that were clearly wrong. * unix/README: Still could use more eyeballs on the detailed build * win/README: advice on various plaforms. 2011-04-04 Donal K. Fellows <[email protected]> * library/init.tcl (tcl::mathfunc::rmmadwiw): Disable by default to make test suite work. * generic/tclBasic.c, generic/tclStringObj.c, generic/tclTimer.c, |
︙ | ︙ | |||
969 970 971 972 973 974 975 | 2011-03-09 Donal K. Fellows <[email protected]> * tests/incr.test: Update more of the test suite to use Tcltest 2. 2011-03-09 Don Porter <[email protected]> | | | | | | 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 | 2011-03-09 Donal K. Fellows <[email protected]> * tests/incr.test: Update more of the test suite to use Tcltest 2. 2011-03-09 Don Porter <[email protected]> * generic/tclNamesp.c: [Bug 3202171]: Tighten the detector of nested * tests/namespace.test: [namespace code] quoting that the quoted scripts function properly even in a namespace that contains a custom "namespace" command. * doc/tclvars.n: Formatting fix. Thanks to Pat Thotys. 2011-03-09 Donal K. Fellows <[email protected]> * tests/dstring.test, tests/init.test, tests/link.test: Update more of the test suite to use Tcltest 2. |
︙ | ︙ | |||
995 996 997 998 999 1000 1001 | and unsigned integer expressions 2011-03-08 Don Porter <[email protected]> * generic/tclInt.h: Remove TclMarkList() routine, an experimental * generic/tclUtil.c: dead-end from the 8.5 alpha days. | | | | | | | | 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 | and unsigned integer expressions 2011-03-08 Don Porter <[email protected]> * generic/tclInt.h: Remove TclMarkList() routine, an experimental * generic/tclUtil.c: dead-end from the 8.5 alpha days. * generic/tclResult.c (ResetObjResult): [Bug 3202905]: Correct failure to clear invalid intrep. Thanks to Colin McDonald. 2011-03-08 Donal K. Fellows <[email protected]> * generic/tclAssembly.c, tests/assemble.test: Migrate to use a style more consistent with the rest of Tcl. 2011-03-06 Don Porter <[email protected]> * generic/tclBasic.c: More replacements of Tcl_UtfBackslash() calls * generic/tclCompile.c: with TclParseBackslash() where possible. * generic/tclCompCmdsSZ.c: * generic/tclParse.c: * generic/tclUtil.c: * generic/tclUtil.c (TclFindElement): [Bug 3192636]: Guard escape sequence scans to not overrun the string end. 2011-03-05 Don Porter <[email protected]> * generic/tclParse.c (TclParseBackslash): [Bug 3200987]: Correct * tests/parse.test: trunction checks in \x and \u substitutions. 2011-03-05 Miguel Sofer <[email protected]> * generic/tclExecute.c (TclStackFree): insure that the execStack satisfies "at most one free stack after the current one" when consecutive reallocs caused the creation of intervening stacks. |
︙ | ︙ | |||
1090 1091 1092 1093 1094 1095 1096 | * generic/tclInt.h: * generic/tclIntDecls.h: * generic/tclInterp.c: * generic/tclOODecls.h: * generic/tclStubInit.c: * win/makefile.vc: | | | | | | | 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | * generic/tclInt.h: * generic/tclIntDecls.h: * generic/tclInterp.c: * generic/tclOODecls.h: * generic/tclStubInit.c: * win/makefile.vc: * generic/tclExecute.c (ExprObjCallback): Fix object leak * generic/tclExecute.c (TEBCresume): Store local var array and constants in automatic vars to reduce indirection, slight perf increase * generic/tclOOCall.c (TclOODeleteContext): Added missing '*' so that trunk compiles. * generic/tclBasic.c (TclNRRunCallbacks): [Patch 3168229]: Don't do the trampoline dance for commands that do not have an nreProc. 2011-03-01 Donal K. Fellows <[email protected]> * generic/tclOO.c (Tcl_NewObjectInstance, TclNRNewObjectInstance) (TclOOObjectCmdCore, FinalizeObjectCall): * generic/tclOOBasic.c (TclOO_Object_Destroy, AfterNRDestructor): * generic/tclOOCall.c (TclOODeleteContext, TclOOGetCallContext): |
︙ | ︙ |
Changes to generic/tclInterp.c.
︙ | ︙ | |||
4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 | OPT_CMD, OPT_GRAN, OPT_VAL }; Interp *iPtr = (Interp *) interp; int index; ScriptLimitCallbackKey key; ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; if (objc == consumedObjc) { Tcl_Obj *dictPtr; TclNewObj(dictPtr); key.interp = slaveInterp; key.type = TCL_LIMIT_COMMANDS; | > > > > > > > > > > > > > | 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 | OPT_CMD, OPT_GRAN, OPT_VAL }; Interp *iPtr = (Interp *) interp; int index; ScriptLimitCallbackKey key; ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; /* * First, ensure that we are not reading or writing the calling * interpreter's limits; it may only manipulate its children. Note that * the low level API enforces this with Tcl_Panic, which we want to * avoid. [Bug 3398794] */ if (interp == slaveInterp) { Tcl_AppendResult(interp, "limits on current interpreter inaccessible", NULL); return TCL_ERROR; } if (objc == consumedObjc) { Tcl_Obj *dictPtr; TclNewObj(dictPtr); key.interp = slaveInterp; key.type = TCL_LIMIT_COMMANDS; |
︙ | ︙ | |||
4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 | OPT_CMD, OPT_GRAN, OPT_MILLI, OPT_SEC }; Interp *iPtr = (Interp *) interp; int index; ScriptLimitCallbackKey key; ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; if (objc == consumedObjc) { Tcl_Obj *dictPtr; TclNewObj(dictPtr); key.interp = slaveInterp; key.type = TCL_LIMIT_TIME; | > > > > > > > > > > > > > | 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 | OPT_CMD, OPT_GRAN, OPT_MILLI, OPT_SEC }; Interp *iPtr = (Interp *) interp; int index; ScriptLimitCallbackKey key; ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; /* * First, ensure that we are not reading or writing the calling * interpreter's limits; it may only manipulate its children. Note that * the low level API enforces this with Tcl_Panic, which we want to * avoid. [Bug 3398794] */ if (interp == slaveInterp) { Tcl_AppendResult(interp, "limits on current interpreter inaccessible", NULL); return TCL_ERROR; } if (objc == consumedObjc) { Tcl_Obj *dictPtr; TclNewObj(dictPtr); key.interp = slaveInterp; key.type = TCL_LIMIT_TIME; |
︙ | ︙ |
Changes to tests/interp.test.
︙ | ︙ | |||
580 581 582 583 584 585 586 | } -cleanup { rename setx {} interp delete a } -result {x invoked from within "a 1"} | < | 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | } -cleanup { rename setx {} interp delete a } -result {x invoked from within "a 1"} # part 15: testing file sharing test interp-15.1 {testing file sharing} { catch {interp delete z} interp create z z eval close stdout list [catch {z eval puts hello} msg] $msg } {1 {can not find channel named "stdout"}} |
︙ | ︙ | |||
661 662 663 664 665 666 667 | removeFile file-15.8 } -result 0 # # Torture tests for interpreter deletion order # proc kill {} {interp delete xxx} | < | | 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | removeFile file-15.8 } -result 0 # # Torture tests for interpreter deletion order # proc kill {} {interp delete xxx} test interp-16.0 {testing deletion order} { catch {interp delete xxx} interp create xxx xxx alias kill kill list [catch {xxx eval kill} msg] $msg } {0 {}} test interp-16.1 {testing deletion order} { catch {interp delete xxx} |
︙ | ︙ | |||
3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 | test interp-35.22 {interp time limits normalize milliseconds} -body { set i [interp create] interp limit $i time -seconds 1 -millis 1500 list [$i limit time -seconds] [$i limit time -millis] } -cleanup { interp delete $i } -result {2 500} test interp-36.1 {interp bgerror syntax} -body { interp bgerror } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} test interp-36.2 {interp bgerror syntax} -body { interp bgerror x y z } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} | > > > > > > > | 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 | test interp-35.22 {interp time limits normalize milliseconds} -body { set i [interp create] interp limit $i time -seconds 1 -millis 1500 list [$i limit time -seconds] [$i limit time -millis] } -cleanup { interp delete $i } -result {2 500} # Bug 3398794 test interp-35.23 {interp command limits can't touch current interp} -body { interp limit {} commands -value 10 } -returnCodes error -result {limits on current interpreter inaccessible} test interp-35.24 {interp time limits can't touch current interp} -body { interp limit {} time -seconds 2 } -returnCodes error -result {limits on current interpreter inaccessible} test interp-36.1 {interp bgerror syntax} -body { interp bgerror } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} test interp-36.2 {interp bgerror syntax} -body { interp bgerror x y z } -returnCodes error -result {wrong # args: should be "interp bgerror path ?cmdPrefix?"} |
︙ | ︙ | |||
3606 3607 3608 3609 3610 3611 3612 | interp debug {} -frames } -returnCodes error -result {bad debug option "-frames": must be -frame} test interp-38.8 {interp debug basic setup} -body { interp debug {} -frame 0 bogus } -returnCodes { error } -result {wrong # args: should be "interp debug path ?-frame ?bool??"} | < | 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 | interp debug {} -frames } -returnCodes error -result {bad debug option "-frames": must be -frame} test interp-38.8 {interp debug basic setup} -body { interp debug {} -frame 0 bogus } -returnCodes { error } -result {wrong # args: should be "interp debug path ?-frame ?bool??"} # cleanup unset -nocomplain hidden_cmds foreach i [interp slaves] { interp delete $i } ::tcltest::cleanupTests return # Local Variables: # mode: tcl # fill-column: 78 # End: |