
On Dec 2, 2005, at 2:08 PM, Simon Marlow wrote:
It looks like your crash happened in the SSL library, and you have a useful stack trace there.
This is contrived in that I already know where the error is and it clearly points to SSL_free. I'm trying to figure out how I would have gotten to that call to getHostByName.
r22 is a pointer to the stack, not a pointer to code, so you can't disassemble it, you need to display memory (as I described in separate mail).
Quoting you:
---
gdb> p16 $r22
which prints 16 words of memory backwards (the way I like it) starting
at the addresss in $r22. when displaying memory this way, gdb very
handily prints the symbol name for words that point into the program.
You can then pick things off the stack that look like return addresses
and disassemble them, if you want.
---
And p16 is defined in .gdbinit as:
define p16
pmem $arg0 16
end
Printing the 16 words gives me the printout below but where do I find
my Haskell function? The code tha causes the crash looks like this:
maybeFreeSSL :: MaybeSSL -> IO ()
maybeFreeSSL tmv =
do putStrLn $ "maybeFreeSSL invoked"
mssl <- atomically $ swapTMVar tmv Nothing
case mssl of
Nothing -> return ()
Just (ssl, _, _) -> do sslFree ssl
sslFree ssl
Is there a way to have maybeFreeSSL in the trace? I compiled the app
with -debug but the libraries and the above maybeFreeSSL code was
compiled without it.
Thanks, Joel
P.S.
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000019
0x00568fe0 in sk_pop_free ()
(gdb) p16 $r22
0x137a40c: 0x1ce63c