I have found a bug in tcl/tk 9.0x that occurs on windows when doing a [package require math] inside of several threads concurrently. I have
tested several different distributions, a 9.01 and 9.02 magicsplat, a
bawt 9.01 distro and tclkit, and as a control, 8.6.16 magicsplat (which
does not fail).
Am 17.07.2025 um 05:22 schrieb et99:Thanks, I didn't want to shout too loudly :) I have added some thoughts to the ticket in response to some of the postings by others.
I have found a bug in tcl/tk 9.0x that occurs on windows when doing a [package require math] inside of several threads concurrently. I have tested several different distributions, a 9.01 and 9.02 magicsplat, a bawt 9.01 distro and tclkit, and as a control, 8.6.16 magicsplat (which does not fail).
I am sorry that nobody picked it up.
Symbol build and Visual Studio Debug->Attach to process is not soo complicated...
I have added my ideas to the ticket.
Sometimes, it is necessary to wave with all hands to get attention, sorry.
Thanks for all,
Harald
On 7/17/2025 12:04 AM, Harald Oehlmann wrote:
Am 17.07.2025 um 05:22 schrieb et99:Thanks, I didn't want to shout too loudly :) I have added some thoughts
I have found a bug in tcl/tk 9.0x that occurs on windows when doing a
[package require math] inside of several threads concurrently. I have
tested several different distributions, a 9.01 and 9.02 magicsplat, a
bawt 9.01 distro and tclkit, and as a control, 8.6.16 magicsplat
(which does not fail).
I am sorry that nobody picked it up.
Symbol build and Visual Studio Debug->Attach to process is not soo
complicated...
I have added my ideas to the ticket.
Sometimes, it is necessary to wave with all hands to get attention,
sorry.
Thanks for all,
Harald
to the ticket in response to some of the postings by others.
One question in my mind: Is there some portion of the package database
kept in C code that is not visible to script code? And if so, is that
global to all threads, which would require some sort of locking?
That could explain why it takes more than one thread to see a problem. Obviously, if a package require math (or any other one that fails) were failing in a single threaded program, people would have noticed long
before now.
I recall years ago when doing a package require Tk inside of multiple threads caused access violations on linux (but not windows). That was
fixed when some additional locking was added. Perhaps this is a similar situation.
-eric
Yes, package code is in C.
Please only use the ticket to comment.
We have now Mega-Wizard Sergey on the track. Please try to support him.
Thanks for all,
Harald
On 7/17/2025 11:03 PM, Harald Oehlmann wrote:
Yes, package code is in C.
Please only use the ticket to comment.
We have now Mega-Wizard Sergey on the track. Please try to support him.
Thanks for all,
Harald
Thanks for looking into this. And way to go Sergey!
I see Sergey has closed the ticket with a ref count fix, which turned
out to be in the file system area. I will await 9.0.3 and test again. My tasks module can give threads a real run for the money, as I have code
that includes the launching of many dozens of threads, some even
hundreds, making use of tsv variables and mutexes etc.
I might also be one of only a few, who runs with Tk GUI windows in each thread. That can really push the limits.
Thanks again Harald and Sergey.
-eric
No, it would be great to test it now, sorry.
If a bug is fixed, the original reporter should check it.
Sorry,
Harald
[slightly getting OT]
I wonder what Chatgpt would have done without the win/README file in the
TCL distribution which holds the relevant information ;-)
Sysop: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 1,064 |
Nodes: | 10 (0 / 10) |
Uptime: | 163:56:26 |
Calls: | 13,691 |
Calls today: | 1 |
Files: | 186,936 |
D/L today: |
9,208 files (2,741M bytes) |
Messages: | 2,411,516 |