Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • s.lang@gsi.deMarch 27, 2004 12:52 PM PST   
    Exception Handling Bug in ICC 8.0 ?

    I tried to run a program that uses C++ exceptions
    and was compiled using the Intel C++ Compiler 8.0 under
    Suse Linux (gcc 3.3.1). Using gcc, the program was working,
    but not using icc.

    The following happend: After an exception was thrown, the
    program was aborted with SIGABRT, because the related
    catch block was not found - therefore the exception handling
    failed and the default termination routine was finally called.

    It seams that to code is unable to unwind the stack correctly
    after __cxa_throw was called.
    After all the investigations and try-and-error games I found
    a workaround: Linking the program with "-static-libcxa" makes
    it running using icc, too. Additionally, I discovered that
    linking my program with "-static" even causes a segmentation
    violation.

    Below you'll find some details on the output.

    Does anyone made an experience like that, too?

    Greedings

    Simon



    Linking with "-static-libcxa", only:
    ------------------------------------

    ldd output:
    libc.so.6 => /lib/i686/libc.so.6 (0x40033000)
    libm.so.6 => /lib/i686/libm.so.6 (0x40166000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

    Stuff's working!


    Linking without setting "-static" and "-static-libcxa":
    -------------------------------------------------------

    ldd output:
    libc.so.6 => /lib/i686/libc.so.6 (0x40033000)
    libm.so.6 => /lib/i686/libm.so.6 (0x40166000)
    libcprts.so.5 => /opt/intel_cc_80/lib/libcprts.so.5 (0x40189000)
    libcxa.so.5 => /opt/intel_cc_80/lib/libcxa.so.5 (0x40207000)
    libunwind.so.5 => /opt/intel_cc_80/lib/libunwind.so.5 (0x4022e000)
    /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)


    Program received signal SIGABRT, Aborted.
    0x4005cb71 in kill () from /lib/i686/libc.so.6
    (gdb) bt
    #0 0x4005cb71 in kill () from /lib/i686/libc.so.6
    #1 0x4005c8f5 in raise () from /lib/i686/libc.so.6
    #2 0x4005de8c in abort () from /lib/i686/libc.so.6
    #3 0x40230605 in GetCurrentFrame32 () from /opt/intel_cc_80/lib/libunwind.so.5
    #4 0x4022fd77 in _Unwind_RaiseException () from /opt/intel_cc_80/lib/libunwind.so.5
    #5 0x4020fd2b in __cxa_throw () from /opt/intel_cc_80/lib/libcxa.so.5
    #6 0x08072ec1 in destr_detour113 ()
    #7 0x08074aac in TPasaIO::EvaluateConfigFiles() ()
    #8 0x0808a592 in TPasaTest::Run() ()
    #9 0x0808ac7f in main ()


    Linking with "-static" set:
    ---------------------------

    Program received signal SIGSEGV, Segmentation fault.
    0x08183935 in _sort_fde_list ()
    (gdb) bt
    #0 0x08183935 in _sort_fde_list ()
    #1 0x081838cb in _Unwind_Find_Fde ()
    #2 0x081832f8 in GetCurrentFrame32 ()
    #3 0x08182b88 in _Unwind_RaiseException ()
    #4 0x08181bfd in __cxa_throw ()
    #5 0x0806d6e1 in destr_detour113 ()
    #6 0x0806f2cc in TPasaIO::EvaluateConfigFiles() ()
    #7 0x08084db2 in TPasaTest::Run() ()
    #8 0x0808549f in main ()

    mjdomeikApril 7, 2004 4:07 PM PDT
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?

    Dear Simon,

    Sounds like a bug report is in order.  Can you file it through premier?

    Regards,

    Max

     



    zwei@fvc.comSeptember 7, 2004 6:49 PM PDT
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?



    mjdomeik wrote:

    Dear Simon,


    Sounds like a bug report is in order. Can you file it through premier?


    Regards,


    Max








    I have similar problem. Is this get resolved in latest patch?
    -zwei

    dstadler@ftisoft.atDecember 13, 2004 10:42 AM PST
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?

    I'm still seeing this with the latest ICC 8.1, any news on how else this can be solved than linking with static-cxa??

    TimP (Intel)December 13, 2004 11:48 AM PST
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?

    I don't see how setting -static-libcxa could be a general solution. It breaks some of our links by linking against exception handling before linking against libc, and by inserting conflicting -Bstatic and -Bdynamic flags, in the command passed to ld.

    In your case, does it happen the other way, with the ld command being broken when -static-libcxa is not given?

    Needless to say, writing your own ld commands has limitations. Among them is the good chance of breaking when the compiler is upgraded. Still, it has a possibility for demonstrating where a bug is present.

    Is exception handling truly supported by icc, or is it reserved to icpc?

    dstadler@ftisoft.atDecember 13, 2004 11:57 AM PST
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?

    Some further tests seem to indicate for me that also setting -static-cxa does not fix this. I still get aborts when using -static-cxa and also when not using -static-cxa.

    And I'm not writing my own ld-command, I'm using icc for linking.

    I will try icpc, but I don't think it will have much difference.

    dstadler@ftisoft.atDecember 13, 2004 2:06 PM PST
    Rate
     
    Re: Exception Handling Bug in ICC 8.0 ?

    One more update: for me it seems to be caused by not specifying -cxxlib-icc consistently for compiling and linking steps. After I adjusted compile-flags to always specify -cxxlib-icc for both compiling and linking it seems to work better.

    I will run now some more tests to make sure this was really the problem for me.

Forum jump:  

Intel Software Network Forums Statistics

16,371 users have contributed to 46,346 threads and 163,988 posts to date.

In the past 24 hours, we have 15 new thread(s) 83 new posts(s), and 61 new user(s).

In the past 3 days, the most popular thread for everyone has been Formula for the intersection of straight lines The most posts were made to Take a look at John Burkhard&# The post with the most views is \"-check none\" generates error

Please welcome our newest member claudepi


For more complete information about compiler optimizations, see our Optimization Notice.