July 22nd, 2003, 10:52 PM
Bus Error- What The?
I posted earlier a thread called "compiles and runs in debug but then it crashes" - the problem is outlined there.... anyway, i compiled my program on my university's computer and gcc told me there is a "bus error" when it crashed...
What is a bus error?, Am i passing too much information to and from my functions?
July 24th, 2003, 08:27 AM
The "Bus Error" will occur when a program tries to access a non-aligned pointer. For instance, on many machine architectures, access to 'long' (4 byte) numbers must be done using a memory address that divides by 4. Trying to access such an entity using an address that does not abide by this rule will cause this error.
It means there is a memory mis-handling in your program. Check your program whether you are allocating and freeing memory perfectly.
I have not seen your program, But I am sure there is an error in your program and there is nothing to do with the compiler. Whichever compiler you are using if your program has any Illegal memory access this kind of ( Bus error/Memory fault) errors used to come.
Let me know if you need any other info.