Bugzilla – Bug 4213
Slimserver can crash due to display being deleted from client object at forget time
Last modified: 2008-12-18 11:12:53 UTC
Issue is believed to occur because Slim::Display::Display::forgetClient is called at forgetClient time and removes the display from the client object. Although forgetClient removes the client from the client hash, it does not remove references to it from Slimproto.pm and does not close slimproto sockets. Hence it is possible for subsequent slimproto traffic to cause client methods to be called. If these relate to the display the server is likely to crash as $client->display is undef. Short term fix is to avoid setting $client->display to undef at forgetClient time. Will add this to 6.5 and trunk. Long term need to consider actively closing slimproto sockets and deleting state within forgetClient?
Short term fix added to 6.5 and trunk [10018 & 100019]
Dan, what target would you like me to set this for?
Adrian - is there a better fix for this? Or is this what's going into 6.5.1? Thanks
I think its fine as is for 6.5.1 as it should not crash now due to $client->display undef issues. I believe the root cause is that $client->forgetClient does not completely forget the client. In particular it does not clear out any slimproto state. Slimproto relies on timeouts or errors from select to clear up state, prior to this it can cause client methods to be called on clients which have already been forgotten. So at present if forgetClient removes state, there is a risk that subsequent slimproto packets could cause unexpected effects. The crash due to $client->display undef being the one we noticed! So for 7.0 I think we need forgetClient to really forget the client. However fixing for 6.5 is probably a bit risky as Andy and I spent too long messing with slimproto already and any changes need thinking though to avoid side effects. ccing Andy as he probably has a view.
Ok - retargetting for 7.0 and assigning to Andy for now.
This is fixed now right? forgetClient really forgets everything about the player.
I think comment #4 still holds, the client object is not destroyed until Slimproto.pm removes it it from %sock2client. It not broken at present so proabaly leave it, but I'm unconvinced that it removes the client when we think and so there is still the possibility to receive and process slimproto updates after we think the client is forgotten.
OK we definitely have a memory leak here, client objects are never destroyed until the server shuts down. Going to be tough to track down...
Got it! Change 14472.
This bug is being closed since it was resolved for a version which is now released! Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html If you are still seeing this bug, please re-open it and we will consider it for a future release.