So I'm attempting to write a Haskell library using FFI bindings. I seem to have messed up somewhere and I'm getting seg faults:
$ cat test.input| ./dist/build/test-fftsStub/test-fftsStub
Cases: 1  Tried: 0  Errors: 0  Failures: 0got here
now here
ran init
ran execute
[1]    12406 done                              cat test.input | 
       12407 segmentation fault (core dumped)  ./dist/build/test-fftsStub/test-fftsStub
$
It says that the core has been dumped...but I can't find it anywhere on disk. There is no core file:
$ ls -1 | grep core
$
Now I tried to raise the ulimit for my terminal which works for C core dumps:
$ulimit -c unlimited    
$ cat test.input| ./dist/build/test-fftsStub/test-fftsStub 
Cases: 1  Tried: 0  Errors: 0  Failures: 0got here
now here
ran init
ran execute
[1]    12694 done                              cat test.input | 
       12695 segmentation fault (core dumped)  ./dist/build/test-fftsStub/test-fftsStub
$ ls -1 | grep core                                       
cabal-test-run-with-ext-core-flag.out
$ 
Question: Where is the core dumped to / how do I get the core dump?
Successful Core Dump, now what?
Edit: Okay I have the coredump now. Turns out on Ubuntu I had to:
sudo service stop apport
So that it would not toss away my core dump. However, now how do I compare that core dump with the original Haskell code...or even the C equivalent. At this point in time I have resorted to printf debugging in the C library that I am attempting to FFI wrap.
