pt-kill: uninitialized value causes script to exit

Bug #923896 reported by Atle Veka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
Medium
Brian Fraser
2.0
Fix Released
Medium
Brian Fraser
2.1
Fix Released
Medium
Brian Fraser

Bug Description

pt-kill frequently, about once or twice daily, exits operation after encountering uninitialized variables. Script should properly check all processlist fields and skip execution if any of the fields it requires are "undef".

Debug output:
# Processlist:2161 28382 Checking query $VAR1 = {
# Command => 'Sleep',
# Host => '<FQDN>:<PORT>',
# Id => '182564144',
# Info => undef,
# State => undef,
# Time => undef,
# User => '<USER>',
# db => undef
# };
#
# MasterSlave:2937 28382 Not system user
# MasterSlave:2954 28382 Matches all replication thread: no ; match: 0
Use of uninitialized value in numeric lt (<) at /usr/local/bin/pt-kill line 2180.

In this case it is barfing on the "Time" field.
Line 2179: if ( $find_spec{idle_time} && ($query->{Command} || '') eq 'Sleep' ) {
Line 2180: if ( $query->{Time} < $find_spec{idle_time} ) {

Thanks,
Atle

Tags: crash pt-kill

Related branches

affects: percona-server → percona-toolkit
Revision history for this message
Atle Veka (atlev) wrote :

I'm testing this modification.

*** pt-kill Mon Jan 30 14:16:28 2012
--- pt-kill.orig Mon Jan 23 14:22:32 2012
***************
*** 2176,2186 ****
           $matched++;
        }

- if ( ! defined $query->{Time} ) {
- PTDEBUG && _d('query->{Time} is undef, skipping query');
- next QUERY;
- }
-
        if ( $find_spec{idle_time} && ($query->{Command} || '') eq 'Sleep' ) {
           if ( $query->{Time} < $find_spec{idle_time} ) {
              PTDEBUG && _d("Query isn't idle long enough");
--- 2176,2181 ----

Changed in percona-toolkit:
status: New → Confirmed
tags: added: crash pt-kill
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-457

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.