Red Hat Bugzilla – Bug 22560
Last modified: 2005-10-31 17:00:50 EST
During comolation of course code using linux c and gcc, program compiled OK... cleanly and the
program execution worked "as expected". However, when compiling
the same code on a Unix workstation using gcc the compiler compiled cleanly but crashed on execution with
a segmentation error/core dumped.
Back to Linux and using gdb I found that somehow my system had allocated the same memory address
to 2 separate variables... which gcc didn't report on but was discovered during debug and a very close look since
debug really didn't pick it up either. This is like a one in a billion chances (odds greater than winning lotto). The Unix
system crashed but my pc didn't... Hmmmm???
To test the problem I simply added a bogus variable within the function where the probem occurred and assigned
a value. This caused my system to compile cleanly but seg fault during exec and consequenlty id the bug in
my code. However, the real problem is in the fact that the original code executed on my laptop (Acer Extenser 500
... it's crappy I know but all I can afford right now) but instantly crashed on a Unix workstation. This suggests a
compatibility problem... hardward problem... I'm not sure. I hope this bug I useful to know:
Since you attached no code, I cannot say anything to this.
Many programming errors for various reasons only pop up on certain architectures
or with certain compiler options, whatever.