errors in debug builds when maintainer mode is on

Bug #1408232 reported by Tomislav Plavcic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Fix Released
High
Tomislav Plavcic
5.5
Fix Released
High
Tomislav Plavcic
5.6
Fix Released
High
Tomislav Plavcic

Bug Description

After 5.6.22 and 5.5.41 merges mysql maintainer mode is turned on by default for debug builds on linux which currently reports some warnings as errors.
Those errors need to be resolved but as current workaround we will disable mysql maintainer mode in debug builds for releases.

Some of the errors seen:
PS 5.5 on ubuntu lucid:
13:34:33 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-lucid-64bit/percona-server-5.5-5.5.41-rel37.0/plugin/semisync/semisync_master.cc: In member function 'int ReplSemiSyncMaster::readSlaveReply(NET*, uint32, const char*)':
13:34:33 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-lucid-64bit/percona-server-5.5-5.5.41-rel37.0/plugin/semisync/semisync_master.cc:1058: error: 'start_ts.timespec::tv_nsec' may be used uninitialized in this function
13:34:33 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-lucid-64bit/percona-server-5.5-5.5.41-rel37.0/plugin/semisync/semisync_master.cc:1058: error: 'start_ts.timespec::tv_sec' may be used uninitialized in this function

PS 5.5 on ubuntu trusty:
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int do_div_mod(const decimal_t*, const decimal_t*, decimal_t*, decimal_t*, int)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:2137:59: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:2152:56: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:2137:59: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i= (prec2 - 1) % DIG_PER_DEC1; *buf2 < powers10[i--]; prec2--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:2152:56: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i=(prec1-1) % DIG_PER_DEC1; *buf1 < powers10[i--]; prec1--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int decimal_actual_fraction(decimal_t*)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:300:30: error: array subscript is above array bounds [-Werror=array-bounds]
13:39:24 *buf0 % powers10[i++] == 0;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:300:30: error: array subscript is above array bounds [-Werror=array-bounds]
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int decimal2string(const decimal_t*, char*, int*, int, int, char)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int decimal2bin(decimal_t*, uchar*, int, int)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int decimal_shift(decimal_t*, int)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:478:35: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (; *buf_beg < powers10[i--]; start++) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:478:35: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:496:33: error: array subscript is above array bounds [-Werror=array-bounds]
13:39:24 for (; *buf_end % powers10[i++] == 0; stop--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:496:33: error: array subscript is above array bounds [-Werror=array-bounds]
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c: In function 'int decimal_intg(const decimal_t*)':
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]
13:39:24 for (i= (intg - 1) % DIG_PER_DEC1; *buf0 < powers10[i--]; intg--) ;
13:39:24 ^
13:39:24 /mnt/workspace/percona-server-5.5-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.5-5.5.41-rel37.0/strings/decimal.c:264:60: error: array subscript is below array bounds [-Werror=array-bounds]

PS 5.6 on ubuntu trusty:
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc: In function 'PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker*, uint, OPAQUE_LEX_YYSTYPE*)':
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc:518:67: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
07:35:59 DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);
07:35:59 ^
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc:518:67: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
07:35:59 DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);
07:35:59 ^
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc:518:67: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
07:35:59 DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);
07:35:59 ^
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc:518:67: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
07:35:59 DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);
07:35:59 ^
07:35:59 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-trusty-64bit/percona-server-5.6-5.6.22-71.0/storage/perfschema/pfs_digest.cc:518:67: error: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Werror=strict-overflow]
07:35:59 DBUG_ASSERT(index + PFS_SIZE_OF_A_TOKEN <= digest->m_byte_count);

PS 5.6 on ubuntu precise:
07:36:28 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-precise-64bit/percona-server-5.6-5.6.22-71.0/sql/ha_partition.cc: In member function ‘virtual enum_alter_inplace_result ha_partition::check_if_supported_inplace_alter(TABLE*, Alter_inplace_info*)’:
07:36:28 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-precise-64bit/percona-server-5.6-5.6.22-71.0/sql/ha_partition.cc:251:3: error: ‘new_field’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
07:36:28 if (!new_field)
07:36:28 ^
07:36:28 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-precise-64bit/percona-server-5.6-5.6.22-71.0/sql/ha_partition.cc:237:17: note: ‘new_field’ was declared here
07:36:28 Create_field *new_field;
07:36:28 ^
07:36:28 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-precise-64bit/percona-server-5.6-5.6.22-71.0/sql/ha_partition.cc:251:3: error: ‘new_field’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
07:36:28 if (!new_field)
07:36:28 ^
07:36:28 /mnt/workspace/percona-server-5.6-debian-binary/label_exp/ubuntu-precise-64bit/percona-server-5.6-5.6.22-71.0/sql/ha_partition.cc:237:17: note: ‘new_field’ was declared here
07:36:28 Create_field *new_field;

PS 5.6 on debian6-32:
07:37:58 /home/jenkins/workspace/percona-server-5.6-debian-binary-32/label_exp/debian6-32/percona-server-5.6-5.6.22-71.0/sql/sql_parse.cc: In function 'int mysql_execute_command(THD*)':
07:37:58 /home/jenkins/workspace/percona-server-5.6-debian-binary-32/label_exp/debian6-32/percona-server-5.6-5.6.22-71.0/sql/sql_parse.cc:2609: error: 'per_query_variables_backup' may be used uninitialized in this function

PS 5.6 on ubuntu lucid:
07:36:41 /mnt/workspace/percona-server-5.6-debian-binary-32/label_exp/ubuntu-lucid-64bit/percona-server-5.6-5.6.22-71.0/sql/sql_acl.cc: In member function 'bool Rsa_authentication_keys::read_key_file(RSA**, bool, char**)':
07:36:41 /mnt/workspace/percona-server-5.6-debian-binary-32/label_exp/ubuntu-lucid-64bit/percona-server-5.6-5.6.22-71.0/sql/sql_acl.cc:12122: error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result

Changed in percona-server:
status: New → Triaged
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The majority of these warnings are not Percona Server-specific, is there a bugs.mysql.com report or reports? Can you file one if there isn't?

Revision history for this message
Tomislav Plavcic (tplavcic) wrote :

Can't seem to find similar report on bugs.mysql.com, but need more time since I think maybe the errors depend on our other debug build flags. So I'll create report if needed after further investigation.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

07:37:58 /home/jenkins/workspace/percona-server-5.6-debian-binary-32/label_exp/debian6-32/percona-server-5.6-5.6.22-71.0/sql/sql_parse.cc: In function 'int mysql_execute_command(THD*)':
07:37:58 /home/jenkins/workspace/percona-server-5.6-debian-binary-32/label_exp/debian6-32/percona-server-5.6-5.6.22-71.0/sql/sql_parse.cc:2609: error: 'per_query_variables_backup' may be used uninitialized in this function

is an actual PS bug:

int
mysql_execute_command(THD *thd)
{
...
  struct system_variables *per_query_variables_backup;
...
  if (this or that) goto error;
...
  if (lex->set_statement && !lex->var_list.is_empty()) {
    per_query_variables_backup= copy_system_variables(&thd->variables,
                                                      thd->m_enable_plugins);
...
error:
...
  if (lex->set_statement && !lex->var_list.is_empty()) {
...
    free_system_variables(&thd->variables, thd->m_enable_plugins);
    thd->variables= *per_query_variables_backup;
    my_free(per_query_variables_backup);
...
}

So, in case of "this or that" we end up with corrupted thd->variables going forward, and this might be the cause of numerous SET STATEMENT crashes: bug 1387951, bug 1417028, bug 1416975, bug 1416956, etc, etc, etc, see the set-statement bug tag.

Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

All the relevant SET STATEMENT bugs were collected into bug 1418049, bug 1387951, and bug 1412423, each corresponding to one goto error in the above.

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/PS-860

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

Other bug subscribers