coldguy has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to build Crypt::SSLeay 0.51 on Windows. Everything compiles fine but the tests crash horribly. I'm using MSVC 7 (from the full Visual Studio 2003), along with a Perl 5.8.8 and an OpenSSL 0.9.8b that I built myself.
UPDATE: Solution inside, check randyk's comment below for details. The XS code is suffering from a touch of bitrot and needs a one line patch.
First off, I'm not using ActiveState's Perl because my eventual objective is to build Apache 2.0.x and mod_perl for it from source, and I'd like everything to be built with the same compiler. Is that a good reason or am I just being superstitious? ActivePerl's perl -V reports an earlier ccversion than the one I built myself, and I don't have any earlier versions of MSVC available.
I built Perl 5.8.8 using the C compiler that comes with Visual Studio 2003 (v7 I think). Perl built fine and passed all the tests it didn't skip. Output of `perl -V` is attached below.
I built OpenSSL 0.9.8b using the same compiler. It also built fine, and it also passed all its tests.
I downloaded Crypt::SSLeay 0.51 from CPAN. After providing it with the path to my OpenSSL directory, it builds without error. However, when I try to run the tests (with "nmake test"), it crashes with what appears to be the Windows equivalent of a segmentation fault (I'm really more of a Linux guy). Here's the exact error message I get:
The instruction at "0x01d977b7" referenced memory at "0x000000a4". Th +e memory could not be "read".
Windows helpfully gave me the option to fire up the debugger at this point, so I did. It appears that the crash is occurring at the call to SSL_ctx_default_verify_paths in SSL_ctx_new in SSLeay.xs. I don't know enough about C, Windows, or the internals of Perl to debug any further. I pushed the code around a bit but didn't get anywhere. From what I do know, it looks to me like some pointer variable is being improperly initialized to 0 somewhere, but that's just wild conjecture on my part. My theory is that something has changed in Perl or in OpenSSL that breaks the XS code...
Here is the output of perl -V:
Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=MSWin32, osvers=5.0, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef usethreads=define use5005threads=undef useithreads=define usemulti +plicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D +_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPER +L_IMPLICIT_SYS -DUSE_ PERLIO -DPERL_MSVCRT_READFIX', optimize='-MD -Zi -DNDEBUG -O1', cppflags='-DWIN32' ccversion='13.10.3077', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -l +ibpath:"c:\Perl\lib\CORE" -machine:x86' libpth="C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\lib +" libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib + comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netap +i32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib + odbccp32.lib msvcrt.lib perllibs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool +.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib n +etapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib msvc +rt.lib libc=msvcrt.lib, so=dll, useshrplib=yes, libperl=perl58.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf - libpath:"c:\Perl\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PL_OP_SLAB_ALLOC USE_ITHREADS USE_LARGE_FILES USE_PERLIO Built under MSWin32 Compiled at Jun 7 2006 14:57:17 @INC: C:/Perl/lib C:/Perl/site/lib .
Here is what happens at the command line when I try to run the module's tests (aside from the Windows error that pops up in a dialog):
Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved. C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harn +ess(0, 'blib\lib', 'blib\arch')" t/*.t t/net_ssl........dubious Test returned status 5 (wstat 1280, 0x500) t/ssl_context....dubious Test returned status 5 (wstat 1280, 0x500) FAILED--2 test scripts could be run, alas--no output ever seen NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x5' Stop.
Any help would be greatly appreciated. Thanks for looking!
UPDATE: Net::SSLeay builds without errors on my machine and tests without crashing (there is one error about an "ssl read failed" and it seems to hang after finishing all the tests, but I think it's fine), so I don't think it's my Perl or my OpenSSL installation that's gone hairy. I'm not sure at this point if I'm even going to need Crypt::SSLeay, although I would still be happy to have it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Building Crypt::SSLeay on Win32
by syphilis (Archbishop) on Jun 08, 2006 at 08:49 UTC | |
by coldguy (Sexton) on Jun 08, 2006 at 17:38 UTC | |
|
Re: Building Crypt::SSLeay on Win32
by randyk (Parson) on Jun 09, 2006 at 00:14 UTC | |
by coldguy (Sexton) on Jun 09, 2006 at 18:14 UTC | |
by coldguy (Sexton) on Jun 09, 2006 at 06:40 UTC |