bawt/bawt-2.3.0/Build-Windows.bat x64 vs2013+gcc Setup\TclDistribution.bawt update
Bottom line: I am stuck creating a 64-bit starpack.silently. This is true for any tcl api function call.
I create a 64-bit starpack executable. When I execute it, App_Init() is invoked which in turn calls Tcl_InitStubs(). Tcl_InitStubs() returns "8.6.13", the correct version. After that, any call to the Tcl api, say Tcl_GetVar(), exits the process
Am 18.01.23 um 23:14 schrieb ronald benn:silently. This is true for any tcl api function call.
Bottom line: I am stuck creating a 64-bit starpack.
I create a 64-bit starpack executable. When I execute it, App_Init() is invoked which in turn calls Tcl_InitStubs(). Tcl_InitStubs() returns "8.6.13", the correct version. After that, any call to the Tcl api, say Tcl_GetVar(), exits the process
To me, it is unclear what part you wrote and what part not. If I==========================================================================================
understand correctly, the tclkit-win64-tcl.exe is just the thing you got from BAWT. Does it work to run this purely, without wrapping anything,
and you get a a Tcl prompt where you can do "package require Tk"? If
not, the Tclkit is broken.
Then, I understand you have a C extension which you wish to load. Does
your extension call Tcl_AppInit()? Because it shouldn't.
Your description of the stack trace sounds strange. If normal Tcl calls fail, then it looks like the stubs table isn't initialized, or an application was built embeds the Tcl interpreter rather than extends it,
and it links to the stubs library, when it should link to the real library.
You can also try these tclkits which are built by me on Github Actions: https://github.com/auriocus/kbskit/releases
There is an application built using this: https://github.com/BessyHDFViewer
Christian
On Thursday, January 19, 2023 at 3:37:55 AM UTC-5, Christian Gollwitzer wrote:silently. This is true for any tcl api function call.
Am 18.01.23 um 23:14 schrieb ronald benn:
Bottom line: I am stuck creating a 64-bit starpack.
I create a 64-bit starpack executable. When I execute it, App_Init() is invoked which in turn calls Tcl_InitStubs(). Tcl_InitStubs() returns "8.6.13", the correct version. After that, any call to the Tcl api, say Tcl_GetVar(), exits the process
standard out.To me, it is unclear what part you wrote and what part not. If I==========================================================================================
understand correctly, the tclkit-win64-tcl.exe is just the thing you got
from BAWT. Does it work to run this purely, without wrapping anything,
and you get a a Tcl prompt where you can do "package require Tk"? If
not, the Tclkit is broken.
Then, I understand you have a C extension which you wish to load. Does
your extension call Tcl_AppInit()? Because it shouldn't.
Your description of the stack trace sounds strange. If normal Tcl calls
fail, then it looks like the stubs table isn't initialized, or an
application was built embeds the Tcl interpreter rather than extends it,
and it links to the stubs library, when it should link to the real library. >>
You can also try these tclkits which are built by me on Github Actions:
https://github.com/auriocus/kbskit/releases
There is an application built using this: https://github.com/BessyHDFViewer >>
Christian
More details on the problem:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0);
3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl;
4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command, provingthat the interpreter is running.
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn
==========================================================================================standard out.
More details on the problem:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0);
3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl;
4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
On 01/19/2023 2:15 PM, ronald benn wrote:silently. This is true for any tcl api function call.
On Thursday, January 19, 2023 at 3:37:55 AM UTC-5, Christian Gollwitzer wrote:
Am 18.01.23 um 23:14 schrieb ronald benn:
Bottom line: I am stuck creating a 64-bit starpack.
I create a 64-bit starpack executable. When I execute it, App_Init() is invoked which in turn calls Tcl_InitStubs(). Tcl_InitStubs() returns "8.6.13", the correct version. After that, any call to the Tcl api, say Tcl_GetVar(), exits the process
standard out.To me, it is unclear what part you wrote and what part not. If I==========================================================================================
understand correctly, the tclkit-win64-tcl.exe is just the thing you got >> from BAWT. Does it work to run this purely, without wrapping anything,
and you get a a Tcl prompt where you can do "package require Tk"? If
not, the Tclkit is broken.
Then, I understand you have a C extension which you wish to load. Does
your extension call Tcl_AppInit()? Because it shouldn't.
Your description of the stack trace sounds strange. If normal Tcl calls >> fail, then it looks like the stubs table isn't initialized, or an
application was built embeds the Tcl interpreter rather than extends it, >> and it links to the stubs library, when it should link to the real library.
You can also try these tclkits which are built by me on Github Actions: >> https://github.com/auriocus/kbskit/releases
There is an application built using this: https://github.com/BessyHDFViewer
Christian
More details on the problem:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0); 3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl; 4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
proving that the interpreter is running.I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command,
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn
I can't speak to the linking possibility but you might check the Windows event logs using "eventvwr". Application errors are sometimes recorded there.==============================================================
-mike
Am 19.01.23 um 20:15 schrieb ronald benn:standard out.
==========================================================================================
More details on the problem:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0); 3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl; 4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
The code looks good to me. When you compile your code, is USE_TCL_STUBS defined? i.e. on the command line for the MS compiler it would be /DUSE_TCL_STUBS, in the IDE I don't know. Maybe you have different====================================================================== TCL_USE_STUBS and TK_USE_STUBS are defined using -D as I am using GNU g++ under MINGW.
settings for 32 bit vs 64 bit? You could also #define it in the file
before you include <tcl.h>
Christian
On Thursday, January 19, 2023 at 3:12:53 PM UTC-5, Christian Gollwitzer wrote:
The code looks good to me. When you compile your code, is USE_TCL_STUBS====================================================================== TCL_USE_STUBS and TK_USE_STUBS are defined using -D as I am using GNU g++ under MINGW.
defined? i.e. on the command line for the MS compiler it would be
/DUSE_TCL_STUBS, in the IDE I don't know. Maybe you have different
settings for 32 bit vs 64 bit? You could also #define it in the file
before you include <tcl.h>
Christian
I have verified that they are defined using an #error preprocessor statement to check them.
On Thursday, January 19, 2023 at 2:49:32 PM UTC-5, mss...@gmail.com wrote:
On 01/19/2023 2:15 PM, ronald benn wrote:
On Thursday, January 19, 2023 at 3:37:55 AM UTC-5, Christian Gollwitzer wrote:
standard out.1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0); >>> 3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl; >>> 4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
proving that the interpreter is running.
I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command,
==============================================================I can't speak to the linking possibility but you might check the Windows
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn
event logs using "eventvwr". Application errors are sometimes recorded
there.
-mike
The event log only shows that a dll (my dll) cannot be loaded.
BTW: I tested the tclkit exe's,, both the shell and the gui versions, running them from the command line on test scripts, and they both passed the test. Seem to be on solid ground there.
On Friday, January 20, 2023 at 9:03:01 AM UTC-5, Alan Grunwald wrote:standard out.
On 19/01/2023 20:11, ronald benn wrote:
On Thursday, January 19, 2023 at 2:49:32 PM UTC-5, mss...@gmail.com wrote:Lots of stuff snipped
On 01/19/2023 2:15 PM, ronald benn wrote:
On Thursday, January 19, 2023 at 3:37:55 AM UTC-5, Christian Gollwitzer wrote:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0);
3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl;
4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
proving that the interpreter is running.
I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command,
================================================================================================================================I can't speak to the linking possibility but you might check the Windows
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn
event logs using "eventvwr". Application errors are sometimes recorded >> there.
-mike
The event log only shows that a dll (my dll) cannot be loaded.
BTW: I tested the tclkit exe's,, both the shell and the gui versions, running them from the command line on test scripts, and they both passed the test. Seem to be on solid ground there.
This is likely irrelevant and is certainly at the very limit of my understanding of what's going on, but surely the code above is in your dll, so if it is being executed, then your dll must have been loaded OK.==================================================================
Code is in the dll and the dll definitely loaded ok.
Then first call to tcl api though stubs fails.
Also have determined that the failure is a gp. Silent exit is because I trap the GP and my error handling code has not been set up to process it properly (because we really haven't booted the app at all).
Also note that I did spell USE_TCL_STUBS properly in the code.
I have reinstalled BAWT to upgrade to 2.3.1 and to use gcc 7.2.0. Same problem comes up.
Now I am rebuilding BAWT in 32-bit mode to try that. BTW BAWT is a great piece of work.
On 19/01/2023 20:11, ronald benn wrote:standard out.
On Thursday, January 19, 2023 at 2:49:32 PM UTC-5, mss...@gmail.com wrote:Lots of stuff snipped
On 01/19/2023 2:15 PM, ronald benn wrote:
On Thursday, January 19, 2023 at 3:37:55 AM UTC-5, Christian Gollwitzer wrote:
1 int Qw_Init(Tcl_Interp* Interpreter) {
2 const char* TclInitStubsResult=Tcl_InitStubs(Interpreter,TCL_VERSION,0);
3 cout<<"Qw_Init,1000.0,Tcl_InitStubs,result=="<<TclInitStubsResult<<endl;
4 if (TclInitStubsResult==0) {
5 return TCL_ERROR;
6 }
7 cout<<"Qw_Init,1000.1,"<<endl;
8 char* Buffer=(char*)malloc(100);
9 cout<<"rwb1_debug,Qw_Init,1000.0.3.3"<<endl;
10 ::strcpy(Buffer,"Hello World");
11 cout<<"Qw_Init,1000.2"<<endl;
12 cout<<"Qw_Init,buffer length=="<<::strlen(Buffer)<<endl;
13 cout<<"Qw_Init,1000.3"<<endl;
14 cout<<"QW_init,::argv=="<<Tcl_GetVar(Interpreter,"::argv",TCL_GLOBAL_ONLY)<<endl;
15 ...
The code above is the init function for qw.dll. The package name is qw. The function executes up to line 13 and then silently exists the process when calling Tcl_GetVar in line 13. The correct version is returned from Tcl_InitStubs abnd sent to
proving that the interpreter is running.
I added lines 8 t0 12 to prove we are successfully calling the c runtime library api as malloc(), strcpy(), strlen() and std::cout all execute and send to stdout as expected. Other output is send to stdout from main.tcl using the puts command,
================================================================================================================================I can't speak to the linking possibility but you might check the Windows >> event logs using "eventvwr". Application errors are sometimes recorded
The last thing that comes out in stdout is "Qw_Init,1000.3".
Any tcl (or tk) api function exist silently. So does anyone know why we are not linking properly to the Tcl api stub functions? That is the question. Note that the same coed linked properly in 23-bit.
Ronald Benn
there.
-mike
The event log only shows that a dll (my dll) cannot be loaded.
BTW: I tested the tclkit exe's,, both the shell and the gui versions, running them from the command line on test scripts, and they both passed the test. Seem to be on solid ground there.
This is likely irrelevant and is certainly at the very limit of my understanding of what's going on, but surely the code above is in your
dll, so if it is being executed, then your dll must have been loaded OK.
Code is in the dll and the dll definitely loaded ok.
Then first call to tcl api though stubs fails.
Also have determined that the failure is a gp. Silent exit is because I trap the GP and my error handling code has not been set up to process it properly (because we really haven't booted the app at all).
Am 20.01.23 um 22:42 schrieb ronald benn:=========================================================================
Code is in the dll and the dll definitely loaded ok.Yes, I have expected this. The stubs mechanism basicall replaces a call
Then first call to tcl api though stubs fails.
Also have determined that the failure is a gp. Silent exit is because I trap the GP and my error handling code has not been set up to process it properly (because we really haven't booted the app at all).
like Tcl_GetVar() using a macro by (tclStubsPtr->tcl_GetVar)()
The InitStubs() call should initialize the stubsptr with a pointer to
the correct table. If it doesn't work properly, e.g. if ou forget the
call to InitStubs, then the pointer is zero or some garbage and the call fails. Hence, I was suspecting that you link the wrong library,
inconsistent include files or macro.
BTW, can't you use a debugger to step into the code and see what goes
wrong? E.g. if your call to Tcl_GetVar returns NULL, it will also crash.
You can also try to compile a sampleextension against your Tcl using the
same Makefile, and see if it can be loaded. If yes, the problem is more likely on your code.
Christian
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 485 |
Nodes: | 16 (2 / 14) |
Uptime: | 131:22:49 |
Calls: | 9,655 |
Calls today: | 3 |
Files: | 13,707 |
Messages: | 6,166,553 |