You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all Swift versions (incl. 5.4, 5.5 and the current main snapshot (Swift version 5.6-dev (LLVM c8e0f2fe28693ea, Swift 68eb340a2b7690f))) that I've tried on Linux.
Additional Detail from JIRA
Votes
0
Component/s
libdispatch
Labels
Bug, linux
Assignee
None
Priority
Medium
md5: 908cecea496804cb997a5bfc0ef74c2b
Issue Description:
On Linux, Dispatch incorrectly inherits essentially random thread names which makes debugging certain issues very hard. Usually, threads get labelled for a good reason, so it's pretty bad if that thread name then gets duplicated onto other threads.
Consider this test program which spawns one Thread and then sets its label to "MyThread". Subsequently it dispatches some work to some DispatchGroup and prints the dispatch queue's thread name (which should either be something chosen by Dispatch (ideal) or empty or maybe the program name but certainly not "MyThread").
$ swift test.swift
[on thread] thread name is MyThread
[on global queue 0] thread name is
[on global queue 1] thread name is
[on global queue 3] thread name is
[on global queue 4] thread name is
[on global queue 6] thread name is
[on global queue 7] thread name is
[on global queue 5] thread name is
[on global queue 9] thread name is
[on global queue 2] thread name is
[on global queue 8] thread name is
ie, the thread names of the DispatchQueues are empty.
On Linux however, we see
$ docker run -it --rm -v "$PWD:$PWD" -w "$PWD" swift:5.5 swift test.swift
[on thread] thread name is MyThread
[on global queue 0] thread name is MyThread
[on global queue 2] thread name is MyThread
[on global queue 3] thread name is MyThread
[on global queue 4] thread name is MyThread
[on global queue 5] thread name is MyThread
[on global queue 6] thread name is MyThread
[on global queue 8] thread name is MyThread
[on global queue 1] thread name is MyThread
[on global queue 9] thread name is MyThread
[on global queue 7] thread name is MyThread
so "MyThread" got incorrectly inherited.
This got first discovered here: apple/swift-nio#1896 (I incorrectly filed it as a SwiftNIO issue).
The text was updated successfully, but these errors were encountered:
Environment
all Swift versions (incl. 5.4, 5.5 and the current
main
snapshot (Swift version 5.6-dev (LLVM c8e0f2fe28693ea, Swift 68eb340a2b7690f))) that I've tried on Linux.Additional Detail from JIRA
md5: 908cecea496804cb997a5bfc0ef74c2b
Issue Description:
On Linux, Dispatch incorrectly inherits essentially random thread names which makes debugging certain issues very hard. Usually, threads get labelled for a good reason, so it's pretty bad if that thread name then gets duplicated onto other threads.
Consider this test program which spawns one
Thread
and then sets its label to "MyThread". Subsequently it dispatches some work to someDispatchGroup
and prints the dispatch queue's thread name (which should either be something chosen by Dispatch (ideal) or empty or maybe the program name but certainly not "MyThread").On Darwin, this program correctly prints
ie, the thread names of the DispatchQueues are empty.
On Linux however, we see
so "MyThread" got incorrectly inherited.
This got first discovered here: apple/swift-nio#1896 (I incorrectly filed it as a SwiftNIO issue).
The text was updated successfully, but these errors were encountered: