[GHC] #14153: Change worker thread name to something mentioning original process name

GHC ghc-devs at haskell.org
Thu Aug 24 17:20:29 UTC 2017


#14153: Change worker thread name to something mentioning original process name
----------------------------------------+---------------------------------
           Reporter:  enolan            |             Owner:  (none)
               Type:  feature request   |            Status:  new
           Priority:  normal            |         Milestone:
          Component:  Runtime System    |           Version:  8.2.1
           Keywords:                    |  Operating System:  Linux
       Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
          Test Case:                    |        Blocked By:
           Blocking:                    |   Related Tickets:
Differential Rev(s):                    |         Wiki Page:
----------------------------------------+---------------------------------
 Worker OS thread are renamed to `ghc_worker` when spawned. This is
 annoying when reading debugging messages that print the process name. For
 example, at work I'm debugging a segfault in a Haskell program and the
 kernel message just says `ghc_worker[21992]: segfault at 0 ip...` which
 doesn't tell me which of our Haskell programs is having the problem.

 I'd like to change this so it mentions the original name. On Linux, we can
 get that from the `program_invocation_name` global. `pthread_setname_np`
 has a maximum length of 15 characters, so we'll have to truncate it. I
 propose the first 13 characters of the original name followed by ":w". I'd
 just as soon not change the name in the first place but apparently this
 change was made to make it easier to distinguish worker threads from the
 main thread when debugging processes in gdb (commit
 674c631ea111233daa929ef63500d75ba0db8858).

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14153>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list