This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ app segfaults in libstdc++


On Thu, 17 Jun 2010 10:05 -0400, "Charles Wilson" wrote:
> On 6/17/2010 9:50 AM, Dave Korn wrote:
> >   To summarize the summary of the summary: C++ is complicated.
> 
> No kidding.  What if the datatypes used in the interface between the
> module and main -- including ALL exception classes -- were defined in a
> second DLL, on which both module and main depend?  Then module could be
> dynamically loaded (and unloaded), without any 'static' entanglments
> with main.
> 
> But...I'm not sure if that would fix the problem you described in your
> first reply, since module would have created the modexc instance, even
> if the class is defined in another DLL.  I'll give it a try later on.

As expected, this didn't work. But...the imports and exports are NOT
what I expected, so I'm a little confused:

shared-data-types.dll exports:
[Ordinal/Name Pointer] Table
        [   0] modexc::~modexc()
        [   1] modexc::~modexc()
        [   2] modexc::what() const
        [   3] typeinfo for modexc
        [   4] typeinfo name for modexc
        [   5] vtable for modexc
        [   6] shared_data_types_dummy

module.dll imports from shared-data-types:
        DLL Name: shared-data-types.dll
        vma:  Hint/Ord Member-Name Bound-To
        8228        5  vtable for modexc

module.dll exports:
[Ordinal/Name Pointer] Table
        [   0] modbar()
        [   1] modexc::modexc(modexc const&)
        [   2] modexc::modexc(std::basic_string<char,
        std::char_traits<char>, std::allocator<char> >)
        [   3] modexc::~modexc()
        [   4] modexc::what() const
        [   5] std::exception::exception(std::exception const&)
        [   6] std::exception::exception()
        [   7] typeinfo for modexc
        [   8] typeinfo name for modexc
        [   9] modfoo

Err, what? (a) why is this DLL exporting modexc stuff, when it is marked
dllimport in this context? (b) why is this DLL exporting std::exception
stuff?

And then, main imports from shared-data-types.dll (it has no imports
from module.dll, obviously):
        DLL Name: shared-data-types.dll
        vma:  Hint/Ord Member-Name Bound-To
        7228        5  vtable for modexc


If I put a dummy instantiation of modexc in shared-data-types.cpp, then
the exports from that DLL are slightly more extensive, but this has no
effect on the imports of the other dll/exe.

binutils             2.20.51-2
cygwin               1.7.5-1
gcc4-g++             4.3.4-3

I'm wondering if some of the 4.4.x and 4.5.x changes having to do with
how entities are labeled fix these issues; e.g. I'm looking at a
compiler "bug" in addition to the other problems you've mentioned?

--
Chuck



Attachment: libtool-segfault-stc2.tar.bz2
Description: Binary data

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]