1834373 Members
2043 Online
110066 Solutions
New Discussion

Re: Core

 
Pratheesh
Advisor

Core

I have created an executable with gcc compiler. It is giving segmentation fault while executing, But not dumping core file. What is the option to set for dumping the core?
8 REPLIES 8
Adam J Markiewicz
Trusted Contributor

Re: Core

Hi

AFAIK there is no dedicated mechanism to block core generation.

However check the following:
1. Doesn't your executable change its working directory? Corefile is always created in current directory at the moment of generation.
2. Does your executable have permission to create new files in its working directory?
3. Check value of ulimit - this is sometimes used to block core generation.

Good luck
Adam
I do everything perfectly, except from my mistakes
Paula J Frazer-Campbell
Honored Contributor

Re: Core

Hi

TOC button on back of server/workstation ?


Paula
If you can spell SysAdmin then you is one - anon
Jdamian
Respected Contributor

Re: Core

Don't push the TOC button as suggested by Paula
Dipu
Occasional Advisor

Re: Core

Hi,
The core file is not generated because may be the size of the coredump file is fixed to zero
Check whether the following entry is there in the ".cshrc" file
"limit coredumpsize 0".
If so please remove this line from the ".cshrc" file.

Regards
Dipu
Zeev Schultz
Honored Contributor

Re: Core

check with ulimit -a for
coredump size.set with ulimit -c.
Are you using any gcc flags?Can also use
gdb with your build program and do tracing.

So computers don't think yet. At least not chess computers. - Seymour Cray
A. Clay Stephenson
Acclaimed Contributor

Re: Core

The DEFAULT action for a segmentation violation is to dump core but that could have been circumvented by 1) ulimit -c 0 to limit the core file size to zero 2) having a custom SIGSEGV handler somewhere in your code (or a library) that replaces the default handler.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Core

The DEFAULT action for a segmentation violation is to dump core but that could have been circumvented by 1) ulimit -c 0 to limit the core file size to zero 2) having a custom SIGSEGV handler somewhere in your code (or a library) that replaces the default handler.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: Core

The DEFAULT action for a segmentation violation is to dump core but that could have been circumvented by 1) ulimit -c 0 to limit the core file size to zero 2) having a custom SIGSEGV handler somewhere in your code (or a library) that replaces the default handler.

Manually inducing a program crash to cause a core dump is useless because the cause of your core dump (and thus the stack trace) would be completely unrelated to your problem.

Do a ulimit -a and see if the core file size is not set to zero. If it is zero, you've found your answer but otherwise you must examine your code for interrupt handlers.
If it ain't broke, I can fix that.