http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52579

             Bug #: 52579
           Summary: [4.8 regression] i386_w32_fallback_frame_state should
                    care ffi raw-closure stub function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jojel...@gmail.com
              Host: i686-pc-cygwin
            Target: i686-pc-mingw32
             Build: i686-pc-cygwin


when we use closure stub, there is also possibility that callee throws
exception.
but we don't have any dwarf2 handler to take care these closure stub, so unwind
fails with _urc_end_of_stack. resulting abort() called so far.
to fix this problem, i386_w32_fallback_frame_state need to return
_URC_NO_REASON at least.

(gdb) bt
#0  i386_w32_fallback_frame_state (fs=0x22f198, context=<optimized out>)
    at ./md-unwind-support.h:134
#1  uw_frame_state_for (context=context@entry=0x22f118, fs=fs@entry=0x22f198)
    at ../.././libgcc/unwind-dw2.c:1187
#2  0x6e9545d8 in _Unwind_RaiseException (exc=0x14f63a0)
    at ../.././libgcc/unwind.inc:99
#3  0x6968fec9 in _Jv_Throw (value=0x1a48d08)
    at ../.././libjava/exception.cc:123
#4  0x696a194e in _Jv_InterpMethod::run (retp=0x22f658, args=0x22f67c,
    meth=0x117d000) at ../.././libjava/interpret-run.cc:2695
#5  0x69ce4705 in ffi_closure_raw_SYSV () at ../.././libffi/src/x86/win32.S:777
#6  0x01910911 in ?? ()
#7  0x69ce43e8 in ffi_raw_call (cif=0x1af5d5c, fn=0x19108e0, rvalue=0x22f8bc,
    fake_avalue=0x22f724) at ../.././libffi/src/x86/ffi.c:828
#8  0x6969dc4e in _Jv_InterpMethod::run (retp=0x22fa24, args=0x22fa48,
    meth=0x12fab68) at ../.././libjava/interpret-run.cc:611
#9  0x69ce4705 in ffi_closure_raw_SYSV () at ../.././libffi/src/x86/win32.S:777
#10 0x019108a1 in ?? ()
#11 0x69ce43e8 in ffi_raw_call (cif=0x1af5d8c, fn=0x1910870, rvalue=0x22fc88,
    fake_avalue=0x22fae0) at ../.././libffi/src/x86/ffi.c:828
#12 0x6969dc4e in _Jv_InterpMethod::run (retp=0x22fdf0, args=0x22fe10,
    meth=0x1369000) at ../.././libjava/interpret-run.cc:611
#13 0x69ce4705 in ffi_closure_raw_SYSV () at ../.././libffi/src/x86/win32.S:777
---Type <return> to continue, or q <return> to quit---
#14 0x696bf782 in gnu::java::lang::MainThread::call_main (this=0xbf2de0)
    at ../.././libjava/gnu/java/lang/natMainThread.cc:54
#15 0x696fcd06 in gnu.java.lang.MainThread.run()void (this=@bf2de0)
    at D:/cygwin/tmp/gcc/libjava/gnu/java/lang/MainThread.java:106
#16 0x696ce642 in _Jv_ThreadRun (thread=0xbf2de0)
    at ../.././libjava/java/lang/natThread.cc:335
#17 0x69684074 in _Jv_RunMain (vm_args=0x0, klass=klass@entry=0x0,
    name=name@entry=0x403064 "org.eclipse.jdt.internal.compile"...,
    argc=argc@entry=0xb, argv=argv@entry=0x3d8b70, is_jar=is_jar@entry=0x0)
    at ../.././libjava/prims.cc:1795
#18 0x69684266 in _Jv_RunMain (klass=0x0,
    name=name@entry=0x403064 "org.eclipse.jdt.internal.compile"...,
    argc=argc@entry=0xb, argv=argv@entry=0x3d8b70, is_jar=is_jar@entry=0x0)
    at ../.././libjava/prims.cc:1820
#19 0x6968429f in JvRunMainName (
    name=0x403064 "org.eclipse.jdt.internal.compile"..., argc=0xb,
    argv=0x3d8b70) at ../.././libjava/prims.cc:1832
#20 0x00401d12 in ?? ()
#21 0x004010fd in ?? ()
#22 0x00000000 in ?? ()
(gdb) up
#1  uw_frame_state_for (context=context@entry=0x22f118, fs=fs@entry=0x22f198)
    at ../.././libgcc/unwind-dw2.c:1187
1187          return MD_FALLBACK_FRAME_STATE_FOR (context, fs);
(gdb) print context->ra
$21 = (void *) 0x1910911
(gdb) x/i context->ra
   0x1910911:   ret    $0x10
(gdb)

Reply via email to