X-Spam-Check-By: sourceware.org Message-ID: <20060323140259.33016.qmail@web53004.mail.yahoo.com> Date: Thu, 23 Mar 2006 06:02:59 -0800 (PST) From: Gary Zablackis Subject: Re: dlopen() bug To: skaller , Bernhard Loos Cc: cygwin AT cygwin DOT com In-Reply-To: <1143006348.9731.127.camel@rosella.wigram> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --- skaller wrote: > 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. > Who forbad it? A dll is just code which can be called from any language as long as the interface rules are followed by compilers, linkers and coders. Anyway, the problem illustrated by the test case occurs when a dll linked with -lstdc++ is dynamically linked (via dlopen()) by a program which has not previously initialized the standard library io functions. Running the testcase in gdb or with debugging print statements added to cygwin1.dll shows this clearly. Also, the problem persists if ct.c is changed to ct.cc and g++ is used throughout in the build. I have built debug versions of both cygwin1.dll and libstdc++. I hope to have some time this weekend to finally look into this problem more deeply. Gary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- 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/