Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#1227 closed bug (fixed)

Crash with biographical profiling on OS X

Reported by: Judah Jacobson Owned by: simonmar
Priority: high Milestone: 6.8.1
Component: Profiling Version: 6.6
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: bio001
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Biographical profiling appears to be broken on OS X v.10.4.8 (PPC). See the below example. I've reproduced this with ghc-6.6 and a darcs pull of the ghc-6.6.1 branch.

Leak.hs:

module Main where

loop n = foldr (+) 0 [1..n]

main = print (loop 100000)

Example run:

~/tmp/leak: ../ghc-6.6/ghc/compiler/stage2/ghc-inplace --make Leak.hs -prof -debug
[1 of 1] Compiling Main             ( Leak.hs, Leak.o )
Linking Leak ...
~/tmp/leak: ./Leak +RTS -hc -RTS
5000050000
~/tmp/leak: ./Leak +RTS -hc -hbvoid -RTS
5000050000
Leak: internal error: ASSERTION FAILED: file ProfHeap.c, line 725

    (GHC version 6.6.20070314 for powerpc_apple_darwin)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Abort trap

Change History (8)

comment:1 Changed 10 years ago by thorkilnaur

Architecture: powerpcMultiple
Operating System: MacOS XMultiple

I can repeat this on PPC Mac OS X. Without -debug compile:

Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ /Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6-for-buildbot-20070221_1000/ghc/compiler/stage2/ghc-inplace --version
The Glorious Glasgow Haskell Compilation System, version 6.6.20070220
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ /Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6-for-buildbot-20070221_1000/ghc/compiler/stage2/ghc-inplace --make Leak.hs -prof
[1 of 1]
Compiling Main             ( Leak.hs, Leak.o )
Linking Leak ...
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ ./Leak +RTS -hc -RTS
5000050000
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ ./Leak +RTS -hc -hbvoid -RTS
5000050000
Bus error
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$

Using another ghc version:

Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ /usr/local/bin/ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.4.1
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ /usr/local/bin/ghc --make Leak.hs -prof
Chasing modules from: Leak.hs
Compiling Main             ( Leak.hs, Leak.o )
Linking ...
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ ./Leak +RTS -hc -RTS
5000050000
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$ ./Leak +RTS -hc -hbvoid -RTS
5000050000
Bus error
Thorkil-Naurs-Computer:~/tn/test/GHC/trac/1227 thorkilnaur$

And on (SuSE) Linux:

tn@linux:~/tn/GHC/trac/1227> /home/tn/tn/GHCDarcsRepository/ghc-6.6-for-1227-20070315_2305/ghc/compiler/stage2/ghc-inplace --version
The Glorious Glasgow Haskell Compilation System, version 6.6.20070314
tn@linux:~/tn/GHC/trac/1227> /home/tn/tn/GHCDarcsRepository/ghc-6.6-for-1227-20070315_2305/ghc/compiler/stage2/ghc-inplace --make Leak.hs -prof -debug
[1 of 1] Compiling Main             ( Leak.hs, Leak.o )
Linking Leak ...
tn@linux:~/tn/GHC/trac/1227> ./Leak +RTS -hc -RTS
5000050000
tn@linux:~/tn/GHC/trac/1227> ./Leak +RTS -hc -hbvoid -RTS
5000050000
Segmentation fault
tn@linux:~/tn/GHC/trac/1227> rm *.o
tn@linux:~/tn/GHC/trac/1227> /home/tn/tn/GHCDarcsRepository/ghc-6.6-for-1227-20070315_2305/ghc/compiler/stage2/ghc-inplace --make Leak.hs -prof
[1 of 1] Compiling Main             ( Leak.hs, Leak.o )
Linking Leak ...
tn@linux:~/tn/GHC/trac/1227> ./Leak +RTS -hc -RTS
5000050000
tn@linux:~/tn/GHC/trac/1227> ./Leak +RTS -hc -hbvoid -RTS
5000050000
Segmentation fault
tn@linux:~/tn/GHC/trac/1227>

comment:2 Changed 10 years ago by igloo

Milestone: 6.6.2

Thanks for the report Judah, and for the reproduction info Thorkil. We'll take a look for 6.6.2.

comment:3 Changed 10 years ago by igloo

Component: CompilerProfiling

comment:4 Changed 10 years ago by simonmar

Milestone: 6.6.26.8
Owner: set to simonmar
Priority: normalhigh

comment:5 Changed 10 years ago by simonmar

Resolution: fixed
Status: newclosed
Test Case: bio001

Fixed, thanks.

Tue May  8 11:09:08 BST 2007  Simon Marlow <simonmar@microsoft.com>
  * FIX crash on exit with biographical profiling
  Seems to be a bug introduced by code to free the memory allocated by
  the heap profiler.

Tue May  8 11:45:51 BST 2007  Simon Marlow <simonmar@microsoft.com>
  * FIX: #1227 (biographical profiling broken)
  We were freeing the hash table storage with exitHashTable() before
  calling endProfiling(), which uses hash tables.

comment:6 Changed 9 years ago by igloo

Milestone: 6.8 branch6.8.1

comment:7 Changed 8 years ago by simonmar

Architecture: MultipleUnknown/Multiple

comment:8 Changed 8 years ago by simonmar

Operating System: MultipleUnknown/Multiple
Note: See TracTickets for help on using tickets.