[techtalk] Re: [grrltalk] extremely new

Kathryn Hogg kjh at flyballdogs.com
Thu Aug 31 21:25:18 EST 2000


Nancy Corbett said:
> A segmentation fault is reported when you run a program and it tries to
> access something it doesn't have permission to access...at least that's my
> understanding of it.  A program will skip merrily along until BAM!  it
> hits a wall when it tries to occupy a space where it isn't allowed to be.

A segmentation fault usually happens when a program accesses memory in an 
incorrect way.   Each program has it's own address space called virtual 
memory which is divided into chunks called pages.  Each page has certain
access rights.  For example, the data pages can be read and written by the 
application.  The pages with the programs instructions (code or text pages) 
can be read but not written which allows these pages to be shared amongst 
all the instances of the program running or all apps using a shared library.

So a program will SEGV if it tries to write a page that it doesn't have 
access to.  

A related signal is a Bus Error, which means the program was trying to access a 
page that does not exist in it's address space.

> Core files can be huge!  But they can contain information developers can use 
> to debug their software.  

Which is why I have a little script called nocore that does the following:

#!/bin/ksh
if [ -d ~/.nocore ]
then
   mkdir ~/.nocore 
   ln -s /dev/null ~/.nocore/core
fi

cd ~/.nocore
exec $*

I find myself much happier to run netscape via "nocore netscape".

--
Kathryn Hogg





More information about the Techtalk mailing list