pt-config-diff Use of uninitialized value in substitution (s///) at line 1996

Reported by Daniel Nichter on 2012-01-17
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Percona Toolkit
Medium
Brian Fraser

Bug Description

$ pt-config-diff --version
pt-config-diff 2.0.1

Below is my.cnf file on this server:

[mysqld]

  server-id = 98765

  pid-file = /var/lib/mysql/mysql.pid
  socket = /var/lib/mysql/mysql.sock
  port = 3306

  datadir = /var/lib/mysql/
  innodb_data_home_dir = /var/lib/mysql/

  log-error = mysqld.err
  log-slow-queries = slave-slow.log

  # Replication
  log_bin = mysql-bin
  relay-log = relay-bin
  expire-logs-days = 14
  log-slave-updates
  skip-slave-start
  old_passwords=1

  tmpdir = /dev/shm

  # InnoDB
  innodb_log_file_size = 32M
  innodb_buffer_pool_size = 256M

  read-only

  max_allowed_packet = 16M
  table_cache = 4096
  default-character-set = utf8
  max-connections = 200
  ft_min_word_len = 3
  net_read_timeout = 7200
  net_write_timeout = 7200

  key_buffer_size = 4086M
  query_cache_size = 0
  query_cache_type = 0
  thread_cache_size = 4
  group_concat_max_len = 8192
  long-query-time = 2000000
  skip-name-resolve

  innodb_flush_method = O_DIRECT
  innodb_log_buffer_size = 4M
  innodb_flush_log_at_trx_commit = 2
  innodb_file_per_table = 1
  innodb_open_files = 256

[mysql.server]
user=mysql
#basedir=/var/lib

[mysqld_safe]
log-error = mysqld.err
pid-file=/var/run/mysqld/mysqld.pid

Changed in percona-toolkit:
importance: High → Undecided
Sebastien Dejean (sdejean) wrote :

Same issue for me:

"Use of uninitialized value $var in substitution (s///) at /usr/bin/pt-config-diff line 2149."

System details:
$ uname -a
Linux sebastien-VirtualBox 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:25:57 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04 LTS
Release: 12.04
Codename: precise

$ dpkg -l |grep percona-toolkit
ii percona-toolkit 2.1.2 Advanced MySQL and system command-line tools

$ pt-config-diff --version
pt-config-diff 2.1.2

Sebastien Dejean (sdejean) wrote :

Note that I was able to get it working w/ a quick edit (I know this isn't the PROPER way to submit a patch but I was just trying something out as a test):

$ diff -u `which pt-config-diff` /tmp/pt-config-diff
--- /usr/bin/pt-config-diff 2012-06-12 09:04:42.000000000 -0700
+++ /tmp/pt-config-diff 2012-08-06 14:16:44.840586029 -0700
@@ -2143,7 +2143,7 @@
          $item =~ s/\s+$//;
       }

- if ( !$var ) {
+ if ( !$var && defined $item ) {
          $var = $item;

          $var =~ s/-/_/g;

Changed in percona-toolkit:
milestone: none → 2.1.4
importance: Undecided → Medium
Changed in percona-toolkit:
assignee: nobody → Daniel Nichter (daniel-nichter)
Changed in percona-toolkit:
status: Confirmed → In Progress
Daniel Nichter (daniel-nichter) wrote :

I reported this bug, but I cannot reproduce it now with 2.1.2 or 2.0.5. If anyone can still reproduce this bug, please provide PTDEBUG output. Else, I'll mark this bug invalid and close it in a few days.

Changed in percona-toolkit:
status: In Progress → Invalid
milestone: 2.1.4 → none
Brian Lee (chinchy) wrote :

I upgraded to 2.1.5 and I'm still getting this error:
Use of uninitialized value $var in substitution (s///) at /usr/bin/pt-config-diff line 2217.

# uname -a
Linux dbc2-q1.local-paymo.net 2.6.32-220.17.1.el6.x86_64 #1 SMP Wed May 16 00:01:37 BST 2012 x86_64 x86_64 x86_64 GNU/Linux

# pt-config-diff --version
pt-config-diff 2.1.5

MySQL version:
mysql> select @@version;
+------------------+
| @@version |
+------------------+
| 5.5.25a-27.1-log |
+------------------+
1 row in set (0.00 sec)

Tail of ptdebug output:
# MySQLConfig:2226 23714 Var: innodb_data_file_path val: ibdata1:10M:autoextend
# MySQLConfig:2226 23714 Var: innodb_file_format val: Barracuda
# MySQLConfig:2226 23714 Var: innodb_additional_mem_pool_size val: 20M
# MySQLConfig:2226 23714 Var: innodb_lock_wait_timeout val: 120
# MySQLConfig:2226 23714 Var: innodb_ibuf_active_contract val: 1
# MySQLConfig:2226 23714 Var: innodb_adaptive_flushing val: false
# MySQLConfig:2226 23714 Var: innodb_read_io_threads val: 4
# MySQLConfig:2226 23714 Var: innodb_write_io_threads val: 4
# MySQLConfig:2226 23714 Var: innodb_thread_concurrency val: 0
# MySQLConfig:2226 23714 Var: innodb_thread_sleep_delay val: 0
# MySQLConfig:2226 23714 Var: innodb_log_buffer_size val: 16M
# MySQLConfig:2226 23714 Var: innodb_max_dirty_pages_pct val: 2
# MySQLConfig:2226 23714 Var: innodb_large_prefix val: 1
Use of uninitialized value $var in substitution (s///) at /usr/bin/pt-config-diff line 2217.
# Cxn:1589 23714 Disconnecting dbh DBI::db=HASH(0x2b59810) undef

Of note however, in a different server with the same version, I don't get the error.

Daniel Nichter (daniel-nichter) wrote :

We'll try again to reproduce it.

Changed in percona-toolkit:
status: Invalid → Triaged
assignee: Daniel Nichter (daniel-nichter) → nobody
milestone: none → 2.1.8
Brian Fraser (fraserbn) on 2012-11-26
Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn) on 2012-11-26
Changed in percona-toolkit:
status: Triaged → In Progress
Brian Lee (chinchy) wrote :

On a side note, if I use pt-config-diff to compare two different servers there are no errors. It is only when I compare against a file.

e.g:
Works:
pt-config-diff h=host1,u=user1 h=host2,u=user2 --ask-pass

Errors out:
pt-config-diff h=host1,u=user1 /etc/my.cnf --ask-pass
pt-config-diff /etc/my.cnf /etc/my-2.cnf

Daniel Nichter (daniel-nichter) wrote :

Brian has reproduced this. The branch/fix is in progress.

Brian Fraser (fraserbn) on 2012-12-04
Changed in percona-toolkit:
status: In Progress → Fix Committed
summary: - Use of uninitialized value in substitution (s///) at pt-config-diff line
- 1996
+ pt-config-diff error: Use of uninitialized value in substitution (s///)
+ at line 1996
summary: - pt-config-diff error: Use of uninitialized value in substitution (s///)
- at line 1996
+ pt-config-diff Use of uninitialized value in substitution (s///) at line
+ 1996
Changed in percona-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers