#3693: Show stack traces
---------------------------------+------------------------------------------
Reporter: jpet | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.14.1
Component: Runtime System | Version: 6.10.4
Keywords: | Difficulty:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
Patch: 1 |
---------------------------------+------------------------------------------
Comment(by batterseapower):
The new version of the patch is much improved. Backtraces now look like
this:
{{{
$ ./Stacks2
Stacks2: Stacks2.hs:8:1-17: Non-exhaustive patterns in function myHead
Stacks2: Backtrace:
main:Main.thunk_use_site1 (Stacks2.hs:6:1-14)
base:GHC.TopHandler.runMainIO1
(libraries/base/GHC/TopHandler.lhs:54:1-9)
}}}
Despite the fact that there is more information in the backtrace than
before (the SrcLocs), I actually managed to reduce binary bloat a little
bit (it is now at 8%):
{{{
$ du .
8.0K ./autogen
116K ./cbits
148K ./Control/Concurrent
116K ./Control/Exception
36K ./Control/Monad/ST
80K ./Control/Monad
832K ./Control
24K ./Data/STRef
2.7M ./Data
16K ./Debug
468K ./Foreign/C
192K ./Foreign/Marshal
900K ./Foreign
236K ./GHC/IO/Encoding
424K ./GHC/IO/Handle
1.4M ./GHC/IO
6.0M ./GHC
72K ./System/Console
48K ./System/IO
32K ./System/Mem
332K ./System/Posix
692K ./System
128K ./Text/ParserCombinators
152K ./Text/Read
16K ./Text/Show
420K ./Text
8.0K ./Unsafe
28M .
}}}
This was achieved by commoning up the info, and not emitting it if it
isn't actually needed.
I also tried to reduce the impact on physical memory of this debug info
being in the object file by trying to emit it in a single contiguous
section. The idea is that if its all together on one page then the OS's
cache manager will simply not load it into physical memory until a stack
trace is actually needed - thanks to Simon Marlow for this idea.
RetInfoTables originating from the RTS now have some primitive backtrace
information.
I've modified the tidier so that Internal names get names based on their
referrer. This generalises the Simplifier hack from my last patch, so I've
got rid of that change.
Remaining work:
* Special handling for update frames (maybe), and perhaps some other of
the non-standard RTS return frames
* Look to see if I can improve the precision of backtrace info by using
some of the context local to the return point
* Run testsuite (I've been avoiding this, my machine is slow :-)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3693#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs