Subject: Re: What is difference between SIGSEGV and SIGBUS
To: None <acb@mavericks.bt.co.uk, kstailey@owl.dol-esa.gov>
From: Captech) <greywolf@tomcat.VAS.viewlogic.com (James Graham>
List: current-users
Date: 08/04/1995 15:17:09
My take on SEGV and BUS has been as follows:
SEGV comes when you reference something within your address space but
outside of a segment, i.e. if there's holes between segments, or if
you're trying to write to your text segment.
BUS comes when you're referring to something completely off base, i.e.
something outside your address space completely (very low or very high
addresses seem to fit into this range).
This is the only thing that can explain why I get a SIGBUS when
doing something which amounts to "fprintf(0, string, arg, arg2);", and
get a SEGV when doing something which amounts to
"fprintf((FILE *)some-other-weird-but-undefined-addr, string, arg, arg2);"
Does this make sense to anyone?