[GHC] #3874: GHC.Exts.traceEvent segfaults

GHC trac at galois.com
Thu Feb 11 00:12:18 EST 2010


#3874: GHC.Exts.traceEvent segfaults
-------------------------------+--------------------------------------------
    Reporter:  cjs             |       Owner:                 
        Type:  bug             |      Status:  new            
    Priority:  normal          |   Component:  Runtime System 
     Version:  6.12.1          |    Keywords:  event, eventlog
          Os:  Linux           |    Testcase:                 
Architecture:  x86_64 (amd64)  |     Failure:  None/Unknown   
-------------------------------+--------------------------------------------

Comment(by cjs):

 "You can't call varargs functions like that," at least not on this system.
 Also, we need to fix that printf format args issue. So here's your new
 code:
 {{{
 void postUserMsg(Capability *cap, char *msg)
 {
     postFormatUserMsg(cap, "%s", msg);
 }

 static void postSafeuserMsg(Capability *cap, char *format, ...)
 {
     va_list ap;
     va_start(ap, format);
     postLogMsg(&capEventBuf[cap->no], EVENT_USER_MSG, format, ap);
     va_end(ap);
 }
 }}}
 Note that there are a few other places in the code where you'll have to do
 similar things, such as in rts/Trace.c the call to traceCap_stderr in
 traceUserMsg.

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


More information about the Glasgow-haskell-bugs mailing list