On 8/13/2025 3:52 PM, saito wrote:
On 8/13/2025 4:29 PM, et99 wrote:
Note, your choice of errorInfo can cause confusion. The first time you run that command, if the variable does not yet exist, (and I don't believe it will until there's been an error) then it will be set to a text string that says it doesn't exist,
which on a second try to read it will return the new contents, which would be the same text string as reported earlier.
To be sure, try [info global] or [info exist errorInfo].
I believe errorInfo is always available after you start a new tcl/wish shell. Same thing if you create a new thread. See the behavior in the old Thread version:
% package req Thread
2.8.5
% set t [thread::create {thread::wait}]
tid00003CE0
% thread::send $t {set errorInfo}
can't read "::tcl_pkgPath": no such variable
while executing
"foreach Dir $::tcl_pkgPath {
if {$Dir ni $::auto_path} {
lappend ::auto_path $Dir
}
}"
Just curious, are you running on Windows?
Yes, indeed this is on Windows 11.
I was going to ask what your actual code was doing that didn't work,
My code follows the typical threaded idea: it starts a new thread, sets up some variables, lets it do some file stuff, and then gets a status code at the end.
However, the package is acting differently. In my interactions today, it was getting stuck at different points. It almost seems like it is not being initialized properly and different errors pop up.
Below is what I see with magicsplat 8.6.16.
Notice that the thread does not initially have everything global setup, much less than in the mainthread. There's no errorInfo variable initially. It also doesn't have the auto_path setup fully either.
I mention this because you are doing file operations inside threads and a bug in the *tcl windows file system code* was discovered and patched just recently. The bug was when some code used memory that had been freed. So, it had a "timing" aspect to it.
In my case, the bug appeared as a (sometimes) failure to load packages inside of threads. The bug was also discovered to have been around for quite some time and I believe it was back-patched into 8.6 and is likely to be patched in the next 8.6 release.
It is patched/fixed in 9.1a0
You might want to get a magicsplat 9.0.2 and see if the problem is there also, and then see if 9.1a0 or later (when available) fixes the problem. You'd then know if you were being hit by this bug too.
=================================
(bin) 1 % package require Thread
2.8.11
(bin) 2 % set tid [thread::create {thread::wait}]
tid0000000000004288
(bin) 3 % thread::send $tid {info glob}
tcl_version auto_path env tcl_patchLevel tcl_library tcl_platform
(bin) 4 % thread::send $tid {join $auto_path \n} C:/Users/et/AppData/Local/Apps/Tcl86/lib/tcl8.6 C:/Users/et/AppData/Local/Apps/Tcl86/lib
(bin) 5 % info pa
8.6.16
(bin) 6 % join $auto_path \n
C:/Users/et/AppData/Local/Apps/Tcl86/lib/tcl8.6 C:/Users/et/AppData/Local/Apps/Tcl86/lib C:/Users/et/AppData/Local/Apps/Tcl86/lib/cawt3.1.1 C:/Users/et/AppData/Local/Apps/Tcl86/lib/tcl3d1.0.1 C:/Users/et/AppData/Local/Apps/Tcl86/lib/tcllib2.0 C:/Users/et/AppData/Local/Apps/Tcl86/lib/vfs1.4.2/template C:/Users/et/AppData/Local/Apps/Tcl86/lib/tk8.6 C:/Users/et/AppData/Local/Apps/Tcl86/lib/tk8.6/ttk
(bin) 8 % info glob
tcl_rcFileName tcl_version argv0 argv tcl_interactive tk_library tk_version auto_path errorCode tk_strictMotif errorInfo auto_index tid env tcl_patchLevel argc tk_patchLevel tcl_library tcl_platform
(bin) 9 % thread::send $tid {package require foobar}
can't find package foobar
(bin) 10 % thread::send $tid {set errorInfo}
can't find package foobar
while executing
"package require foobar"
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)