cppcheck issues

Bug #1243739 reported by Raghavendra D Prabhu on 2013-10-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Galera
Status tracked in 3.x
2.x
Medium
Alex Yurchenko
3.x
Medium
Alex Yurchenko
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC
Status tracked in 5.6
5.5
Fix Released
Undecided
Unassigned
5.6
Fix Released
Undecided
Unassigned

Bug Description

In runs of cppcheck, came across following:

galera-23:

[galerautils/src/gu_throw.hpp:73]: (error) Exception thrown in destructor.
[galerautils/src/gu_throw.hpp:101]: (error) Exception thrown in destructor.
[galerautils/src/gu_dbug.c:2024]: (error) fprintf format string requires 2 parameters but only 1 is given.
[galerautils/src/gu_cond.hpp:44]: (error) Exception thrown in destructor.
[galerautils/src/gu_lock.hpp:48]: (error) Exception thrown in destructor.
[galerautils/tests/gu_vlq_test.cpp:61]: (error) Using 'sizeof' on array given as function argument returns size of a pointer.
[galerautils/tests/gu_vlq_test.cpp:77]: (error) Using 'sizeof' on array given as function argument returns size of a pointer.
[gcache/src/gcache_rb_store.hpp:57]: (error) Possible null pointer dereference: rb
[gcache/src/gcache_rb_store.hpp:58]: (error) Possible null pointer dereference: rb
[gcomm/test/check_gmcast.cpp:51]: (error) Instance of 'User' object is destroyed immediately.
[gcomm/test/check_gmcast.cpp:127]: (error) Dangerous usage of 'buf' (not null-terminated).
[tests/test_sysbench/sysbench/drivers/mysql/drv_mysql.c:690]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/pgsql/drv_pgsql.c:289]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/pgsql/drv_pgsql.c:511]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/oracle/drv_oracle.c:444]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/oracle/drv_oracle.c:655]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/tests/mutex/sb_mutex.c:159]: (error) Uninitialized variable: c
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration 'O_DIRECT' since the value of 'O_DIRECT' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration 'O_DSYNC' since the value of 'O_DSYNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration '_SC_PAGESIZE' since the value of '_SC_PAGESIZE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

galera-3.x:

[galerautils/src/gu_throw.hpp:73]: (error) Exception thrown in destructor.
[galerautils/src/gu_throw.hpp:101]: (error) Exception thrown in destructor.
[galerautils/src/gu_cond.hpp:44]: (error) Exception thrown in destructor.
[galerautils/src/gu_lock.hpp:48]: (error) Exception thrown in destructor.
[galerautils/src/gu_dbug.c:2024]: (error) fprintf format string requires 2 parameters but only 1 is given.
[galerautils/tests/gu_vlq_test.cpp:61]: (error) Using 'sizeof' on array given as function argument returns size of a pointer.
[galerautils/tests/gu_vlq_test.cpp:77]: (error) Using 'sizeof' on array given as function argument returns size of a pointer.
[gcache/src/gcache_rb_store.hpp:57]: (error) Possible null pointer dereference: rb
[gcache/src/gcache_rb_store.hpp:58]: (error) Possible null pointer dereference: rb
[gcomm/test/check_gmcast.cpp:51]: (error) Instance of 'User' object is destroyed immediately.
[gcomm/test/check_gmcast.cpp:127]: (error) Dangerous usage of 'buf' (not null-terminated).
[tests/test_sysbench/sysbench/drivers/mysql/drv_mysql.c:690]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/pgsql/drv_pgsql.c:289]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/pgsql/drv_pgsql.c:511]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/oracle/drv_oracle.c:444]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/drivers/oracle/drv_oracle.c:655]: (error) Common realloc mistake: 'buf' nulled but not freed upon failure
[tests/test_sysbench/sysbench/tests/mutex/sb_mutex.c:159]: (error) Uninitialized variable: c
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration 'O_DIRECT' since the value of 'O_DIRECT' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration 'O_DSYNC' since the value of 'O_DSYNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
[tests/test_sysbench/sysbench/tests/fileio/sb_fileio.c:1]: (information) Skipping configuration '_SC_PAGESIZE' since the value of '_SC_PAGESIZE' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.

==================================================================

Some of these may be false positives and can be used as suppressions.

Related branches

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

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

Other bug subscribers