[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Exception/bus error

Posted on 2004-09-13
5
Medium Priority
?
423 Views
Last Modified: 2010-04-15
Hi All,

I would like to know the difference between an exceptiona nd bus error. Maybe some examples would be of help.

Another(out of context) question : Is it necessary to have a 'ile system' for printf( ) to work ?

Thanks,
Arut
0
Comment
Question by:arut
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12042038
There are a number of exceptions, but just an example: zero-divide. And a bus-error could be the use of an address (by means of a pointer or array) that isn't in your dataspace, i.e. that isn't accessible by your program.

If you are on linux/unix, try man 2 signal, or use Google searching for "man signal linux"
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12042133
A fatal failure in the execution of a machine language instruction resulting from the processor detecting an anomalous condition on its bus. Such conditions include invalid address alignment (accessing a multi-byte number at an odd address), accessing a physical address that does not correspond to any device, or some other device-specific hardware error. A bus error triggers a processor-level exception which Unix translates into a "SIGBUS" signal which, if not caught, will terminate the current process.

http://computing-dictionary.thefreedictionary.com/bus%20error
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 12042153
Bus error is a kind of exception ... There are several exceptions including but not limited to what sjef_bosman said

"And a bus-error could be the use of an address (by means of a pointer or array) that isn't in your dataspace, i.e. that isn't accessible by your program."
Is segmentation fault but not bus error .. I do not thing divide by zero is a bus error either .. that should be arithmetic or floating point exception
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 375 total points
ID: 12042187
Another way of putting it

There's a subtle difference between "segmentation fault" and "bus error". A "bus error" means that the kernel didn't detect the problem on its own; the memory system (i.e. hardware) realized that there was a problem.
http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/CommonFAQ/SGIErrors.html#buserror

Some processors generate fault when you try to access non aligned memory, bus error is generally an indication of that condition
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12042286
Too subtle for me... I  must admit that "Bus Error - Core dumped" reminds me of the PDP-11 series, which indeed had word-alignment.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question