Skip Menu |

This queue is for tickets about the Ganglia-Gmetric-XS CPAN distribution.

Report information
The Basics
Id: 75468
Status: resolved
Priority: 0/
Queue: Ganglia-Gmetric-XS

People
Owner: Nobody in particular
Requestors: m.sbrighi [...] cineca.it
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 0.01
  • 0.02
  • 1.00
  • 1.01
  • 1.02
  • 1.03
Fixed in: (no value)



Subject: semantic bug @line 25 in XS.pm
First of all thanks for your work. The code is effective and useful. I'm working with perl 5.8.8 (AIX 6.1 and Linux x86_64) and 5.10.1 (Linux x86_64) In function "sub send" the call to the bound C is as following: 21: my($self,%args) = @_; 22: return _ganglia_send( 23: $self, 24: $args{name} || "", 25: $args{value} || "", 26: $args{type} || "", 27: $args{units} || "", 28: $args{group} || "", 29: $args{desc} || "", 30: $args{title} || "", 31: 3, 60, 0); that imply the third argument of _ganglia_send, the value, is interpreted as "" (void string) whenever the actual $args{value} is one of: a) the hash key does'n exists (OK) b) undef (OK) c) the void string "" (not valid but managed by gmetad) d) "0" (KO -> that should be passed as "0") e) 0 (KO -> that should be passed as "0") I suggest the following correction (valid for cases a),c),d),e)): 21: my($self,%args) = @_; 22: return _ganglia_send( 23: $self, 24: $args{name} || "", 25: exists $args{value} ? $args{value} : "", 26: $args{type} || "", 27: $args{units} || "", 28: $args{group} || "", 29: $args{desc} || "", 30: $args{title} || "", 31: 3, 60, 0); marco
I have just released v1.04 with your patch. Thanks for your report and sorry for my late reply. :-) On 2012-3月-02 金 04:56:09, sbrighim wrote: Show quoted text
> > First of all thanks for your work. The code is effective and > useful. > > I'm working with perl 5.8.8 (AIX 6.1 and Linux x86_64) and 5.10.1 (Linux > x86_64) > > In function "sub send" the call to the bound C is as following: > > 21: my($self,%args) = @_; > 22: return _ganglia_send( > 23: $self, > 24: $args{name} || "", > 25: $args{value} || "", > 26: $args{type} || "", > 27: $args{units} || "", > 28: $args{group} || "", > 29: $args{desc} || "", > 30: $args{title} || "", > 31: 3, 60, 0); > > > that imply the third argument of _ganglia_send, the value, is > interpreted as "" (void string) whenever the actual $args{value} > is one of: > > a) the hash key does'n exists (OK) > b) undef (OK) > c) the void string "" (not valid but managed by gmetad) > d) "0" (KO -> that should be passed as "0") > e) 0 (KO -> that should be passed as "0") > > I suggest the following correction (valid for cases a),c),d),e)): > > 21: my($self,%args) = @_; > 22: return _ganglia_send( > 23: $self, > 24: $args{name} || "", > 25: exists $args{value} ? $args{value} : "", > 26: $args{type} || "", > 27: $args{units} || "", > 28: $args{group} || "", > 29: $args{desc} || "", > 30: $args{title} || "", > 31: 3, 60, 0); > > marco