Artifacts Associated With Ticket 218820ffffffffff
Ticket change [ee15399dee] (rid 104022) by nobody on 2000-10-26 01:05:57:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2243 Bug Version: 8.1.1 SubmitDate: '1999-06-16' LastModified: '1999-07-01' Severity: MED Status: Released Submitter: techsupp ChangedBy: foster OS: Other OSVersion: WinNT, AIX, Solaris, Linux Machine: NA FixedDate: '1999-06-16' FixedInVersion: 8.2b1 ClosedDate: '2000-10-25' Name: Borivoj Tydlitat CustomShell: No ReproducibleScript: We observed the behavior in a fairly complex script only and were not able to reproduce it in a short one due to nature of the problem. This the relevant fragment: set drat [lindex $seg 0] if {[info exists drat]} { puts "should print drat because it exists" puts "after, drat=$drat" } else { puts "really bad, drat doesn't exist" } Output: should print drat because it exists can't read "": no such variable Our analysis: If INSTR_LOAD_SCALAR1 bytecode is generated with argument byte > 0x7F, the interpreter treats this argument as signed value, resulting in negative localIndex passed to TclGetIndexedScalar, which fails or returns invalid pointer. ObservedBehavior: Local variable seems not to exist, though it was created. Occurs in a complex script only. Patch: *** tclExecute.old Wed Jun 16 14:34:27 1999 --- tclExecute.c Wed Jun 16 13:55:49 1999 *************** *** 1052,1058 **** case INST_LOAD_SCALAR1: #ifdef TCL_COMPILE_DEBUG ! opnd = TclGetInt1AtPtr(pc+1); DECACHE_STACK_INFO(); valuePtr = TclGetIndexedScalar(interp, opnd, /*leaveErrorMsg*/ 1); --- 1052,1058 ---- case INST_LOAD_SCALAR1: #ifdef TCL_COMPILE_DEBUG ! opnd = TclGetUInt1AtPtr(pc+1); DECACHE_STACK_INFO(); valuePtr = TclGetIndexedScalar(interp, opnd, /*leaveErrorMsg*/ 1); *************** *** 1067,1073 **** TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); #else /* TCL_COMPILE_DEBUG */ DECACHE_STACK_INFO(); ! valuePtr = TclGetIndexedScalar(interp, TclGetInt1AtPtr(pc+1), /*leaveErrorMsg*/ 1); CACHE_STACK_INFO(); if (valuePtr == NULL) { --- 1067,1073 ---- TRACE_WITH_OBJ(("%u => ", opnd), valuePtr); #else /* TCL_COMPILE_DEBUG */ DECACHE_STACK_INFO(); ! valuePtr = TclGetIndexedScalar(interp, TclGetUInt1AtPtr(pc+1), /*leaveErrorMsg*/ 1); CACHE_STACK_INFO(); if (valuePtr == NULL) { PatchFiles: tclExecute.c 06/16/1999 14:39 - stanton - I have applied the patch and added a test case. - foundin initialized to: "final: 8.1.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "failure accessing local variables"
- type initialized to: "Bug"
Ticket change [8cceb11136] (rid 127798) by welch on 2000-10-26 08:29:17:
- closedate changed to: "2000-10-26T01:29:17"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [0c24df6552] (rid 114127) by dgp on 2001-04-23 02:53:14:
- closedate changed to: "2001-04-22T19:53:14"
- closer changed to: "dgp"
- subsystem changed to: "47. Bytecode Compiler"