I'm ah, medicated at the moment, so feel free to delete if incoherent.
Excerpts from linuxchix: 29-Feb-100 [techtalk] gcc versions and.. by
"Becky L. Norum"@coe.neu
> I've been developing my C programs at home using RH6.0
> We are required to submit them on Sparc workstations at school.
> A program I've been writing compiles and executes correctly at home; when
> I try to execute it at school I get a bus error.
>
> My question is: What exactly is a bus error (I thought it was like a seg
> fault - trying to reference a NULL location...) AND why would I be getting
> it on one machine and not another?
Hm, maybe this should be a FAQ. Both indicate that youre accessig
memory that you shouldn't. A segmentation violation (seg fault) occurs
on an attempt to write/read to memory that you do not have access to.
Most common case is *NULL, since you usually dont have access to
0x000000000.
Bus error is when the request doesnt fit on the memeory bus. For
example, if memory's like:
+--------+
|data1 | 0x00
+--------+
|data2 | 0x04
+--------+
|data3 | 0x08
+--------+
|data4 | 0x0c
+--------+
And you request 0x03, it can't figure out how to get the data at 0x03.
So, if you're doing aligned/unaligned access, it might Bus Error on one
platform and not on another.
It's definitely a problem with the program... When it doesnt bus error,
the fault is probably manifesting elsewhere, such as with bad data.
> Does it have anything to do with the version of gcc?
>
> At home, gcc is:
> gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>
> At school:
> gcc version 2.8.1
Probably has to do more with the different processor types.
************
[EMAIL PROTECTED] http://www.linuxchix.org