Ask Experts » Software & Apps » Software »

What are the probable reason of 'Segmentation fault (core dumped)' error during compilation of C?


Date: 03 May 2015   Posted By: Paresh Gujarati     Group: Software & Apps    Category: Software   

I am using Ubuntu 14.04 and running my C programs in g++ compiler. I am getting error while compiling the program written in C. The message says, "Segmentation fault(core dumped)". What are the probable reason behind this error? Please let me know how to rectify the issue.

Want solve the "Segmentation Fault" error in C program? Unable to get through the Core Dumped error message? Check this Ask experts thread to get solutions to your problem.


Author: Timmappa Kamat    08 May 2015      Member Level: Platinum     Points : 8  (Rs 8)    Voting Score: 0

Though I am not an expert in C programing, thus is what I could gather from my sources -
Segmentation fault occurs when a program tries to access a memory location that has no access to it or tries to access it in a non permitted way. Such fault ends the program, but generates a file known core dump. Core dump is actually a file when the status of the working memory of the computer is recorded when a program ends abruptly. It is used for debugging processes so that the reason for the abnormal activity can be assessed.
Resort for the segmentation fault could never many fold. A few of them include -
1. A buggy program or command.
2. A faulty hardware/driver or memory.
3. Overheating.
4. Missing share lib or configuration files.
Possible solutions could be -
1. Installing and configuring proper hardware.
2. Applying suitable patches to the program
3. Using an updated system.
4. Fixing the C program concerned for logical.errors.
5. Analysing the Core dump file using any debugging tool.

Please note that the issue can only fixed by analysing the individual cases. Try implementing the above solutions to check if they help.





Post Answer



You must Sign In to post a response.


Post Answer        





Related Questions
  • Return to Question Index
  • Ask Question to Experts


  • Top Contributors
    Today
      Last 7 Daysmore...