Artifacts Associated With Ticket 218361
Ticket change [2e0cb49dce] (rid 119158) by nobody on 2000-10-26 00:56:42:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 4180 Bug Version: 8.3 SubmitDate: '2000-02-15' LastModified: '2000-04-03' Severity: CRIT Status: Closed Submitter: techsupp ChangedBy: hobbs OS: BSD FixedDate: '2000-10-25' ClosedDate: '2000-04-03' Name: Petasis George ReproducibleScript: I have written this little function for converting between external->UTF:(Strdup duplicates a UTF-8 string...) char *ExternalToUtf(char *encoding, char *str) { Tcl_DString Text; Tcl_Encoding enc; char *result; //My_Interp is a global that contains a pointer to the only interp my app uses... //Tcl_ResetResult(My_Interp); //If you add this the abort is gone... enc = Tcl_GetEncoding(CDM_Interp, encoding); if (encoding == NULL) return NULL; // Tcl_GetEncoding has left an error... Tcl_DStringInit(&Text); result = Strdup(Tcl_ExternalToUtfDString(enc, str, -1, &Text)); Tcl_DStringFree(&Text); Tcl_FreeEncoding(enc); return result; } If you set the system encoding (example) to cp1253 and you keep calling this function to convert strings to iso8859-7 (like: ExternalToUtf("iso8859-7", "some-greek-string in iso8859-7 enc");) Then you will get an abort after a few iterations... ObservedBehavior: When calling Tcl_GetEncoding and Tcl_FreeEncoding many times (i.e. in a loop) and you always request the same encoding( but a different one than the system encoding), then wish crashes under windows with a message about Tcl_SetObjLength modifing a shared object. I think that one of these functions tries to modify the given interpreter without checking if its object is shared or not. If I put Tcl_ResetResult just before calling these functions, all work ok. This problem is much easier to reproduce it under windows than unix... This look suspiciously like an app that doesn't have the Tcl_FindExecutable call that is necessary for 8.1+ apps that use encodings. Is this the case? We need to see the startup code to know more. -- 04/03/2000 hobbs - foundin initialized to: "obsolete: 8.3"
- 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: "Tcl_GetEncoding modifing a shared object..."
- type initialized to: "Bug"
Ticket change [f86580cd1d] (rid 91528) by welch on 2000-10-26 08:20:08:
- closedate changed to: "2000-10-26T01:20:08"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [ddc04ae6da] (rid 114727) by dgp on 2001-04-20 01:48:11:
- closedate changed to: "2001-04-19T18:48:11"
- closer changed to: "dgp"
- subsystem changed to: "10. Objects"