王克驰 wrote: > I'm sorry I'm not that experienced in using GDB. I would appreciate > if you let me know what you plan to do with GDB. Thanks in advance. > > Here is the stack trace I got from the core dump with GDB. > > #0 0x00000000008a756d in ?? () > (gdb) bt > #0 0x00000000008a756d in ?? () > #1 0xfffffd7ffee02db0 in _Unwind_ForcedUnwind_Body () from > /usr/lib/64/libc.so.1 > #2 0xfffffd7ffee02eff in _Unwind_ForcedUnwind () from /usr/lib/64/libc.so.1 > #3 0xfffffd7ffd6b9642 in _ex_unwind () from > /home/jamewang/p2p_core/patch/119964-07/SUNWlibC/reloc/usr/lib/amd64/libCrun.so.1 > #4 0xfffffd7ffee026ac in _thrp_unwind () from /usr/lib/64/libc.so.1 > #5 0xfffffd7ffedfda7c in _thr_exit_common () from /usr/lib/64/libc.so.1 > #6 0xfffffd7ffedfdabe in thr_exit () from /usr/lib/64/libc.so.1 > #7 0xfffffd7ffde8fdae in CommandLoad::_doLoadTo (arg=<value optimized > out>) at CommandLoad.hh:103 [<<note: here call pthread_exit()] > #8 0xfffffd7ffee00edb in _thr_setup () from /usr/lib/64/libc.so.1 > #9 0xfffffd7ffee01110 in ?? () from /usr/lib/64/libc.so.1 > #10 0x0000000000000000 in ?? () The stack unwinder crashed at thread exit. That's the reason that C++ crashes and C doesn't: C doesn't have exceptions. So, you have some kind of incompatibility between gcc and your libraries. Andrew. > 2009/12/11 Andrew Haley <aph@xxxxxxxxxx>: >> 王克驰 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@xxxxxxxxxx>: >>>> 王克驰 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. >>>> >>