Re: Crashing in 32-bit but works on 64-bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mitesh Thakkar <mail.mthakkar@xxxxxxxxx> writes:

> On Fri, Jul 22, 2011 at 3:09 PM, Mitesh Thakkar <mail.mthakkar@xxxxxxxxx> wrote:
>> Hi All,
>>
>> I have developed one custom application in C.
>> It is running fine in CentOS 5.6 64-bit, but it is crashing in CentOS
>> 5.6 32-bit.
>> I am not finding any reason/conclusion for it.
>> Can anyone help me for it.
>
> Interestingly, it is not crashing on 32-bit if I give -O0 (I mean do
> not optimize).
> What could be the reason.

I assume you are compiling with the -m32 option to generate 32-bit code.

You neglected to mention which version of gcc you are using.  You
neglected to mention what the crash looks like--e.g., is it a
segmentation violation or an illegal instruction?

While of course it could be anything at all, the most likely reason is
that your program is invalid C, and that the 32-bit optimizers are
changing it in a way that causes it to not behave as you expect.  If the
program works as you expect if you compile with -O2 -fno-strict-aliasing
-fno-strict-overflow then that is almost certainly the problem.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux