delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/22/17:07:56

X-Spam-Check-By: sourceware.org
Date: Wed, 22 Mar 2006 23:07:35 +0100
Message-Id: <457131340@web.de>
MIME-Version: 1.0
From: Bernhard Loos <bernloos AT web DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: dlopen() bug (new testcase)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k2MM7nGw023935

> -----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/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019