Artifacts Associated With Ticket 7d83d2193d6da63f
Ticket change [326bbff738] (rid 140027) by anonymous on 2014-09-25 14:46:19:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The absence of standard channels (see ticket 027ba061a8aac869441267c2aef4c4bf9c705c10) on new threads on Windows makes the tree first opened channels to be taken by the core as the standard ones, provoking spurious 'channel is shared' errors on [::thread::detach]. The context in which this issue appeared is a server where the server socket is started in a different thread. Upon connection, connection sockets are transferred to their own threads as well. The following script shows the issue: ~~~ package require Thread; # Print to standard error. proc putsargs {args} { puts stderr $args; }; # Set as error handler. ::thread::errorproc putsargs; # Store main thread id. ::tsv::set threads main [::thread::id]; # Create thread for accepting connections. ::tsv::set threads accept [::thread::create { # Forward logging to main thread. proc putsargs {args} { ::thread::send -async \ [::tsv::get threads main] \ [list ::putsargs {*}$args]; } interp bgerror {} ::putsargs; # Connection handlers. proc _Accept {sock ip port} { putsargs [info level 0]; ::after 0 [list Accept $sock $ip $port]; } proc Accept {sock ip port} { putsargs [info level 0]; ::thread::detach $sock; } set ssock [::socket -server _Accept 54321]; putsargs "Accepting connection on port 54321 (socket=${ssock})" ::thread::wait; }]; ::vwait forever; ~~~ As a workaround, the following snippet should be evaluated when spawning a new thread, so that subsequently opened channels are not taken to be the standard ones. ~~~ ::open nul r; # stdin ::open nul w; # stdout ::open nul w; # stderr ~~~ - foundin initialized to: "2.7.0"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "219192cc5b7de6cef9c96726d1feb29d0382f2dc"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "80. Thread Package"
- title initialized to:
Standard channel restrictions apply to first channels opened in a new thread on Windows
- type initialized to: "Bug"
Ticket change [1b34fbfb6b] (rid 140115) by anonymous on 2014-09-30 10:56:10:
- foundin changed to: "2.7.1"
- icomment:
This issue is present in Tcl 8.6.2 and Thread 2.7.1.
- login: "anonymous"
- mimetype: "text/plain"
Ticket change [7baed9681c] (rid 140117) by dgp on 2014-09-30 11:27:36:
- assignee changed to: "dgp"
- closedate changed to: "2456930.97750486"
- closer changed to: "dgp"
- icomment: "This is not a bug. The other ticket is the bug."
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"