UNIX QUESTION :-)

UNIX QUESTION :-)

Post by Kartik Subbar » Wed, 26 Feb 1992 05:24:19



Okay. Just exactly what is the difference between a segmentation fault and
a bus error.

        -Kartik

 
 
 

UNIX QUESTION :-)

Post by Daniel Chouina » Wed, 26 Feb 1992 21:49:08



Quote:>Okay. Just exactly what is the difference between a segmentation fault and
>a bus error.
>    -Kartik

  A segmentation fault is a tectonic quirk and a bus error results in you
getting to west 42nd when you intended to go to grandma's house. :-)

My opinions do NOT represent those of Groupe Sobeco.      Daniel Chouinard
_-___---  _--__-_-  _---_-__  __-_____  _--____-          Groupe Sobeco


 
 
 

UNIX QUESTION :-)

Post by Blair P. Hought » Thu, 27 Feb 1992 02:08:36




>>Okay. Just exactly what is the difference between a segmentation fault and
>>a bus error.

>>        -Kartik

>  A segmentation fault is a tectonic quirk and a bus error results in you
>getting to west 42nd when you intended to go to grandma's house. :-)

You're about as correct as it gets. :-|

The names come from the hardware of the PDP-1/8/10/11/(your guess here)
on which UNIX was first hacked.  The actual answer is
dependent on the hackish nature of your system's
implementors.

The general consensus is that a SIGSEGV is generated when
you ask for (read/write) a segment (or page) that the
system can't find or refuses to find; and a SIGBUS is
generated when you ask for a location that is protected or
otherwise not yours to touch (periperal addresses, et al).
The big difference is that the MMU bolted onto your CPU
should initiate SIGSEGV and something on the bus should
initiate a SIGBUS.

Unless I have this backwards.  :-/

                                --Blair
                                  "Which side of the plug is neutral?"

 
 
 

UNIX QUESTION :-)

Post by Michael Salm » Thu, 27 Feb 1992 17:38:09





|> >>Okay. Just exactly what is the difference between a segmentation fault and
|> >>a bus error.
|> >
|> >>  -Kartik
|> >
|> >  A segmentation fault is a tectonic quirk and a bus error results in you
|> >getting to west 42nd when you intended to go to grandma's house. :-)
|>
|> You're about as correct as it gets. :-|
|>
|> The names come from the hardware of the PDP-1/8/10/11/(your guess here)
|> on which UNIX was first hacked.  The actual answer is
|> dependent on the hackish nature of your system's
|> implementors.
|>
|> The general consensus is that a SIGSEGV is generated when
|> you ask for (read/write) a segment (or page) that the
|> system can't find or refuses to find; and a SIGBUS is
|> generated when you ask for a location that is protected or
|> otherwise not yours to touch (periperal addresses, et al).
|> The big difference is that the MMU bolted onto your CPU
|> should initiate SIGSEGV and something on the bus should
|> initiate a SIGBUS.
|>
|> Unless I have this backwards.  :-/
|>
|>                           --Blair
|>                             "Which side of the plug is neutral?"

You indeed do have it backwards, it is a segmentation fault if you access outside
of that segment of memory that you have permission to access and a bus error if you
attempt to access outside of memory. In practice of course there is no difference,
it's probably a screwed pointer.

--

Michael Salmon

#include        <standard.disclaimer>
#include        <witty.saying>
#include        <fancy.pseudo.graphics>

Ericsson Telecom AB
Stockholm

 
 
 

UNIX QUESTION :-)

Post by Per Lindqvi » Sat, 14 Mar 1992 20:12:30


: Okay. Just exactly what is the difference between a segmentation fault and
: a bus error.
:
:       -Kartik

That is probably very machine specific.
This is how it was originally, on the pdp11 (from user's point of view):

If you addressed a word with an odd address, you got a "Bus Error",
since that was impossible on the pdp11 architecture (bus). There was
also other conditions which could give this error.

If you addressed memory in a way disallowed by the memory-management
unit, for example, outside of your memory, you got a "Memory
management trap", which named segmentation fault.

These two were different interrupt types on the hardware level. On
other cpu's the meaning of the traps might be something completely
different. But typically I would guess that addressing outside of your
memory areas will give "segmentation fault", and other kind of
hardware exceptions "bus error".
--
Per Lindqvist


 
 
 

1. A few UNIX security questions :-)

Being new to Unix (BSD), I'm trying to absorb as much as I can. Does
this group have a FAQ?

I read an article about how hackers could take a file owned by root with
777 rights, they could insert /bin/sh, then execute the file and it
would drop them to a shell with root privileges. (I can't find the text
file now, so this might be slightly off).

If this is true, how would you protect against it (Root has to run/own
certain things with these permissions, no?).

Like I said, being new to Unix, I'm still getting use to things like
users, groups, permissions, ex., and their security issues.. If anyone
has any links that would help in this department, please post them.

Thanks.

2. Allocating buffers in kernel/user space

3. I tried LINUX :-) :-)

4. Red hat 5.2+Xwin+CyrexGXvideo+Newbie= LOST!!!!

5. InfoExplorer works under X11R5 now :-) :-)

6. No link /usr/X11R6/bin/X -- /var/.....!

7. DOSEMU works better than DOS :-) :-)

8. Slackware Pro 2 - Various problems

9. Cheers!, another 100 milions seconds since UNIX epoch :-)

10. Nowhere Man >> Unix Man 2>/dev/null :-)

11. The "fortune" I just got, re vms >> unix :-)

12. Cheers!, another 100 milions seconds since UNIX epoch :-)

13. /dev/kmem and crashing UNIX systems (results of test runs :-) )