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

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

 



Axel and Ian, you both are right there are many possibilities.
Sorry, I forgot to mention gcc version. It is as below:

32-bit:
# gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --disable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)

64-bit:
# gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi --disable-plugin
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)

Crash is a Segmentation fault. Let me get some more information so we
can drill down to the issue.

Regards,
Mitesh Thakkar


On Fri, Jul 22, 2011 at 6:52 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote:
> 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