#6010: GHC.Conc.labelThread function can't use Unicode character for thread 
label.
------------------------------+---------------------------------------------
 Reporter:  shelarcy          |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  libraries/base  
  Version:  7.4.1             |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------
 Debug.Trace.traceEventIO fucntion uses UTF-8 encoding for outputing
 Strings.

   http://www.haskell.org/ghc/docs/7.4.1/html/libraries/base-4.5.0.0/src
 /Debug-Trace.html#traceEventIO

 "ghc-events show" can show Unicode characters' user event correctly.

 {{{
 import Debug.Trace
 main = do
     traceEventIO "テスト"
     putStrLn "test"
 }}}

 {{{
 $ ghc -O2 -threaded -eventlog Test.hs
 [1 of 1] Compiling Main             ( Test.hs, Test.o )
 Linking Test.exe ...

 $ .\Test.exe +RTS -l
 "test"
 $ ghc-events show Test.eventlog > test.log
 }}}

 {{{
 Event Types:
   (snip)

 Events:
   (snip)
   1531003: cap 0: running thread 3
   1594090: cap 0: テスト
   1805086: cap 0: stopping thread 3 (making a foreign call)
   (snip)
 }}}

 But GHC.Conc.labelThread function doesn't use UTF-8 encoding.

   http://www.haskell.org/ghc/docs/7.4.1/html/libraries/base-4.5.0.0/src
 /GHC-Conc-Sync.html#labelThread

 So, "ghc-events show" can't show Unicode characters' thread label
 correctly.

 {{{
 import Control.Concurrent
 import GHC.Conc (labelThread)

 main = do
     tid <-myThreadId
     labelThread tid "テスト"
     putStrLn "test"
 }}}

 {{{
 Events:
   (snip)
   1438032: cap 0: running thread 3
   1454030: cap 0: thread 3 has label "????
   1637859: cap 0: stopping thread 3 (making a foreign call)
   (snip)
 }}}

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

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to