Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

What is a bus error?

What does the "bus error" word mean, and how does it differ from a segfault?
by

2 Answers

aashaykumar
A segfault is accessing memory that you're not allowed to access. It's read-only, you don't have permission, etc...

A bus error is trying to access memory that can't possibly be there. You've used an address that's meaningless to the system, or the wrong kind of address for that operation.
sandhya6gczb
Bus errors are rare nowadays on x86 and occur when your processor cannot even attempt the memory access requested, typically:

using a processor instruction with an address that does not satisfy its alignment requirements.
Segmentation faults occur when accessing memory which does not belong to your process, they are very common and are typically the result of:

1.using a pointer to something that was deallocated.
2.using an uninitialized hence bogus pointer.
3.using a null pointer.
4.overflowing a buffer.

Login / Signup to Answer the Question.