Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  open_error -192 on erl_ddll:load_driver(crypto_drv)

Guest
Posted: Wed Sep 02, 2009 9:42 am Reply with quote
Guest
Hiya,

does anyone know why I might be getting a failure to load crypto_drv on a
specific Windows XP box? It appears to work fine in lots of other ones.

I have tracked it down to the call of erl_ddll:load_driver(LibDir,
crypto_drv) in crypto_server.erl, where the LibDir does contain the correct
path to the folder that contains crypto_drv.dll and my environment has the
PATH set correctly, so that libeay32.dll can be found.

If I try loading the driver manually (with the above erl_ddll:load_driver
function), I get the following error:
{error, {open_error, -192}}

Does anyone have any idea where to look what this actually means?

Thanks for any pointers,
Robby


Post received from mailinglist
mhenoch
Posted: Wed Sep 02, 2009 10:37 am Reply with quote
User Joined: 06 Nov 2008 Posts: 29
Robert Raschke <rtrlists@googlemail.com> writes:

> If I try loading the driver manually (with the above erl_ddll:load_driver
> function), I get the following error:
> {error, {open_error, -192}}
>
> Does anyone have any idea where to look what this actually means?

erl_ddll:format_error({open_error, -192}) would give a clearer message.
Note that 'due to peculiarities in the dynamic loading interfaces on
different platform, the returned string is only guaranteed to describe
the correct error if format_error/1 is called in the same instance of
the erlang virtual machine as the error appeared in (meaning the same
operating system process)'.

--
Magnus Henoch, magnus@erlang-consulting.com
Erlang Training and Consulting
http://www.erlang-consulting.com/

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Post received from mailinglist
View user's profile Send private message
Guest
Posted: Wed Sep 02, 2009 10:41 am Reply with quote
Guest
On Wed, Sep 2, 2009 at 11:35 AM, Magnus Henoch <magnus@erlang-consulting.com
> wrote:

> Robert Raschke <rtrlists@googlemail.com> writes:
>
> > If I try loading the driver manually (with the above erl_ddll:load_driver
> > function), I get the following error:
> > {error, {open_error, -192}}
> >
> > Does anyone have any idea where to look what this actually means?
>
> erl_ddll:format_error({open_error, -192}) would give a clearer message.
> Note that 'due to peculiarities in the dynamic loading interfaces on
> different platform, the returned string is only guaranteed to describe
> the correct error if format_error/1 is called in the same instance of
> the erlang virtual machine as the error appeared in (meaning the same
> operating system process)'.
>

Turns out this is a Windows specific error.

I have dug in the C sources and have found that the error codes returned
from the Windows LoadLibrary() call are returned as (-10 - Windows error
code). So that makes LoadLibrary() fail with 182 = ERROR_INVALID_ORDINAL .
And that in turn appears to mean that Windows couldn't load the DLL, which
is not at all helpful. At least it means it could read it, it just couldn't
do what it's meant to do with it.

Since the paths are all set up correctly, I can only assume that there is
some other underlying reason why a DLL cannot get loaded. Probably something
to do with versioning and "side by side".

Robby


Post received from mailinglist
Guest
Posted: Wed Sep 02, 2009 2:33 pm Reply with quote
Guest
On Wed, Sep 2, 2009 at 2:16 PM, Rob Charlton
<rob.charlton@savageminds.com>wrote:

> Hi,
>
> Googling for libeay32.dll and error 182 brings up quite a lot of hits -
> mostly related to an application picking up an older copy of the DLL
> somewhere on the machine. Seems to be fixable by juggling entries in the
> path around. Have you searched for other copies of libeay32.dll on the PC?
>
> Cheers
>
> Rob
>
>
Looks like we have a winner. It turns out that on that pesky machine, there
is an extemely old (2005) libeay32.dll in C:\WINDOWS\system32 . Because that
directory is the SystemDirectory and Windows looks for DLLs there first when
loading DLLs, and because it is loaded as a side-effect of loading the
crypt_drv.dll (i.e., not using an absolute path), that really old file ends
up as the libeay32.dll that gets loaded. Because it is so old, it does not
have all the necessary exported functions, and therefore triggers the
ERROR_INVALID_ORDINAL.

I wonder which really anti-social piece of SW thought it would be handy to
dump a DLL in the Windows system folder? Probably loads of apps that still
do this, aargh.

Thanks for the help,
Robby


Post received from mailinglist
Guest
Posted: Wed Sep 02, 2009 2:53 pm Reply with quote
Guest
Hi,

Googling for libeay32.dll and error 182 brings up quite a lot of hits -
mostly related to an application picking up an older copy of the DLL
somewhere on the machine. Seems to be fixable by juggling entries in the
path around. Have you searched for other copies of libeay32.dll on the PC?

Cheers

Rob

Robert Raschke wrote:
> Hiya,
>
> does anyone know why I might be getting a failure to load crypto_drv on a
> specific Windows XP box? It appears to work fine in lots of other ones.
>
> I have tracked it down to the call of erl_ddll:load_driver(LibDir,
> crypto_drv) in crypto_server.erl, where the LibDir does contain the correct
> path to the folder that contains crypto_drv.dll and my environment has the
> PATH set correctly, so that libeay32.dll can be found.
>
> If I try loading the driver manually (with the above erl_ddll:load_driver
> function), I get the following error:
> {error, {open_error, -192}}
>
> Does anyone have any idea where to look what this actually means?
>
> Thanks for any pointers,
> Robby
>
>


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Post received from mailinglist
wuji
Posted: Thu Sep 06, 2012 7:19 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
industry has sprung up to help save you from your your cheap designer *beep* your own gaffes: advice books, software, online tools and
web-monitoring/ web-scrubbing services aimed at helping to undo whatever it it replica designer bags for sale it is you regret having said or done.So pervasive is
desire to wipe their online slates clean, that the new new cheap replica *beep* new Batman movie imagines a program called Clean Slate that
exactly that.The Seattle Times, in an article about this phenomenon, phenomenon, replica designer *beep* phenomenon, says media consulting firm DIA/Kelsey estimates that $2.2 billion
be spent in 2012 on so-called reputation management tools, including including [h3]cheap polo shirts[/h3] including ones that heal self-inflicted wounds.The Times also cites some
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum