On Thu, Mar 02, 2000 at 10:48:22AM +0530, Rohit wrote:
> Arun K Desai wrote:
> > i.e when u declare array of size 10 and if u try insert 11 element u get
>segmantaion fault OR Buss Error.
> > If i am wrong plse some one correct me.
>
> Segmentation fault, OK. Bus error? Not sure that they are one and the
> same. When the system reports 'segmentation fault' and 'bus error', I
> think two different events trigger these sequences.
There is a subtle difference. The address space of a process looks like:
----(shm, mmap etc)----text---data---brk--> <-- stack |---> kernel
If the memory reference was on one of the addresses marked "-", you
get a SIGSEGV (segmentation violation - it was outside all valid segments).
However if the address was in a valid segment, but the fault could not
be handled - writing to a readonly page, or jumping to a non executable
page for example, you get a SIGBUS.
-Arun
--------------------------------------------------------------------------
LI is all for free speech, but this list was created for a purpose --
to help popularise Linux in India. If your messages are counterproductive
to that purpose, your privileges to submit messages can and will be revoked.