Bug 1523 - server crashes whenever web interface is loaded
: server crashes whenever web interface is loaded
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Sync
: unspecified
: All All
: P1 critical (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-05-11 10:47 UTC by Kevin Pearsall
Modified: 2008-09-15 14:37 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
fix when no client present (706 bytes, patch)
2005-05-11 11:20 UTC, KDF
Details | Diff
set playercount = 0 and leave if no client in Pages::playlist() (2.41 KB, patch)
2005-05-11 14:15 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Pearsall 2005-05-11 10:47:57 UTC
reproduced with 6.1 nightly from today (5/11?)

2005-05-11 10:39:24.8842 SlimServer done start...
2005-05-11 10:39:26.9532 Backtrace:

   frame 0: Slim::Utils::Misc::assert
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Player/Sync.pm
line 389)
   frame 1: Slim::Player::Sync::masterOrSelf
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Player/Source.pm
line 951)
   frame 2: Slim::Player::Source::playingSong
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Player/Source.pm
line 944)
   frame 3: Slim::Player::Source::playingSongIndex
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/Pages.pm
line 1230)
   frame 4: Slim::Web::Pages::playlist
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm
line 747)
   frame 5: Slim::Web::HTTP::generateHTTPResponse
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm
line 668)
   frame 6: Slim::Web::HTTP::processURL
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm
line 532)
   frame 7: Slim::Web::HTTP::processHTTP
(/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Networking/Select.pm
line 115)
   frame 8: Slim::Networking::Select::select (./slimserver.pl line 624)
   frame 9: main::idle (./slimserver.pl line 567)
   frame 10: main::main (./slimserver.pl line 1147)

Here's the problem.
/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Player/Sync.pm,
line 389:

379     # returns the master if it's a slave, otherwise returns undef
380     sub isSlave {
381             my $client = shift;
382             return undef unless $client;
383             return $client->master;
384     }
385
386     sub masterOrSelf {
387             my $client = shift;
388
389             assert($client);
390
391             return $client->master || $client;
392     }
393
394     sub isSynced {
395             my $client = shift;
396             return (scalar(@{$client->slaves}) || $client->master);
397     }
398
399     1;

Can't call method "master" on an undefined value at
/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Player/Sync.pm
line 391, <SRC> line 405.
2005-05-11 10:39:27.1720 Got to the END.
2005-05-11 10:39:27.1731 Got sigint.
2005-05-11 10:39:27.1740 SlimServer cleaning up.
Comment 1 KDF 2005-05-11 11:20:20 UTC
Created attachment 514 [details]
fix when no client present

this fixes the problem.  only occurs when no client is present.
Comment 2 KDF 2005-05-11 11:22:09 UTC
proabably should track down why the page wants to load playlists when there is
no client, however.

dan/michael, can you test and commit, since I cannot.
Comment 3 KDF 2005-05-11 12:50:24 UTC
committed to trunk at change 3157
committed to branch at change 3156

note to self: always try unplugging all clients for a test, just in case.
Comment 4 KDF 2005-05-11 14:14:25 UTC
I've had a better idea for this, but it needs more review (vs the quick fix to
get thigns working again)

Instead of leaving this trap around for others to fall into (and I know I've
done it now more than once, and I'm not the only one), lets follow what is done
in status() and return out immediately with minimal info when there is no
client.  This way, we dont have to keep checking for $client throughout playlist()

patch shortly..
Comment 5 KDF 2005-05-11 14:15:02 UTC
Created attachment 515 [details]
set playercount = 0 and leave if no client in Pages::playlist()
Comment 6 Michael Herger 2005-05-11 14:31:33 UTC
I don't have much to say - it's working for me (latest trunk). But I had to do the changes, the patch 
somehow didn't want to apply to the trunk.
Comment 7 KDF 2005-05-12 20:07:50 UTC
committed to trunk only at change 3168
Comment 8 Chris Owens 2006-06-16 14:39:48 UTC
There are 536 bugs in the database with targets of '---' that were fixed prior to new year 2006.  I am setting them to targets of 6.2.1 to keep them from showing up in my queries.