[GHC] #11489: Segmentation fault when .prof file not writeable

GHC ghc-devs at haskell.org
Mon Jan 25 22:02:16 UTC 2016


#11489: Segmentation fault when .prof file not writeable
-------------------------------------+-------------------------------------
           Reporter:  thomie         |             Owner:
               Type:  bug            |            Status:  new
           Priority:  low            |         Milestone:
          Component:  Profiling      |           Version:  7.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 To reproduce:
 {{{
 $ echo 'main = return ()' > Test.hs

 $ touch Test.prof

 $ chmod -w Test.prof

 $ ghc -prof Test.hs
 [1 of 1] Compiling Main             ( Test.hs, Test.o )
 Linking Test ...

 $ ./Test +RTS -hr{} -hc
 Can't open profiling report file Test.prof
 Segmentation fault (core dumped)
 }}}

 The warning is ok (maybe it should be an error?), but it shouldn't
 segfault.

 Running `./Test +RTS -hr` works fine.

 http://downloads.haskell.org/~ghc/master/users-guide/profiling.html#rts-
 options-for-heap-profiling:
 * `-hc`: Breaks down the graph by the cost-centre stack which produced the
 data.
 * `-hr⟨cc⟩`: Restrict the profile to closures with retainer sets
 containing cost-centre stacks with one of the specified cost centres at
 the top.

 Bug exists since dbef766ce79e37a74468a07a93b15ba1f06fe8f8 (2002):
 {{{
 - you can now restrict a heap profile to certain retainer sets,
   but still display by cost centre (or type, or closure or
   whatever).
 }}}

 Because it didn't update this code+comment introduced in
 db61851c5472bf565cd1da900b33d6e033fd743d (2001):
 {{{
 // The following line was added by Sung; retainer/LDV profiling may need
 // two output files, i.e., <program>.prof/hp.
 if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_RETAINER)
     RtsFlags.ProfFlags.doHeapProfile = 0;
 }}}

 Another relevant commit a4e17de6a38eb37cabff165e8f280a236ffa8af6:
 {{{
 Author: simonmar <unknown>
 Date:   Wed Nov 28 15:42:26 2001 +0000

     [project @ 2001-11-28 15:42:26 by simonmar]
     Don't need the .prof file when LDV-profiling.
 }}}

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


More information about the ghc-tickets mailing list