WithABeard has asked for the wisdom of the Perl Monks concerning the following question:
I am using Firefox::Marionette, and it works great (normally), but is now giving this error:
% perl -MFirefox::Marionette -e 'my $f=Firefox::Marionette->new()' Undefined address for Socket::pack_sockaddr_in at /Users/<user>/perl5/ +lib/perl5/Firefox/Marionette.pm line 7134.
The line in question is this one:
$sock_addr = Socket::pack_sockaddr_in( $port, Socket::inet_aton($host) );
So I'm guessing that Socket::inet_aton($host) is the culprit
metacpan.org/pod/Socket tells us that:
...If passed a hostname that cannot be resolved, returns undef.
From this I'll assume that the hostname cannot be resolved, but we're not even opening a url yet...
Testing Socket yields predictable results:
% perl -MSocket -e'defined (my $a=inet_aton("garbage")) or die"dead"; +print unpack "V", $a;' dead at -e line 1. % perl -MSocket -e'defined (my $a=inet_aton("127.0.0.1")) or die"dead" +; print unpack "V", $a;' 16777343
It seems to do its job when passed something sensible
I usually work from home, but today I went in to the office, and got the error.
Could this be caused by a change in the network?
I'll know later today if it works at home.
System details:
MacOS 14.5
Apple M2
perl ver. 5.34.2
I tried flushing cache with sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, but this made no difference
I also tried changing the perl version (using plenv), but then I have to install Firefox::Marionette for the new version, and surprise-surprise; installation fails with the same error :p
Is this the right way to flush DNS on MacOS 14.5?
How can I find out what is actually passed to inet_aton when it fails?
What else can I do to debug this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Undefined address for Socket::pack_sockaddr_in
by Corion (Patriarch) on Jun 20, 2024 at 11:45 UTC | |
by WithABeard (Beadle) on Jun 20, 2024 at 11:54 UTC |