1

main.cpp

#include <stdexcept>

int main()
{
    throw std::runtime_error("AAAA");
}

I generate and run the exe file:

g++ -g main.cpp
a.exe

I see no output on screen. I see no core file.

I followed this post as well and it didn't work.

It seems ulimit also does not exist under cygwin.


Update

The output of ulimit -a:

In CMD:

>ulimit -a
'ulimit' is not recognized as an internal or external command,
operable program or batch file.

In bash:

$ ulimit -a
core file size          (blocks, -c) unlimited
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
open files                      (-n) 256
pipe size            (512 bytes, -p) 8
stack size              (kbytes, -s) 2032
cpu time               (seconds, -t) unlimited
max user processes              (-u) 256
virtual memory          (kbytes, -v) unlimited
Community
  • 1
  • 1
ar2015
  • 5,558
  • 8
  • 53
  • 110
  • Does this answer your question? [Using a stackdump from Cygwin executable](https://stackoverflow.com/questions/320001/using-a-stackdump-from-cygwin-executable) – Evandro Coan Dec 15 '19 at 01:08

1 Answers1

0

Just checked, by me the core file is perfectly created. Please provide the output of ulimit -a. Besides that, I am not sure what paths you have, so, please run the binary as ./a.exe to have the explicit path to it.

dmi
  • 1,424
  • 1
  • 9
  • 9
  • The path is explicit – ar2015 Jan 12 '16 at 07:30
  • Do you build and run in CMD or in bash? – dmi Jan 12 '16 at 07:38
  • tested both. cmd has problem with `export` and `ulimit`. It does not recognize any of them. However, neither cmd nor bash could create core dump – ar2015 Jan 12 '16 at 07:45
  • Please also check the current directory is writable for the process. In parallel, you could also try to run it under gdb to see whether the code really generates an exception (perhaps you run the binary which does not correspond to the source code)... and let us know the results. Please also include the listing of the current directory. – dmi Jan 12 '16 at 07:58
  • please let me know if I should use bash or cmd. Also what command should I exactly write? – ar2015 Jan 12 '16 at 08:01
  • I would recommend alsways use bash. – dmi Jan 12 '16 at 08:34