my program compiled by GCC crashed

Andrew Haley aph@redhat.com
Fri Dec 11 11:34:00 GMT 2009


王克驰 wrote:
> Hi Andrew,
> 
> Thanks a lot for your reply.
> 
> Yeah, I agree with you.  There may be something wrong with
> libicuio.so.3 or something else.
> 
> But we can not say it is nothing to do with GCC. I changed the
> compiler from g++ to gcc(of course, I also changed to use stdio.h and
> printf), then the core dump went away. With the same code and same
> options for the comiler, when I went back to g++, it still cored.  How
> can we explain that?

Really, really hard to say.  If I had the box there I'd attach gdb and
tell you.

Andrew.


> 2009/12/11 Andrew Haley <aph@redhat.com>:
>> 王克驰 wrote:
>>> Hi gcc-help,
>>>
>>> Our system crashed which was compiled by GCC. While, we can not say
>>> that GCC compiler is the root cause.
>>>
>>> But the strange thing is that I created a sample test code and
>>> compiled it with GCC. It worked fine when I chose O0 as the
>>> optimization level but it crashed when I chose other optimization
>>> levels.
>>>
>>> It did not crashed when I used SUN CC compiler no matter which
>>> optimization level I chose.
>>>
>>> Below please find my test code and Makefile. The code is very simple
>>> and the only thing I did is let it link to a library
>>> /usr/lib/64/libicuio.so.3.
>> This works for me on Linux, so I guess the problem is something to do
>> with Solaris, perhaps libicuio.so.3, whatever that is.
>>
>> Andrew.
>>



More information about the Gcc-help mailing list