Opened 8 years ago

Closed 8 years ago

Last modified 7 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: Test Case: bio001
Blocked By: Blocking:
Related Tickets: Differential Revisions:

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 8 years ago by thorkilnaur

  • Architecture changed from powerpc to Multiple
  • Operating System changed from MacOS X to Multiple

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 8 years ago by igloo

  • Milestone set to 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 8 years ago by igloo

  • Component changed from Compiler to Profiling

comment:4 Changed 8 years ago by simonmar

  • Milestone changed from 6.6.2 to 6.8
  • Owner set to simonmar
  • Priority changed from normal to high

comment:5 Changed 8 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to bio001

Fixed, thanks.

Tue May  8 11:09:08 BST 2007  Simon Marlow <[email protected]>
  * 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 <[email protected]>
  * FIX: #1227 (biographical profiling broken)
  We were freeing the hash table storage with exitHashTable() before
  calling endProfiling(), which uses hash tables.

comment:6 Changed 7 years ago by igloo

  • Milestone changed from 6.8 branch to 6.8.1

comment:7 Changed 7 years ago by simonmar

  • Architecture changed from Multiple to Unknown/Multiple

comment:8 Changed 7 years ago by simonmar

  • Operating System changed from Multiple to Unknown/Multiple
Note: See TracTickets for help on using tickets.