public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/38920]  New: throwing ex. across dlls doesn't work.
@ 2009-01-20  2:50 pluto at agmk dot net
  2009-01-20  2:51 ` [Bug other/38920] " pluto at agmk dot net
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-20  2:50 UTC (permalink / raw)
  To: gcc-bugs

$ x86_64-mingw32-g++ -v
Reading specs from /usr/lib64/gcc/x86_64-mingw32/4.4.0/specs
Target: x86_64-mingw32
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64
--includedir=/usr/x86_64-mingw32/include --with-gnu-as --with-gnu-ld
--with-sysroot=/usr/x86_64-mingw32 --enable-shared --enable-threads=win32
--disable-sjlj-exceptions --enable-languages=c,c++ --enable-c99
--enable-long-long --enable-decimal-float=yes --enable-multilib
--enable-cmath --disable-nls --with-gnu-as --with-gnu-ld
--with-mangler-in-ld
--with-gxx-include-dir=/usr/x86_64-mingw32/include/c++/4.4.0
--disable-libstdcxx-pch --enable-__cxa_atexit --disable-libmudflap
--disable-libssp --with-pkgversion=PLD-Linux
--with-bugurl=http://bugs.pld-linux.org
--build=x86_64-pld-linux --host=x86_64-pld-linux --target=x86_64-mingw32
Thread model: win32
gcc version 4.4.0 20090116 (experimental) (PLD-Linux)



a simple testcase that throws an exception from test.dll
into main.exe causes an error:

d:\w64\main.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

afaics the test.dll exports all these typeinfos:

[Ordinal/Name Pointer] Table
        [   0] _Z9exceptionv
        [   1] _ZN2ExC1ERKSs
        [   2] _ZN2ExC2ERKSs
        [   3] _ZN2ExD0Ev
        [   4] _ZN2ExD1Ev
        [   5] _ZTI2Ex
        [   6] _ZTISt13runtime_error
        [   7] _ZTISt9exception
        [   8] _ZTS2Ex
        [   9] _ZTSSt13runtime_error
        [  10] _ZTSSt9exception
        [  11] _ZTV2Ex

but the main.exe import only one symbol from test.dll:

DLL Name: test.dll
        vma:  Hint/Ord Member-Name Bound-To
        13a70       0  _Z9exceptionv

DLL Name: libgcc_s_1.dll
        vma:  Hint/Ord Member-Name Bound-To
        135ac       1  _Unwind_DeleteException
        135c8       6  _Unwind_GetDataRelBase
        135e4       9  _Unwind_GetIPInfo
        135f8      10  _Unwind_GetLanguageSpecificData
        1361c      11  _Unwind_GetRegionStart
        13638      12  _Unwind_GetTextRelBase
        13654      13  _Unwind_RaiseException
        13670      14  _Unwind_Resume
        13684      15  _Unwind_Resume_or_Rethrow
        136a0      16  _Unwind_SetGR
        136b0      17  _Unwind_SetIP
        136c0      35  __deregister_frame_info
        136dc      83  __register_frame_info

full example attached.


-- 
           Summary: throwing ex. across dlls doesn't work.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: x86_64-mingw32


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] throwing ex. across dlls doesn't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
@ 2009-01-20  2:51 ` pluto at agmk dot net
  2009-01-20  6:08 ` dannysmith at users dot sourceforge dot net
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-20  2:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pluto at agmk dot net  2009-01-20 02:51 -------
Created an attachment (id=17149)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17149&action=view)
testcase


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] throwing ex. across dlls doesn't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
  2009-01-20  2:51 ` [Bug other/38920] " pluto at agmk dot net
@ 2009-01-20  6:08 ` dannysmith at users dot sourceforge dot net
  2009-01-20  8:42 ` pluto at agmk dot net
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2009-01-20  6:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dannysmith at users dot sourceforge dot net  2009-01-20 06:07 -------
libstdc++ also needs to be built and linked in as dll.

Search mingw archive lists for other examples and approaches.

Danny


-- 

dannysmith at users dot sourceforge dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dannysmith at users dot
                   |                            |sourceforge dot net
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-20 06:07:57
               date|                            |


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] throwing ex. across dlls doesn't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
  2009-01-20  2:51 ` [Bug other/38920] " pluto at agmk dot net
  2009-01-20  6:08 ` dannysmith at users dot sourceforge dot net
@ 2009-01-20  8:42 ` pluto at agmk dot net
  2009-01-25  9:57 ` pluto at agmk dot net
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-20  8:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pluto at agmk dot net  2009-01-20 08:41 -------
(In reply to comment #2)
> libstdc++ also needs to be built and linked in as dll.

i'm passing --enable-shared to gcc's configure but it only
creates shared libgcc_s_1.dll. libstdc++ is still static.
should i applay some magic patch on the top of 4.4 to get more dlls?

> Search mingw archive lists for other examples and approaches.

i've found two interest examples:

[Mingw-users] DW2 EH works "sometimes"
http://marc.info/?l=mingw-users&m=114984388106110&w=4

[Mingw-w64-public] SEH doesn't work on mingw-w64
http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg00150.html

the rest of googled threads are about patches already committed for 4.4.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] throwing ex. across dlls doesn't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (3 preceding siblings ...)
  2009-01-25  9:57 ` pluto at agmk dot net
@ 2009-01-25  9:57 ` pluto at agmk dot net
  2009-01-25 10:02 ` [Bug other/38920] dw2 exceptions don't work pluto at agmk dot net
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-25  9:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pluto at agmk dot net  2009-01-25 09:57 -------
Created an attachment (id=17180)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17180&action=view)
testcase


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] throwing ex. across dlls doesn't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (2 preceding siblings ...)
  2009-01-20  8:42 ` pluto at agmk dot net
@ 2009-01-25  9:57 ` pluto at agmk dot net
  2009-01-25  9:57 ` pluto at agmk dot net
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-25  9:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pluto at agmk dot net  2009-01-25 09:57 -------
adding try{throw 0;}catch(...){} to main() shows that dw2-exceptions
don't work at all, so it's not related to dll crossing.
new testcase attached.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (4 preceding siblings ...)
  2009-01-25  9:57 ` pluto at agmk dot net
@ 2009-01-25 10:02 ` pluto at agmk dot net
  2009-01-26  3:30 ` dannysmith at users dot sourceforge dot net
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-25 10:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pluto at agmk dot net  2009-01-25 10:02 -------
maybe this bug is related to PR38952.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (5 preceding siblings ...)
  2009-01-25 10:02 ` [Bug other/38920] dw2 exceptions don't work pluto at agmk dot net
@ 2009-01-26  3:30 ` dannysmith at users dot sourceforge dot net
  2009-01-26 19:31 ` pluto at agmk dot net
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: dannysmith at users dot sourceforge dot net @ 2009-01-26  3:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dannysmith at users dot sourceforge dot net  2009-01-26 03:30 -------
AFAICT DW2 unwind has never worked on x86_64-mingw32, which is why Kai made
sjlj the default EH model for that target.
http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00273.html


-- 

dannysmith at users dot sourceforge dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (6 preceding siblings ...)
  2009-01-26  3:30 ` dannysmith at users dot sourceforge dot net
@ 2009-01-26 19:31 ` pluto at agmk dot net
  2009-04-07  7:25 ` janus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pluto at agmk dot net @ 2009-01-26 19:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pluto at agmk dot net  2009-01-26 19:31 -------
(In reply to comment #7)
> AFAICT DW2 unwind has never worked on x86_64-mingw32, which is why Kai made
> sjlj the default EH model for that target.
> http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00273.html

ok, with sjlj and shared libgcc exceptions seem to work across dlls.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (7 preceding siblings ...)
  2009-01-26 19:31 ` pluto at agmk dot net
@ 2009-04-07  7:25 ` janus at gcc dot gnu dot org
  2009-04-07  7:35 ` janus at gcc dot gnu dot org
  2009-08-30  8:33 ` ktietz at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07  7:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from janus at gcc dot gnu dot org  2009-04-07 07:25 -------
Subject: Bug 38920

Author: janus
Date: Tue Apr  7 07:24:37 2009
New Revision: 145651

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145651
Log:
2009-04-07  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38920
        * expr.c (gfc_check_pointer_assign): Enable interface check for
        procedure pointers.
        * gfortran.h: Add copy_formal_args_intr.
        * interface.c (gfc_compare_interfaces): Call
gfc_compare_intr_interfaces
        if second argument is an intrinsic.
        (compare_intr_interfaces): Correctly set attr.function, attr.subroutine
        and ts.
        (compare_parameter): Call gfc_compare_interfaces also for intrinsics.
        * resolve.c (resolve_specific_f0,resolve_specific_s0): Don't resolve
        intrinsic interfaces here. Must happen earlier.
        (resolve_symbol): Resolution of intrinsic interfaces moved here from
        resolve_specific_..., and formal args are now copied from intrinsic
        interfaces.
        * symbol.c (copy_formal_args_intr): New function to copy the formal
        arguments from an intinsic procedure.


2009-04-07  Janus Weil  <janus@gcc.gnu.org>

        PR fortran/38920
        * gfortran.dg/proc_decl_1.f90: Modified.
        * gfortran.dg/proc_ptr_11.f90: Extended.
        * gfortran.dg/proc_ptr_13.f90: Modified.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/expr.c
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/interface.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/symbol.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/proc_decl_1.f90
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_11.f90
    trunk/gcc/testsuite/gfortran.dg/proc_ptr_13.f90


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (8 preceding siblings ...)
  2009-04-07  7:25 ` janus at gcc dot gnu dot org
@ 2009-04-07  7:35 ` janus at gcc dot gnu dot org
  2009-08-30  8:33 ` ktietz at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: janus at gcc dot gnu dot org @ 2009-04-07  7:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from janus at gcc dot gnu dot org  2009-04-07 07:34 -------
Oops. The commit in comment #9 was actually for PR38290, but I accidentally
messed up the PR number in the ChangeLog. Sorry for the noise.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
  2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
                   ` (9 preceding siblings ...)
  2009-04-07  7:35 ` janus at gcc dot gnu dot org
@ 2009-08-30  8:33 ` ktietz at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu dot org @ 2009-08-30  8:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from ktietz at gcc dot gnu dot org  2009-08-30 08:33 -------
(In reply to comment #8)
> (In reply to comment #7)
> > AFAICT DW2 unwind has never worked on x86_64-mingw32, which is why Kai made
> > sjlj the default EH model for that target.
> > http://gcc.gnu.org/ml/gcc-patches/2007-12/msg00273.html
> 
> ok, with sjlj and shared libgcc exceptions seem to work across dlls.
> 

This is right, that dw2 exception handling doesn't work for x64. As the x86 is
absolutely incompatible to the x64 exception handling, there is the support of
SEH2 unwind-data to be added. I begun already with support on gas to generate
the pdata/xdata data by pseudo-opcodes. I plan to support this feature for
4.6.x (and maybe a 4.5.x). So for now, just sjlj exception handling is possible
for x64 windows.


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug other/38920] dw2 exceptions don't work.
       [not found] <bug-38920-4@http.gcc.gnu.org/bugzilla/>
@ 2010-10-02  8:51 ` ktietz at gcc dot gnu.org
  0 siblings, 0 replies; 13+ messages in thread
From: ktietz at gcc dot gnu.org @ 2010-10-02  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #12 from Kai Tietz <ktietz at gcc dot gnu.org> 2010-10-02 08:51:15 UTC ---
It isn't planned to support dw2 exception mechanism for x64 windows. So I close
this bug as won't be fixed


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-10-02  8:51 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-20  2:50 [Bug other/38920] New: throwing ex. across dlls doesn't work pluto at agmk dot net
2009-01-20  2:51 ` [Bug other/38920] " pluto at agmk dot net
2009-01-20  6:08 ` dannysmith at users dot sourceforge dot net
2009-01-20  8:42 ` pluto at agmk dot net
2009-01-25  9:57 ` pluto at agmk dot net
2009-01-25  9:57 ` pluto at agmk dot net
2009-01-25 10:02 ` [Bug other/38920] dw2 exceptions don't work pluto at agmk dot net
2009-01-26  3:30 ` dannysmith at users dot sourceforge dot net
2009-01-26 19:31 ` pluto at agmk dot net
2009-04-07  7:25 ` janus at gcc dot gnu dot org
2009-04-07  7:35 ` janus at gcc dot gnu dot org
2009-08-30  8:33 ` ktietz at gcc dot gnu dot org
     [not found] <bug-38920-4@http.gcc.gnu.org/bugzilla/>
2010-10-02  8:51 ` ktietz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).