signal BUS (invalid address alignment) !!!!!! 
Author Message
 signal BUS (invalid address alignment) !!!!!!

Hi,
    I was running (compiled)  a c prog on unix machine, some times i do
get an error like
       signal BUS (invalid address alignment)
can ayone tellme what it is?????

Thanx in advance.

Dileep



Tue, 26 Mar 2002 03:00:00 GMT  
 signal BUS (invalid address alignment) !!!!!!

Quote:

>Hi,
>    I was running (compiled)  a c prog on unix machine, some times i do
>get an error like
>       signal BUS (invalid address alignment)
>can ayone tellme what it is?????

It depends on the platform you use but if it does mean "invalid address
alignment" then you're trying to access an object at an unaligned address.
For example if a system requires ints to be aligned at even addresses
then trying to access one at an odd address might produce an error
like this. Generally it is incorrect use of pointer casts that can
lead to something like this, or perhaps use of uninitialised pointer
variables.

--
-----------------------------------------


-----------------------------------------



Wed, 27 Mar 2002 03:00:00 GMT  
 signal BUS (invalid address alignment) !!!!!!
Your program is maybe buggy (using wrong pointers).
The other posibility is, that your compiler produces wrong
code, which is
unlikely the fact.

Quote:
> Hi,
>     I was running (compiled)  a c prog on unix machine, some
times i do
> get an error like
>        signal BUS (invalid address alignment)
> can ayone tellme what it is?????

> Thanx in advance.

> Dileep

--
  This answer is courtesy of QuestionExchange.com
  http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=4425&cus...


Fri, 29 Mar 2002 03:00:00 GMT  
 signal BUS (invalid address alignment) !!!!!!

Quote:

>        signal BUS (invalid address alignment)
> can ayone tellme what it is?????

A bus error occurs when addresses in memory are fetched into the
registers of a RISC processor, but are not aligned properly. The speed
of these chips comes partially at a price of aligning data in memory
on certain boundaries to make fetches and stores faster. If you violate
this alignment restriction, you get a bus error.

However, this is rarely the true cause of a bus error. Mostly it's
caused by a wild pointer that happens to point to unaligned memory.
A bus error is more precise than a segmentation fault.

A good de{*filter*} ought to be able to tell you what your program
was doing when it crashed, and most likely it was dereferencing
a pointer.

Scott



Fri, 29 Mar 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. invalid address alignment

2. Incomplete import address table causes jump to invalid address

3. Incomplete import address table causes jump to invalid address

4. HELP bus error(alignment error)

5. Causes of signal 10 (bus error)

6. Bus error (inward ring address reference) !!!

7. Address alignment and qsort()

8. malloc address alignment (K&R2 exercise)

9. alignment of starting address of a struct

10. Address Book with Signals in Unix C

11. mmap returns invalid address

12. Invalid pointer addresses

 

 
Powered by phpBB® Forum Software