PDA

View Full Version : Server losing connection to squeezebox & dying



Olaf Lenzmann
2004-01-30, 16:26
Hi there,

I'm running the current CVS sources of the server on an XP box using
ActiveState Perl 5.8. Several minutes after starting the server, the
squeezbox loses its connection. Usually, the server process dies within
an hour or so.

Trouble starts with server messages like

getpeername() on closed socket GEN35055 at C:/Perl/lib/IO/Socket.pm line
206.

Also observed some assertion failures as shown below. The squeezebox is
not being used when this happens. Any suggestions?

TIA


Olaf

======================

getpeername() on closed socket GEN35055 at C:/Perl/lib/IO/Socket.pm line
206. 2004-01-30 20:50:26.7575 Backtrace:

frame 0: Slim::Utils::Misc::assert (Slim/Networking/Slimproto.pm line
208)
frame 1: Slim::Networking::Slimproto::client_readable
(Slim/Networking/Select.pm line 70)
frame 2: Slim::Networking::Select::select (slimserver.pl line 399)
frame 3: main::idle (slimserver.pl line 341)
frame 4: main::main (slimserver.pl line 779)

Here's the problem. Slim/Networking/Slimproto.pm, line 208:

198 return;
199 }
200
201 $total_bytes_read += $bytes_read;
202
203 $inputbuffer{$s}.=$indata;
204 $bytes_remaining -= $bytes_read;
205
206 $::d_slimproto_v && msg ("Got $bytes_read bytes from
client, $bytes_remaining remaining\n");
207
208 assert ($bytes_remaining>=0);
209
210 if ($bytes_remaining == 0) {
211 if ($parser_state{$s} eq 'OP') {
212 assert(length($inputbuffer{$s}) == 4);
213 $parser_frametype{$s} =
$inputbuffer{$s};
214 $inputbuffer{$s} = '';
215 $parser_state{$s} = 'LENGTH';
216
217 $d::protocol && msg("got op: ".
$parser_frametype{$s}."\n");
218

2004-01-30 20:50:26.7575 Backtrace:

frame 0: Slim::Utils::Misc::assert (Slim/Networking/Slimproto.pm line
183)
frame 1: Slim::Networking::Slimproto::client_readable
(Slim/Networking/Select.pm line 70)
frame 2: Slim::Networking::Select::select (slimserver.pl line 399)
frame 3: main::idle (slimserver.pl line 341)
frame 4: main::main (slimserver.pl line 779)

Here's the problem. Slim/Networking/Slimproto.pm, line 183:

173 if ($parser_state{$s} eq 'OP') {
174 $bytes_remaining = 4 - length($inputbuffer{$s});
175 assert ($bytes_remaining <= 4);
176 } elsif ($parser_state{$s} eq 'LENGTH') {
177 $bytes_remaining = 4 - length($inputbuffer{$s});
178 assert ($bytes_remaining <= 4);
179 } else {
180 assert ($parser_state{$s} eq 'DATA');
181 $bytes_remaining = $parser_framelength{$s} -
length($inputbuffer{$s});
182 }
183 assert ($bytes_remaining > 0);
184
185 $::d_slimproto_v && msg("attempting to read
$bytes_remaining bytes\n");
186
187 my $indata;
188 my $bytes_read = $s->sysread($indata, $bytes_remaining);
189
190 if (!defined($bytes_read) || ($bytes_read == 0)) {
191 if ($total_bytes_read == 0) {
192 $::d_slimproto && msg("Slimproto
half-close from client: ".$ipport{$s}."\n");
193 slimproto_close($s);

Negative length at C:/Perl/lib/IO/Handle.pm line 432, <SRC> line 920.