Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329

    Perl compilation error: $ipn

    Not sure where to post this, as I can't tell whether it's a general LMS issue, or specific to pCP, or possibly even caused by Paul-'s latest test version of sbpd-pigpio (which is the only change I've made recently).

    As of this morning, on rebooting pCP I've been getting quite a few instances where LMS fails to start. This is in the pcp_boot.log file:
    Code:
    Starting LMS, this can take some time..."my" variable $ipn masks earlier declaration in same scope at /usr/local/slimserver/CPAN/AnyEvent/Socket.pm line 465.
    Compilation failed in require at /usr/local/slimserver/lib/AnyEvent/DNS.pm line 1400.
    BEGIN failed--compilation aborted at /usr/local/slimserver/lib/AnyEvent/DNS.pm line 1400.
    Compilation failed in require at /usr/local/slimserver/Slim/Networking/Async/DNS.pm line 15.
    BEGIN failed--compilation aborted at /usr/local/slimserver/Slim/Networking/Async/DNS.pm line 15.
    Compilation failed in require at /usr/local/slimserver/Slim/Networking/Async.pm line 21.
    BEGIN failed--compilation aborted at /usr/local/slimserver/Slim/Networking/Async.pm line 21.
    Compilation failed in require at /usr/local/lib/perl5/5.28.0/base.pm line 137.
    	...propagated at /usr/local/lib/perl5/5.28.0/base.pm line 159.
    BEGIN failed--compilation aborted at /usr/local/slimserver/Slim/Networking/Async/HTTP.pm line 35.
    Compilation failed in require at /usr/local/slimserver/Slim/Player/ProtocolHandlers.pm line 17.
    BEGIN failed--compilation aborted at /usr/local/slimserver/Slim/Player/ProtocolHandlers.pm line 17.
    Compilation failed in require at /usr/local/slimserver/Slim/Music/Info.pm line 32.
    BEGIN failed--compilation aborted at /usr/local/slimserver/Slim/Music/Info.pm line 32.
    Compilation failed in require at /usr/local/slimserver/Slim/Utils/Misc.pm line 49.
    Compilation failed in require at /usr/local/slimserver/slimserver.pl line 229.
    BEGIN failed--compilation aborted at /usr/local/slimserver/slimserver.pl line 229.
    
    Slimserver is not Running
    Rebooting once or twice usually gets LMS to start. It doesn't seem to make any difference whether I try to start sbpd-pigpio as a [tweak], but that variable $ipn seems like it could be related to a pin number variable, hence my suspicions, but I have no idea whether/how variables used by sbpd-pigpio could interfere with perl compilation - seems unlikely.

    Have I corrupted something with a careless reboot perhaps? Touch wood, everything seems to be working fine now, so maybe not worth any further investigation, but I'm still curious what could cause the compilation to fail 'occasionally'.

    EDIT: Logitech Media Server Version: 7.9.2 - 1564003588 @ Wed Jul 24 23:53:50 CEST 2019, running under pCP6.0.0-b1 on a Raspberry Pi 4B 4GB.
    Last edited by chill; 2019-08-25 at 03:10.

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,819
    Could this be another bug introduced by 5.28

    https://github.com/Logitech/slimserv...9/lib/AnyEvent

    What changed between last successful boot and the failed boot ?
    Update LMS ?
    Update PCP ?

    edit:

    CPAN/Anyevent - hasn't been updated for over 10 years so maybe deprecated features of Perl have now become invalid over time.
    Last edited by bpa; 2019-08-25 at 05:11.

  3. #3
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,819
    Just to follow up
    Code:
    sub inet_aton {
       my ($name, $cb) = @_;
    
       if (my $ipn = &parse_ipv4) {
          $cb->($ipn);
       } elsif (my $ipn = &parse_ipv6) {
          $cb->($ipn);
       } elsif ($name eq "localhost") { # rfc2606 et al.
          $cb->(v127.0.0.1, v0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1);
       } else {
          require AnyEvent::DNS;
    .
    .
    The offending line in red hasn;t changed in latest version of AnyEvent::Socket.pm

    Why the "my $ipn" is executed twice is odd - perhaps an strange network error - could it be your network is network interface is not ready ?

  4. #4
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Thanks for looking into this bpa. I don't believe anything else has changed. Yesterday I did add another command to the start-up user commands 'tweaks' - a script that I wrote to control a fan via a GPIO pin - but the compilation error didn't seem to be improved by removal of that script.

    The pCP is currently connected wirelessly, to a mesh system that I added a few weeks back - apart from some initial teething troubles (as with ANY new piece of network equipment in my experience!) it's worked flawlessly. Signal strength seems good.

    If it happens again I'll save the entire boot log, to see if there's any clue about the network interface.

  5. #5
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Forgive me, I don't know the first thing about Perl, but given that a 'compiler' error is apparently being triggered at 'run time', I'm guessing that it's compiled on demand ('interpreted'?). In that case, would that suggest that this $ipn error is going to be triggered any time that red line is reached (i.e. when operating in an ipv6 environment), because it's a second declaration within the same scope?

  6. #6
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,819
    Quote Originally Posted by chill View Post
    Forgive me, I don't know the first thing about Perl, but given that a 'compiler' error is apparently being triggered at 'run time', I'm guessing that it's compiled on demand ('interpreted'?). In that case, would that suggest that this $ipn error is going to be triggered any time that red line is reached (i.e. when operating in an ipv6 environment), because it's a second declaration within the same scope?
    Good point.

    I think $ipn is in the same scope as they are with the same set of braces. Round bracket don't limit scope. That said my grasp on Perl scope is not 100%.

    LMS is mostly compiled before execution but Perl can evaluate expressions at compile time and also it is possible declarations will only happen if code succeeds - so things can be get blurred. If first ipv4 succeeds then the"elsif " ipv6 expression will never be evaluated and assignment never happen and so "my $ipn " never happen. My Perl is not 100%. I would run a code snippet to be definitive.

    You said, it sometime takes 2-3 goes to get going - this "feels" like something is not ready and since this code is network related - I'm guessing it is about network.
    Last edited by bpa; 2019-08-25 at 06:19.

  7. #7
    Senior Member chill's Avatar
    Join Date
    Mar 2007
    Posts
    1,329
    Quote Originally Posted by bpa View Post
    I'm guessing it is about network.
    That seems logical. I did try a few reboots to see if I could trigger the error again, but of course when you want it to happen it won't. I'll save the logs if it happens again.

  8. #8
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,311
    Quote Originally Posted by bpa View Post
    Just to follow up
    Code:
    sub inet_aton {
       my ($name, $cb) = @_;
    
       if (my $ipn = &parse_ipv4) {
          $cb->($ipn);
       } elsif (my $ipn = &parse_ipv6) {
          $cb->($ipn);
       } elsif ($name eq "localhost") { # rfc2606 et al.
          $cb->(v127.0.0.1, v0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1);
       } else {
          require AnyEvent::DNS;
    .
    .
    The offending line in red hasn;t changed in latest version of AnyEvent::Socket.pm

    Why the "my $ipn" is executed twice is odd - perhaps an strange network error - could it be your network is network interface is not ready ?
    I'd not even read this as being defined in the same scope... Both definitions are local to their if/else statement, aren't they?

    And why it sometimes would work, but not always I don't understand either.
    Michael

    http://www.herger.net/slim-plugins - Spotty, MusicArtistInfo

  9. #9
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    17,819
    This is now an itch that has to be scratched.

    This stackoverflow question seems identical to the situation and answer is clear. So perhaps AnyEvent Socket.pm which doesn't have "use strict" got included somehow into a module which is using "use strict" .

    https://stackoverflow.com/questions/...-if-elsif-tree

  10. #10
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,311

    Perl compilation error: $ipn

    > This stackoverflow question seems identical to the situation and answer
    > is clear. So perhaps AnyEvent Socket.pm which doesn't have "use strict"
    > got included somehow into a module which is using "use strict" .
    >
    > https://stackoverflow.com/questions/...-if-elsif-tree


    I learned something new today! Thanks for the research. Worst case we
    can patch that statement.

    --

    Michael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •