|
2002-09-04
| ||
| 23:17 | • Ticket [599376ffff] Tcl_FindExecutable documentation status still Closed wit... artifact: 178737d2b4 user: vincentdarley | |
| 09:55 | • Ticket [599376ffff]: 4 changes artifact: 8bb3eb49cd user: nobody | |
|
2002-09-02
| ||
| 16:26 | • Ticket [599376ffff]: 2 changes artifact: 658e08aeb1 user: vincentdarley | |
| 16:26 | • Closed ticket [599376ffff]. artifact: 220817e059 user: vincentdarley | |
|
2002-08-31
| ||
| 07:12 | • Ticket [599376ffff]: 4 changes artifact: bd5e1fa57b user: nobody | |
| 02:23 | • Ticket [599376ffff]: 4 changes artifact: bea4b72ec4 user: nobody | |
| 02:16 | • Open ticket [599376ffff]. artifact: 175399c11e user: andreas_kupries | |
| 02:07 | • Ticket [599376ffff]: 4 changes artifact: 7eefe74f29 user: nobody | |
|
2002-08-28
| ||
| 19:46 | • Pending ticket [599376ffff]. artifact: 69e0a28353 user: vincentdarley | |
|
2002-08-27
| ||
| 17:43 | • Ticket [599376ffff]: 4 changes artifact: 0c347f0cf9 user: nobody | |
|
2002-08-23
| ||
| 19:08 | • New ticket [599376ffff]. artifact: fc46775f58 user: nobody | |
Tcl_FindExecutable documentation
Closed / Invalid599376ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-08-23 19:08:47
Using TCL dynamic library tcl84.dll in our process.
The current dir is d:\xyz\some\dir ; have tcl source
script there named "tclExtSource.tcl".
When called Tcl_EvalFile("tclExtSource.tcl");
it fails saying "couldn't read file "tclExtSource.tcl":
no such file or directory"
After investigation, it looks like there is bug in
following method in "tclWinFile.cpp"
int TclpObjNormalizePath(interp, pathPtr,
nextCheckpoint)
Tcl_Interp *interp;
Tcl_Obj *pathPtr;
int nextCheckpoint;
{
.....
}
Thanks.
-Prashant Hedaoo
[email protected]
nobodyplain2002-08-27 17:43:24
Logged In: NO Please provide more detail on the "bug" you found in tclWinFile.c. In particular what were the inputs to the function, what were the results and how did those results differ from what you expected to see.
vincentdarleyplain2002-08-28 19:46:18
Logged In: YES user_id=32170 Can't reproduce this without further information.
nobodyplain2002-08-31 02:07:49
Logged In: NO
Test case:
1. Create Test Tcl source sctipt ("tclTest.tcl") and put it in a dir "c:\some\dir"
2. Create a program to use tcl84.dll (Beta 2) which calls Tcl_EvalFile( "tclTest.tcl") after changing current dir to
"C:\some\dir"
Actual result:
Tcl_EvalFile(..) fails. If you furthur probe, the TclpObjNormalizePath(...) returns path "C:\tclTest.tcl" instead of
"C:\some\dir\tclTest.tcl"
-Prashant
andreas_kupriesplain2002-08-31 02:16:01
Logged In: YES user_id=75003 Step number 2 is the difficult one. Please provide your sources. Without these sources we might accidentially create an application which does not exhibit the problem. Maybe your application initialization is wrong or something which prevents the normalization code from working correctly. If your sources are to big, confidential, etc. reduce your code to a minimal example still exhibiting the problem and submit that. Is it possible for you to add your email address so that Vince can talk to you more directly ?
nobodyplain2002-08-31 02:23:55
Logged In: NO I will try to get you source code for step 2. Additional info : Tcl_EvalFile() worked fine till TCL 8.4 (Alfa 4) release. Broke in TCL 8.4 (Beta 1 and 2) My email : [email protected] -Prashant
nobodyplain2002-08-31 07:12:59
Logged In: NO
Test case setup..............
Prerequisite for building tcl84.lib and tcl84.dll binaries.
Otherwise, program crashes due to NULL function pointer. Another bug in TCL code.
1. Replace line# 86 -> NULL, by following line in ...\win\tclWin32Dll.cpp
(BOOL (WINAPI *)(CONST TCHAR *, GET_FILEEX_INFO_LEVELS, LPVOID)) GetFileAttributesExA,
2. Replace line# 125 -> NULL, by following line in ...\win\tclWin32Dll.cpp
(BOOL (WINAPI *)(CONST TCHAR *, GET_FILEEX_INFO_LEVELS, LPVOID)) GetFileAttributesExW,
3. Build TCL lib binaries.
Test program begins here
--------------------------------------BEGIN----------------------------------
// TclTest.cpp : Test program to demonstrate the Tcl_EvalFile() bug.
//
#include "stdafx.h"
#include "direct.h"
#include <tcl.h>
#define SCTIPT_FILE"tclTest.tcl"
#define SCTIPT_DIR"c:\\some\\dir"
#define SCTIPT_FPATH"c:\\some\\dir\\tclTest.tcl"
int main(int argc, char* argv[])
{
Tcl_Interp*interp = Tcl_CreateInterp();
if (!interp) {
fprintf(stderr, "Tcl_CreateInterp failed\n"); return 1;
}
if(chdir(SCTIPT_DIR)) {
fprintf(stderr, "chdir failed\n"); return 2;
}
//////////////// Tcl_EvalFile() fails.......
if (Tcl_EvalFile(interp, SCTIPT_FILE) != TCL_OK) {
fprintf(stderr, "1: Tcl_EvalFile failed\n\tERROR: %s\n", interp->result);
}
//////////////// Tcl_EvalFile() fails.......here too!!!!!
if (Tcl_EvalFile(interp, SCTIPT_FPATH) != TCL_OK) {
fprintf(stderr, "2: Tcl_EvalFile failed\n\tERROR: %s\n", interp->result);
}
Tcl_DeleteInterp(interp);
return 0;
}
--------------------------------------END----------------------------------
Output of the test program :
----------------------------BEGIN OUTPUT---------------------------
1: Tcl_EvalFile failed
ERROR: couldn't read file "tclTest.tcl": no such file or directory
2: Tcl_EvalFile failed
ERROR: couldn't read file "c:\some\dir\tclTest.tcl": permission denied
----------------------------------END OUTPUT------------------------
Step through the Tcl_EvalFile() call .......see following stack....
TclpObjNormalizePath(Tcl_Interp * 0x00000000, Tcl_Obj * 0x007d7198, int 0x00000000) line 1997
TclNormalizeToUniquePath(Tcl_Interp * 0x00000000, Tcl_Obj * 0x007d7198) line 1086 + 15 bytes
FSNormalizeAbsolutePath(Tcl_Interp * 0x00000000, Tcl_Obj * 0x007d7228) line 1008 + 13 bytes
Tcl_FSGetCwd(Tcl_Interp * 0x00000000) line 2025 + 13 bytes
Tcl_FSGetNormalizedPath(Tcl_Interp * 0x00000000, Tcl_Obj * 0x007d7270) line 4293 + 9 bytes
Tcl_FSGetFileSystemForPath(Tcl_Obj * 0x007d7270) line 4846 + 11 bytes
Tcl_FSStat(Tcl_Obj * 0x007d7270, _stati64 * 0x0012febc) line 1554 + 9 bytes
Tcl_FSEvalFile(Tcl_Interp * 0x007e1100, Tcl_Obj * 0x007d7270) line 1334 + 13 bytes
Tcl_EvalFile(Tcl_Interp * 0x007e1100, const char * 0x00420090 ??_C@_0M@OJLM@tclTest?4tcl?$AA@) line 234
+ 13 bytes
main(int 0x00000001, char * * 0x00900e90) line 26 + 17 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! GetProcessPriorityBoost + 279 bytes
----------------END STACK TRACE------------
The TclpObjNormalizePath(interp, pathPtr, nextCheckpoint) is entered with pathPtr= Tcl_Obj("c:/some/dir")
and nextCheckpoint= 0.
This function is broke.... it returns "<drive>:/" (eg."C:/") for whatever dir path is passed to it.
Thanks for your support.
-Prashant
[email protected]
vincentdarleyplain2002-09-02 16:26:03
Logged In: YES user_id=32170 As per the documentation, you need to call Tcl_FindExecutable first. None of the things you point out are bugs. sorry!
vincentdarley Ticket [599376ffff]: 2 changes
[History diff]2002-09-02 16:26:04
nobodyplain2002-09-04 09:55:46
Logged In: NO
Please point me to the document which recommends user need to call Tcl_FindExecutable() before Tcl_EvalFile()
I could not find it on Man pages for both of the library calls.
Also Is there any special pre-requisit before loading DLL ?
Example :
if {$tcl_platform(os) == {Windows NT}} {
load libNT.dll
}
thanks.
-Prashant
[email protected]
vincentdarleyplain2002-09-04 23:17:25
Logged In: YES user_id=32170 changed name of bug and assigned to dgp to decide whether better documentation is needed to avoid this overly frequent problem.
Log in (anonymous is fine) to add a comment.