> -----Ursprüngliche Nachricht-----
> Von: skaller <skaller<at>users<dot>sourceforge<dot>net>
> On Wed, 2006-03-22 at 03:35 +0100, Bernhard Loos wrote:
> 
> > If the C++library declares its calls as 'extern "C"' (as it is done in the 
> > example),
> > AFAIK there shouldn't be any problem.
> 
> Doesn't matter what you think you know -- it's not a permitted thing
> to do, you never know what implementors are going to change.

Cygwin itself is a C++-library and it works well with C-programs. There is also 
a C-binding for QT.

> Ouch. Hmm. But the code isn't doing anything!
> This does look weird -- my system is doing what you're doing 
> all the time. It was crashing badly for ages until someone pointed
> out there was a bug in libstdc++ handling string crossing 
> DLL boundaries. Since I fixed that the code works fine.
> 
> Perhaps you can try to build it, get Release Candidate 6
> from:

Where do you see any string in the testcase?

In fact it does something: it creates the static classes cin and cout and a few 
others.

I were able to extract the code causing the crash.
If the constructor of lala calls key_init_once(), it crashs just like the 
example with <iostream>
Otherwise it hangs.

It would be really nice, if somebody with some more knowlegde could take a look 
at this,
because I'm unable to debug the program. I get only some strange errormessages 
and no
backtrace.

This is a new CrashTest.cc, the other files remains the same:
#include <pthread.h>

pthread_key_t key;

void key_init()
{
  pthread_key_create(&key, 0);
}

void
key_init_once()
{
  static pthread_once_t once = PTHREAD_ONCE_INIT;
  pthread_once(&once, key_init);
}

class lala
{
        public:
                lala()
                {
//                        key_init();
                          key_init_once();
                }
};

lala la;

extern "C" __declspec(dllexport)
void test()
{
        return;
}

                 Bernhard
______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193


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

Reply via email to