Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Crypt::OpenSSL::RSA & Java

by DanEllison (Scribe)
on Jan 27, 2011 at 13:44 UTC ( [id://884553]=perlquestion: print w/replies, xml ) Need Help??

DanEllison has asked for the wisdom of the Perl Monks concerning the following question:

I'm developing using Eclipse IDE with the EPIC plug-in for Perl. Suddenly, a script that was working will no longer validate and when run produces the following error:

Can't load 'C:/Perl/site/lib/auto/Crypt/OpenSSL/RSA/RSA.dll' for modul +e Crypt::OpenSSL::RSA: load_file:The operating system cannot run %1 a +t C:/Perl/lib/DynaLoader.pm line 201. at H:/Eclipse/ParameterSet/Test2.pl line 3 Compilation failed in require at H:/Eclipse/ParameterSet/Test2.pl line + 3. BEGIN failed--compilation aborted at H:/Eclipse/ParameterSet/Test2.pl +line 3.

My script simply begins:

use strict; use Crypt::OpenSSL::Random; use Crypt::OpenSSL::RSA; my $keyfile = "$ENV{HOME}/.ssh/id_rsa";

Obviously, I don't get past the 3rd line. At first I thought it might be an Eclipse thing, but as I write this I realize running from the command line produces the same result, but with a pop up that says:

The ordinal 3654 could not be located in the dynamic link library LIBEAY32.dll.

I figure it must be something that was installed recentlyh on my machine that has a clobbering dll. I've moved Perl to the front of my path with no success. I've uninstalled and reinstalled Crypt::OpenSSL::RSA with no impact. Argh!

Replies are listed 'Best First'.
Re: Crypt::OpenSSL::RSA & Java
by dHarry (Abbot) on Jan 27, 2011 at 14:49 UTC

    I don't think this has anything to do with Eclipse/Epic. My guess is you installed something on your PC that installed an older version of the DLL(s). There are several approaches to fix this. I think the simplest(?) is to put your script and all DLL(s) it uses in the same directory. Also, there are tools available to find out exactly what processes (if any) are loading the DLL if you want to investigate. It might even turn out that no other process uses the DLL, i.e. only installed! Did I say DLL-Hell:)

    Cheers,

    Harry

      listdlls/psexplorer only list loaded dlls, it won't load random dlls and tell you what other dlls it wants :)(unless you know something I don't)

        This is my understanding as well, i.e. it won't load random dlls and tell you what other dlls it wants (would be nice;). Still I think the Process Explorer is a useful start to find out what is going on.

        Harry

Re: Crypt::OpenSSL::RSA & Java
by Anonymous Monk on Jan 27, 2011 at 14:49 UTC
    Suddenly, a script that was working will no longer validate and when run produces the following error:

    What does validate mean?

    : The ordinal 3654 could not be located in the dynamic link library LIBEAY32.dll. I figure it must be something that was installed recentlyh on my machine that has a clobbering dll. I've moved Perl to the front of my path with no success. I've uninstalled and reinstalled Crypt::OpenSSL::RSA with no impact. Argh!

    Well, maybe you have two perls? Maybe Eclipse modifies the path? Maybe you simply have the wrong version of LIBEAY32.dll?

    Check %ENV/@INC from within Eclipse, check the dll versions using objdump/dumpbin/dependencywalker

Re: Crypt::OpenSSL::RSA & Java
by cdarke (Prior) on Jan 27, 2011 at 15:11 UTC
    See this from ActiveState, it might give you some clues.

    Please note that code loading is relatively complex on Windows compared to UNIX. The PATH environment variable is the last thing looked at. The exact list of places varies depending on how the module is loaded, but generally it looks in the same directory as the caller was loaded from first, then in various other places before %PATH%.

      Unfortunately, this libeay32.ddl is all over the place, including a number of places a Windows search doesn't want to show me. And, I have no idea which one to use or not to use as none seemed to have arrived with the perl module that is using it.

      I didn't find the dll in any of the special locations like system32 that I have been warned about. However, I did find one in the MKS Toolkit which is always a big red flag to me. The network administrators use this crap all the time and update it whenever they like, and it seems to continually get in the way of my stuff. I moved MKS Toolkit to the end of the path, and everything seems to be working again. Maybe I broke something of their's and won't be able to log in tomorrow, but at least I'll be able to do something useful today.

Re: Crypt::OpenSSL::RSA & Java
by sundialsvc4 (Abbot) on Jan 27, 2011 at 15:12 UTC

    The “path” that is used for command-line resolution does not affect the search path that is used for dynamic libraries in Windows.

    The LoadLibrary API-call is described here:   http://msdn.microsoft.com/en-us/library/ms684175%28v=vs.85%29.aspx.

    There is a “safe library search order” feature now in Windows, as described in the article Dynamic-Link Library Search Order:   http://msdn.microsoft.com/en-us/library/ms682586%28v=vs.85%29.aspx.   (Yep, Microsoft is still trying to put a (ahem...) on its fundamentally poor original design ...)

    It is also remotely possible that the installed version of this DLL has been retro-graded by the recent install.   A thorough search of the C: drive for all occurrences of this filename may be required.   (The “modification date” of that file may or may not be useful.)

    Perhaps one of these resources will help to resolve the problem.   Please let us know.

      The “path” that is used for command-line resolution does not affect the search path that is used for dynamic libraries in Windows.

      As I understand Dynamic-Link Library Search Order, it does:

      (...)
      6. The directories that are listed in the PATH environment variable. (...)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://884553]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found