#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Melbourne Australia
    Posts
    5
    Rep Power
    0

    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?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    India
    Posts
    5
    Rep Power
    0
    Hi

    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.

    Regards
    Karthik

IMN logo majestic logo threadwatch logo seochat tools logo