Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • chevalier@alum.wellesley.edu's avatar
    ed95d86d
    Avoid segfault when ticky file argument is stderr · ed95d86d
    chevalier@alum.wellesley.edu authored
    If you compiled a program with -ticky and ran it with:
    ./foo +RTS -rstderr -RTS
    the result would be a segfault. This was because the RTS interprets stderr to
    mean "use debugBelch to print out messages," and sets the ticky file pointer
    to NULL as a result, but PrintTickyInfo (the function in Ticky.c that prints
    out the ticky report) wasn't checking for NULL.
    
    I changed PrintTickyInfo to check whether the ticky file pointer is NULL and 
    output to stderr if so.
    
    Also removed an unused import from CodeOutput.lhs.
    ed95d86d
    History
    Avoid segfault when ticky file argument is stderr
    chevalier@alum.wellesley.edu authored
    If you compiled a program with -ticky and ran it with:
    ./foo +RTS -rstderr -RTS
    the result would be a segfault. This was because the RTS interprets stderr to
    mean "use debugBelch to print out messages," and sets the ticky file pointer
    to NULL as a result, but PrintTickyInfo (the function in Ticky.c that prints
    out the ticky report) wasn't checking for NULL.
    
    I changed PrintTickyInfo to check whether the ticky file pointer is NULL and 
    output to stderr if so.
    
    Also removed an unused import from CodeOutput.lhs.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.