Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: PAR::Packer - 'dll not found' error on run

by almut (Canon)
on Aug 20, 2007 at 21:31 UTC ( [id://633946]=note: print w/replies, xml ) Need Help??


in reply to Re^2: PAR::Packer - 'dll not found' error on run
in thread PAR::Packer - 'dll not found' error on run

Just in case the link posted by the AnonyMonk doesn't suffice to solve the issue, I'll elaborate a bit:  Net::SSLeay makes use of AutoSplit and AutoLoader, i.e. most subroutines of the module are kept in separate .al files, which are then loaded on demand. In other words, when IO::Socket::SSL is calling Net::SSLeay::randomize(), the randomize.al file is being loaded. This is done via the AutoLoader::AUTOLOAD routine. OTOH, many XS modules provide a facility to load C constants defined in the related header files. As this is also done using AUTOLOAD, both mechanisms need to peacefully cooperate. This is usually achieved by first trying to load a constant of the requested name, and in case that fails (as is the case with "randomize" here), pass the autoload request on to AutoLoader::AUTOLOAD. To indicate to the caller that the loading of a constant failed, the constant() routine in the XS code sets errno = EINVAL (which, in stringified form, typically is "Invalid argument").

Apparently, the target system where you're trying to deploy your PAR package is showing some weird behaviour with respect to EINVAL, so the autoload request isn't being passed through to the AutoLoader... (btw, even if the test for "Invalid" etc. fails, the || $!{EINVAL} should still normally be true — %! is a tied hash from Errno).

The code below is the related AUTOLOAD routine from Net/SSLeay.pm. To figure out what's happening, insert the lines between the "###" (of course, make that modification before creating the PAR package). Then, once you know what EINVAL actually is on the target system, modify the next line (the one with $!{EINVAL}) to match whatever you're getting... (or post here what you're getting).

# package Net::SSLeay; # ... sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant( +) # XS function. If a constant is not found then control is passed # to the AUTOLOAD in AutoLoader. my $constname; ($constname = $AUTOLOAD) =~ s/.*:://; my $val = constant($constname); if ($! != 0) { ### debug if ($constname =~ /randomize/) { printf "errno: #%d ('%s') %s expected value (#%d)\n", $!, $!, $!{EINVAL} ? "matches":"doesn't match", Err +no::EINVAL; } ### if ($! =~ /((Invalid)|(not valid))/i || $!{EINVAL}) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } else { croak "Your vendor has not defined SSLeay macro $constname +"; } } eval "sub $AUTOLOAD { $val }"; goto &$AUTOLOAD; }

Replies are listed 'Best First'.
Re^4: PAR::Packer - 'dll not found' error on run
by ethrbunny (Monk) on Aug 21, 2007 at 14:11 UTC
    Thank you for your help on this matter. I fear that I am in deep waters here.

    The error message from your suggested 'debug' insert is as follows:

    errno: #9 ('Bad file descriptor') doesn't match expected value (#22)

    At one point I had working code that used this module. I must have (unknowingly) bolluxed it with a subsequent install.

    EDIT: it appears to be looking for a file called "auto/Net/SSLeay/OP_ALL.al". Im trying to track this down.

    EDIT: didn't find any trace of "OP_ALL.al". Strangely enough I did find 'randomize.al'... so something isn't setup properly on my box.

      Just two things to note: the errno 9 ('Bad file descriptor') is probably being carried over from some other previous system error, though this should - in theory - not happen, as the XS code behind the constant routine is setting errno = 0 before doing anything else...  Another strange thing is that the OP_ALL is clearly one of the constants I was talking about — which means it should definitely not be treated as an autoload routine.

      So, as it looks, your DLL is implementing some weird inverse logic ;) Are you sure you've got the right one? (One could hypothesize that in case you've got the wrong DLL, and it doesn't know about the constants it's supposed to handle... in combination with the communication via errno generally not working... the constant lookup might eventually turn into some bogus OP_ALL.al autoload attempt... But why would such a DLL pass version checks etc. and be loaded at all??) Hmm, maybe you should try to replace that SSLeay.dll with a fresh one from a new and clean installation.   Other than that, I haven't got the foggiest what's going on on that machine...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found