Skip Menu |

This queue is for tickets about the Sphinx-Search CPAN distribution.

Report information
The Basics
Id: 57171
Status: resolved
Priority: 0/
Queue: Sphinx-Search

People
Owner: Nobody in particular
Requestors: mtmail-cpan [...] gmx.net
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.22
Fixed in: (no value)



Subject: warnings due to uninitalized values
We're seeing a couple of warning due to uninitalized values. Out of millions of queries the warnings are less than 100/day. All points to only three variables which are set in line 566 my ($status, $ver, $len ) = unpack("n2N", $header); In our local copy I added unless ( defined $status ){ $self->_Error("read failed: $!"); return 0; } It's just an annoyance. Thanks for creating and maintaining Sphinx::Search! 77 Use of uninitialized value $ver in right bitshift (>>) at ...//Sphinx/Search.pm line 607. 77 Use of uninitialized value $ver in numeric lt (<) at ...//Sphinx/Search.pm line 606. 77 Use of uninitialized value $ver in bitwise and (&) at ...//Sphinx/Search.pm line 607. 77 Use of uninitialized value $status in numeric ne (!=) at ...//Sphinx/Search.pm line 600. 77 Use of uninitialized value $status in numeric eq (==) at ...//Sphinx/Search.pm line 596. 77 Use of uninitialized value $status in numeric eq (==) at ...//Sphinx/Search.pm line 592. 77 Use of uninitialized value $status in numeric eq (==) at ...//Sphinx/Search.pm line 587. 77 Use of uninitialized value $len in numeric ne (!=) at ...//Sphinx/Search.pm line 579.
From: mtmail-cpan [...] gmx.net
patch file attached.
Subject: sphinx_search_less_warnings.patch
--- ./lib/Sphinx/Search.pm 2010-05-05 13:52:20.000000000 +0200 +++ ./lib/Sphinx/Search.pm 2010-05-05 13:53:47.000000000 +0200 @@ -565,6 +565,11 @@ }; my ($status, $ver, $len ) = unpack("n2N", $header); + if ( ! defined($len) ) { + $self->_Error("read failed: $!"); + return 0; + } + my $response = q{}; my $lasterror = q{}; my $lentotal = 0;
Thanks for the patch. I have included it in the latest dev release, 0.23_03. Regards, Jon Schutz CTO, YourAmigo Ltd 53 Gilbert St Adelaide SA 5000 Ph: +61 8 82119211 Fax: +61 8 8211 6356 http://www.youramigo.com http://notes.jschutz.net