Artifacts Associated With Ticket 217788
Ticket change [95cab08b06] (rid 106214) by nobody on 2000-10-26 00:43:40:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 861 Bug Version: 8.1a2 SubmitDate: '1998-11-25' LastModified: '1998-12-08' Severity: SER Status: Closed Submitter: pat ChangedBy: stanton RelatedBugIDs: 786 OS: All OSVersion: NA Machine: NA FixedDate: '2000-10-25' FixedInVersion: NA ClosedDate: '1998-12-08' Date: Mon, 2 Nov 1998 11:59:45 -0800 (PST) To: [email protected] Cc: [email protected] Subject: TclEvalObj does not work From: [email protected] Tcl 8.1a2 Bug email: [email protected] Support: None Severity: 2 OperatingSystem: Other OperatingSystemVersion: SCO Unix, AIX CustomShell: None Synopsis: TclEvalObj does not work ReproducibleScript: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <tcl.h> #define STRING1 "puts \"hello there\"; set a \"hi\"; set b \"there\"; set c \"$a $b\" " void main(void) { Tcl_Obj *ftn1; Tcl_Interp *Interp; // main command interp if ( (Interp=Tcl_CreateInterp()) == NULL) { fprintf(stderr,"Tcl_CreateInterp failed\n"); } if ( (ftn1=Tcl_NewStringObj(STRING1,strlen(STRING1))) == NULL) fprintf(stderr,"Tcl_NewStringObj failed"); if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK) { fprintf(stderr, "code block failed\n"); } printf("Result [%s]\n",Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL)); if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK) { fprintf(stderr, "code block failed\n"); } printf("Result [%s]\n",Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL)); if (Tcl_EvalObj(Interp,ftn1,0) != TCL_OK) { fprintf(stderr, "code block failed\n"); } printf("Result[%s]\n", Tcl_GetStringFromObj(Tcl_GetObjResult(Interp),NULL)); } ObservedBehavior: The TclEvalObj only executes the TclObject once, Subsequent TclEvalObj executions fail on that TclObject. If there are many TclEvalObj on multiple TclObject executing multiple times, the programs usually crashes. This code runs fine and is very stable in Tcl 8.0.3 DesiredBehavior: The TclObject from what I understand is supposed to store a byte code representation of the ASCII commands after the first execution of the command. Subsequent execution should be significantly faster when using the byte code. The work around is to use TclEval instead of TclEvalObj which slows down the performance significantly.
- foundin initialized to: "obsolete: 8.1a2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "10. Objects"
- title initialized to: "TclEvalObj does not work"
- type initialized to: "Bug"
Ticket change [e8531f83c1] (rid 104627) by welch on 2000-10-26 07:49:18:
- closedate changed to: "2000-10-26T00:49:18"
- closer changed to: "welch"
- priority changed to: "1 Zero"
- resolution changed to: "Duplicate"
- status changed to: "Closed"