Matthias wrote:
I deleted all ssl-related DLLs on my system now.

When I compile OpenSSL as described in INSTALL.W32, point the include library directory of my example program on "openssl\out32dll", recompile my example program, copy the 2 DLLs from "openssl\out32dll" to my example project directory... ...then my example program will succeed when I run it in Release Mode but will crash when I run it in Debug Mode.

When I compile OpenSSL as described in INSTALLW32 with that tweak (*),
point the library include directory on "openssl\out32dll.dbg", recompile my example program, copy the 2 DLLs from openssl\out32.dbg" to my example project directory...
...then my example program will crash when I run it in Release Mode
but will succeed when I run it in Debug Mode (so just vice versa).

(*) tweak in file "ms\do_masm.bat":
perl util\mk1mf.pl debug VC-WIN32 >ms\nt.mak
perl util\mk1mf.pl debug dll VC-WIN32 >ms\ntdll.mak

Surprisingly the DLLs have exactly the same size, no matter whether
compiled with that tweak or not. They are binary different though.

This is not a surprise.  Debug symbols land in a seperate file, but the
segment alignment means that minor changes to the compile process generally
create identically sized files.

libeay32.dll: 1.220.608 Bytes
ssleay32.dll:   249.856 Bytes

Despite many "*.pdb" files in the "openssl\out32dll.dbg" directory
I am unfortunately not able to produce a "more nice" call stack :(

You are looking for the result from the linker, probably libssl32.pdb
and libeay32.pdb, which you should move *WITH* the actual .dll files to
their final location.

So, result is that I have to use the LIBs and DLLs from "out32dll"
when compiling and running in Release mode and the LIBs and DLLs
from "out32dll.dbg" when compiling and running in Debug Mode.
In any other mixture it simply crashes. But at least it doesn't
just halt/loop anymore.

One most confusing thing is that MS actually has two -different- pdb
files.  One is a source program database, one is an executable program
database.  You want to locate the one with a name matching your .dll
files into the same location as the .dll that your application loads.
You also want to ensure that /ZI or /Zi is used to compile your app,
and /debug given to linking your app, so that you can unwind the stack
from the library into your app.  Finally, it also helps to turn off
optimization (/Od to the compiler) to make stacks more readable, and
I personally throw out the /Oy flag (/Oy- to force this) no matter what.
That flag causes the compiler not to build neat stack frames out of some
twisted desire for efficiency.  Even my release builds are /Zi /O2 /Oy-
to get all the optimizations but with stack frames and .pdb results,
and then linked with /debug /opt:ref.

Bill
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to