Operating System - Linux
1752573 Members
4415 Online
108788 Solutions
New Discussion

Re: what is segmentation fault , and how to slove it ?

 
tan chin tiau
Occasional Contributor

what is segmentation fault , and how to slove it ?

Dear Linux / unix expert

 

my server is hp proliant G5 , OS is Linux Centos .

 

i got one error msg is " segmentation fault "

 

may i know why got this msg ? and how to solve it ?

5 REPLIES 5
Naj
Valued Contributor

Re: what is segmentation fault , and how to slove it ?

Hi

 

A segmentation fault or bus error is generally an attempt to access memory that the CPU.cannot physically address.It occurs when the hardware notifies a UNIX like operating system about a memory access violation.

Normally when we getting this error, we just reboot the server

 

Thanks

 

BR

BR

 


____________________________________________
:: Really appreciate if you could assign some points.
:: Don't know how to assign point? Click the KUDOS! star!
Steven Schweda
Honored Contributor

Re: what is segmentation fault , and how to slove it ?


may i know why got this msg ? and how to solve it ?


   Is Google broken?  A Web search for "segmentation fault" should get
you the whole Wikipedia article, not just the first part.


i got one error msg is " segmentation fault "


   When you did _what_?


Normally when we getting this error, we just reboot the server

   Some people try to find and fix the problem with the software.

Hein van den Heuvel
Honored Contributor

Re: what is segmentation fault , and how to slove it ?

[reply clash with Steven :-) ]

The prior reply (Naj) is a verbatim copy from http://en.wikipedia.org/wiki/Segmentation_fault without the reference.

If you want to address (sic) this issue, then

  • it behooves you to read that article or Google for more.
  • you need to describe the problem better in classic problem solving terms : what is being done when the error happens? did it ever work?  what changed? When does it happen ('all the time', sometimes, when xyz is also being done, after the program runs for 6 days, ...)
  • any resources (memory, disk) being exhausted?

Just blindly rebooting the system is a rather blunt reaction, suggesting a clueless operator.

Reboot prohibits developing a full understanding and proper correction.

Reboot is a valid approach after (corrected) hardware issues, but a segmentation fault is 99.9% sure to be a software coding problem which will NOT be solved by a reboot, but just hidden for a while longer.

 

A more reasonable reaction might be to document the time, and take a quick system snapshot of sorts with 'vmstat', sar or similar, to get an impression of what was running at the time of the issue and then restart the process/job which failed. Does it work now, or fail again? Do other messages precede the segmentation fault?

 

Good luck!

Hein

 

 

Dennis Handly
Acclaimed Contributor

Re: what is segmentation fault and how to solve it?

Do you have a core file so you can invoke a debugger?

Do you know which application is failing?

If the application doesn't have debug info, can you get a stack trace?

 

And even if you do all of this, is there anyone that supports that application so you can get it fixed?

Otherwise as Hein said, you may have to note it down, remove the core file and restart the application.

 

Steven E. Protter
Exalted Contributor

Re: what is segmentation fault and how to solve it?

Shalom,

 

Most likely cause of this is an application trying to access memory not allocated to it.

 

The application must be identified (usually by core files or you revealing what command triggers the fault). Then its usually fixed by repairing the application or getting a patch from the application vendor.

 

SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com