digitalmars.D.learn - core file
- Tony (5/5) Nov 12 2017 I am getting the message from my program execution:
- codephantom (11/16) Nov 12 2017 More info than that is needed.
- Tony (3/21) Nov 12 2017 I am on Ubuntu 16.04. Thanks, I didn't know that "producing a
- =?UTF-8?Q?Ali_=c3=87ehreli?= (8/11) Nov 12 2017 It is. If you search for "where is core file ubuntu" you will hit the
- Tony (3/15) Nov 13 2017 My mistake. When I said "and it isn't", I was trying to say "and
- Tony (2/7) Nov 13 2017 Thanks for the "man core" tip and the link.
- codephantom (17/19) Nov 13 2017 ok. that's because Ubuntu is not (by default) setup for
- Antonio Corbi (13/32) Nov 13 2017 Hi,
I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is there one somewhere? Would I be able to do anything meaningful with it if it exists?
Nov 12 2017
On Monday, 13 November 2017 at 05:01:18 UTC, Tony wrote:I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is there one somewhere? Would I be able to do anything meaningful with it if it exists?More info than that is needed. What platform are you on? Do you have core dumps enabled/disabled? If you have it enabled...where does it put them? And yes, core dumps are potentially useful for debugging. However, given you're asking that question, and getting core dumps, then it might be easier for you to use the -g option when you compile, and then run your executable (or a.out) through a debugger: https://www.youtube.com/watch?v=vcVmWbYEIsk
Nov 12 2017
On Monday, 13 November 2017 at 05:37:12 UTC, codephantom wrote:On Monday, 13 November 2017 at 05:01:18 UTC, Tony wrote:I am on Ubuntu 16.04. Thanks, I didn't know that "producing a core file" was configurable, and it appears that it isn't.I am getting the message from my program execution: "Segmentation fault (core dumped)" But I don't see a core file in the current directory or in my home directory. Is there one somewhere? Would I be able to do anything meaningful with it if it exists?More info than that is needed. What platform are you on? Do you have core dumps enabled/disabled? If you have it enabled...where does it put them? And yes, core dumps are potentially useful for debugging. However, given you're asking that question, and getting core dumps, then it might be easier for you to use the -g option when you compile, and then run your executable (or a.out) through a debugger: https://www.youtube.com/watch?v=vcVmWbYEIsk
Nov 12 2017
On 11/12/2017 10:25 PM, Tony wrote:I've been assuming that if it says "dumped", the core is dumped."Segmentation fault (core dumped)"I am on Ubuntu 16.04. Thanks, I didn't know that "producing a core file" was configurable, and it appears that it isn't.It is. If you search for "where is core file ubuntu" you will hit the output of 'man core', as well as answers like the following, which explains that the file may be under /var/cache/abrt: https://stackoverflow.com/questions/2065912/core-dumped-but-core-file-is-not-in-current-directory Ali
Nov 12 2017
On Monday, 13 November 2017 at 07:38:14 UTC, Ali Çehreli wrote:On 11/12/2017 10:25 PM, Tony wrote:My mistake. When I said "and it isn't", I was trying to say "and it isn't set on my system as shown by 'ulimit -a'".I've been assuming that if it says "dumped", the core is dumped."Segmentation fault (core dumped)"I am on Ubuntu 16.04. Thanks, I didn't know that "producing acore file"was configurable, and it appears that it isn't.It is. If you search for "where is core file ubuntu" you will hit the output of 'man core', as well as answers like the following, which explains that the file may be under /var/cache/abrt: https://stackoverflow.com/questions/2065912/core-dumped-but-core-file-is-not-in-current-directory Ali
Nov 13 2017
On Monday, 13 November 2017 at 07:38:14 UTC, Ali Çehreli wrote:It is. If you search for "where is core file ubuntu" you will hit the output of 'man core', as well as answers like the following, which explains that the file may be under /var/cache/abrt: https://stackoverflow.com/questions/2065912/core-dumped-but-core-file-is-not-in-current-directoryThanks for the "man core" tip and the link.
Nov 13 2017
On Monday, 13 November 2017 at 06:25:20 UTC, Tony wrote:I am on Ubuntu 16.04. Thanks, I didn't know that "producing a core file" was configurable, and it appears that it isn't.ok. that's because Ubuntu is not (by default) setup for developers. But you can enable core dump for your executable easily enough. e.g, if you out file is a.out, then do this: ulimit -S -c unlimited a.out (now run your program, and you'll get core file in the same dir where the program is) (this won't be remembered after a reboot, so just do it when/as required). You can view the core file using > objdump -s core Good luck understanding the contents of that ;-) Core dumps typically require some specialised expertise to analyse. Unless you're one of those specialists, then better to just run your a.out through the debugger, and forget about the core dump (until you can't) ;-)
Nov 13 2017
On Monday, 13 November 2017 at 09:49:29 UTC, codephantom wrote:On Monday, 13 November 2017 at 06:25:20 UTC, Tony wrote:Hi, core files can be used to do a 'post-mortem' debug session with gdb, from 'man gdb': You can also start with both an executable program and a core file specified: gdb program core If your program is compiled with '-g' option, gdb will load the executable and extract the information from the core file and it will show your program's state exactly as if it had been run from the debugger and had failed in that exactly moment. AntonioI am on Ubuntu 16.04. Thanks, I didn't know that "producing a core file" was configurable, and it appears that it isn't.ok. that's because Ubuntu is not (by default) setup for developers. But you can enable core dump for your executable easily enough. e.g, if you out file is a.out, then do this: ulimit -S -c unlimited a.out (now run your program, and you'll get core file in the same dir where the program is) (this won't be remembered after a reboot, so just do it when/as required). You can view the core file using > objdump -s core Good luck understanding the contents of that ;-) Core dumps typically require some specialised expertise to analyse. Unless you're one of those specialists, then better to just run your a.out through the debugger, and forget about the core dump (until you can't) ;-)
Nov 13 2017