Bugzilla – Bug 2736
Divide by zero in Squeezebox.pm
Last modified: 2008-09-15 14:37:04 UTC
In the latest nightly for 6.2.2. Slimserver crashes and windows event log says: Illegal division by zero in .../Slim/Player/Squeezebox.pm line 763. The environment is SB1s and SB3s (one of each). I've renamed the 2 players to SB1 and SB3 for convenience in typing blind into the CLI. If you set pitch to 90 for each player in the CLI. Then queue a song to the SB1. That works. Then queue a song to the SB3. That crashes the server. I believe this is because of these lines in Squeezebox2.pm sub maxPitch {0} sub minPitch {0} There are similar min and max bass and treble stubs. I believe these stubs are unneeded because they'll be stubbed (correctly as it turns out) in Client.pm for those cases where an individual client doesn't support a function. They should probably all go, because they are wrong (zero makes a lousy min and max, especially since the default, supplied in Player.pm, lies outside the range defined by min and max). But there seems to be more wrong. The server fails when I queue a song to the SB3. But it's the SB1 code, not the SB3 code, which divides by zero. Why is SB1 code being run in support of an SB3?
(In reply to comment #0) > But there seems to be more wrong. The server fails when I queue a song to the > SB3. I should have stopped here. The last 2 sentences are confused and confusing. The point is, the server fails calculating pitch for an SB3. Pitch isn't supported on an SB3, but the code tries to calculate it anyways. It's also true that it divides by zero doing so, because max and min are set to zero, but it shouldn't even try if pitch isn't a supported function.
This is related to bug 1305, only in so far as I started messing around in this area after looking over that bug in more detail.
This was fixed in 6.5: http://svn.slimdevices.com/trunk/server/Slim/Player/Squeezebox2.pm?rev=5181&r1=4978&r2=5181 same patch could be applied to 6.2.2
Please do.
well, hang on a sec: First off: sub maxPitch { 50 }; sub minPitch { 50 }; should read sub maxPitch { 100}; sub minPitch { 100 }; Secondly, are they needed at all? Aren't they already supplied correctly by client.pm?
Feel free to supply the path you feel is appropriate, and that works.
oh, I can actually answer that before you go back to try it out. Had to refresh my memory. The client module does cover this, but squeezebox2 is also a squeezebox, so would inherit at that level too. you are correct, pitch needs to be 100 (spot my cut'n'paste). will fix tonight.
fixed at change 5424, and 6.5 tweaked for pitch at change 5423. thanks for pointing that one out.
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.