X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: Yes, hits=5.3 required=5.0	tests=AWL,BAYES_00,RP_MATCHES_RCVD,SARE_SUB_ENC_UTF8,TW_YG
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Date: Fri, 26 Aug 2011 21:07:16 +0200
From: Adrian Batzill <downloaddaemon@batzill.com>
To: <cygwin@cygwin.com>
Subject: dlopen() differences on =?UTF-8?Q?CYGWIN=5FNT-=35=2E=31=20and=20C?= =?UTF-8?Q?YGWIN=5FNT-=36=2E=31?=
Message-ID: <18282a04f86670b716a4f9ca49f8df4a@batzill.com>
X-Sender: downloaddaemon@batzill.com
User-Agent: Roundcube Webmail/0.5.3
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hello everyone,
I have two equal cygwin installations (with respect to installed 
packages). One on Windows 7 and one on Windows XP.
I always used the Windows XP version for "porting" my application 
(which relies heavily on dlopen) to Windows.
However, I finally wanted to make the move to Windows 7 as my build 
bot. However, the same application - built on Windows 7 - does not seem 
to work any more.
With the first call to dlopen(), it simply crashes with no note, core 
dump or anything else and independent of the build type (debug/release).
The problem is, however, that as soon as it is started inside gdb or 
strace, it runs perfectly fine and dlopen()s all plugins correctly.
I tried to rebuild the scenario with a simple code-example but diddn't 
manage to reproduce the crash with that.
The Application is written in C++ as well as the plugins. Advanced 
datatypes and functions/methods are passed/called from both directions.
Because I simply don't know what the cause could be, I also don't know 
what information I should provide.
By the way: the application works fine on all kind of *NIXes (*BSD, 
Linux, Mac).
If you want to have a look at the code, the code for the plugins is 
located here: 
https://downloaddaemon.svn.sourceforge.net/svnroot/downloaddaemon . The 
dlopen() part is here: 
https://downloaddaemon.svn.sourceforge.net/svnroot/downloaddaemon/trunk/src/daemon/dl/plugin_container.cpp 
(dlopen() is called with an absolute path to the file, if it matters. 
Compilation completely depends on the --export-all-symbols and 
-out-implib functionality).

I hope someone can help me with that.
Thanks,
Adrian

Below is the ldd-output on both systems of the application:
Windows 7:
         ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll 
(0x777f0000)
         kernel32.dll => /cygdrive/c/Windows/system32/kernel32.dll 
(0x76100000)
         KERNELBASE.dll => /cygdrive/c/Windows/system32/KERNELBASE.dll 
(0x75a10000)
         cygboost_thread-mt-1_43.dll => 
/usr/bin/cygboost_thread-mt-1_43.dll (0x63cc0000)
         cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
         ADVAPI32.DLL => /cygdrive/c/Windows/system32/ADVAPI32.DLL 
(0x77750000)
         msvcrt.dll => /cygdrive/c/Windows/system32/msvcrt.dll 
(0x75cf0000)
         sechost.dll => /cygdrive/c/Windows/SYSTEM32/sechost.dll 
(0x76610000)
         RPCRT4.dll => /cygdrive/c/Windows/system32/RPCRT4.dll 
(0x77280000)
         cyggcc_s-1.dll => /usr/bin/cyggcc_s-1.dll (0x67f00000)
         cygstdc++-6.dll => /usr/bin/cygstdc++-6.dll (0x6c480000)
         cygcurl-4.dll => /usr/bin/cygcurl-4.dll (0x63d80000)
         cygcrypto-0.9.8.dll => /usr/bin/cygcrypto-0.9.8.dll 
(0x6ba40000)
         cygz.dll => /usr/bin/cygz.dll (0x692c0000)
         cygidn-11.dll => /usr/bin/cygidn-11.dll (0x6c200000)
         cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x674c0000)
         cygintl-8.dll => /usr/bin/cygintl-8.dll (0x6f5c0000)
         cygssh2-1.dll => /usr/bin/cygssh2-1.dll (0x69ec0000)
         cygssl-0.9.8.dll => /usr/bin/cygssl-0.9.8.dll (0x63400000)
         SspiCli.dll => /cygdrive/c/Windows/system32/SspiCli.dll 
(0x75870000)

Windows XP:
         ntdll.dll => /cygdrive/c/WINXP/system32/ntdll.dll (0x7c910000)
         kernel32.dll => /cygdrive/c/WINXP/system32/kernel32.dll 
(0x7c800000)
         cygboost_thread-mt-1_43.dll => 
/usr/bin/cygboost_thread-mt-1_43.dll (0x63cc0000)
         cygwin1.dll => /usr/bin/cygwin1.dll (0x61000000)
         ADVAPI32.DLL => /cygdrive/c/WINXP/system32/ADVAPI32.DLL 
(0x77da0000)
         RPCRT4.dll => /cygdrive/c/WINXP/system32/RPCRT4.dll 
(0x77e50000)
         Secur32.dll => /cygdrive/c/WINXP/system32/Secur32.dll 
(0x77fc0000)
         cyggcc_s-1.dll => /usr/bin/cyggcc_s-1.dll (0x67f00000)
         cygstdc++-6.dll => /usr/bin/cygstdc++-6.dll (0x6c480000)
         cygcurl-4.dll => /usr/bin/cygcurl-4.dll (0x63d80000)
         cygcrypto-0.9.8.dll => /usr/bin/cygcrypto-0.9.8.dll 
(0x6ba40000)
         cygz.dll => /usr/bin/cygz.dll (0x692c0000)
         cygidn-11.dll => /usr/bin/cygidn-11.dll (0x6c200000)
         cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x674c0000)
         cygintl-8.dll => /usr/bin/cygintl-8.dll (0x6f5c0000)
         cygssh2-1.dll => /usr/bin/cygssh2-1.dll (0x69ec0000)
         cygssl-0.9.8.dll => /usr/bin/cygssl-0.9.8.dll (0x63400000)


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

