Merge lp:~laurynas-biveinis/percona-xtrabackup/BT-28340-bug1158154-2.0 into lp:percona-xtrabackup/2.0

Proposed by Laurynas Biveinis
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 523
Proposed branch: lp:~laurynas-biveinis/percona-xtrabackup/BT-28340-bug1158154-2.0
Merge into: lp:percona-xtrabackup/2.0
Diff against target: 255 lines (+213/-0)
5 files modified
patches/innodb51.patch (+43/-0)
patches/innodb51_builtin.patch (+41/-0)
patches/innodb55.patch (+43/-0)
patches/xtradb51.patch (+43/-0)
patches/xtradb55.patch (+43/-0)
To merge this branch: bzr merge lp:~laurynas-biveinis/percona-xtrabackup/BT-28340-bug1158154-2.0
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Registry Administrators Pending
Review via email: mp+154856@code.launchpad.net

Description of the change

Fix bug 1158154 (Suboptimal debug code in mem_init_buf() and
mem_erase_buf()) in all configurations by patching mem_init_buf() and
mem_erase_buf() to use memset() instead of a
ut_rnd_gen_ibool()-calling loops.

BT 28340

http://jenkins.percona.com/job/percona-xtrabackup-2.0-param/382/

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Note that merging this to 2.0 will *not* be enough to set the bug to Fix Released on 2.0. innodb56.patch needs to be fixed as well, this was not done in the current MP because the 2.0 and 2.1 GCA precedes innodb56.patch introduction.

Revision history for this message
Stewart Smith (stewart) :
review: Approve
Revision history for this message
Stewart Smith (stewart) wrote :

As I mentioned for 2.1 review: may be good to have valgrind annotations if we don't already.

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

They are there already, UNIV_MEM_ASSERT_W/UNIV_MEM_INVALID.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'patches/innodb51.patch'
--- patches/innodb51.patch 2013-03-13 05:02:58 +0000
+++ patches/innodb51.patch 2013-03-22 05:16:21 +0000
@@ -1262,3 +1262,46 @@
1262 } else {1262 } else {
1263 fprintf(stderr,1263 fprintf(stderr,
1264 "InnoDB: Since"1264 "InnoDB: Since"
1265--- a/storage/innodb_plugin/mem/mem0dbg.c
1266+++ b/storage/innodb_plugin/mem/mem0dbg.c
1267@@ -272,18 +272,10 @@
1268 byte* buf, /*!< in: pointer to buffer */
1269 ulint n) /*!< in: length of buffer */
1270 {
1271- byte* ptr;
1272-
1273 UNIV_MEM_ASSERT_W(buf, n);
1274
1275- for (ptr = buf; ptr < buf + n; ptr++) {
1276-
1277- if (ut_rnd_gen_ibool()) {
1278- *ptr = 0xBA;
1279- } else {
1280- *ptr = 0xBE;
1281- }
1282- }
1283+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1284+ memset(buf, 0xBA, n);
1285
1286 UNIV_MEM_INVALID(buf, n);
1287 }
1288@@ -298,17 +290,10 @@
1289 byte* buf, /*!< in: pointer to buffer */
1290 ulint n) /*!< in: length of buffer */
1291 {
1292- byte* ptr;
1293-
1294 UNIV_MEM_ASSERT_W(buf, n);
1295
1296- for (ptr = buf; ptr < buf + n; ptr++) {
1297- if (ut_rnd_gen_ibool()) {
1298- *ptr = 0xDE;
1299- } else {
1300- *ptr = 0xAD;
1301- }
1302- }
1303+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1304+ memset(buf, 0xDE, n);
1305
1306 UNIV_MEM_FREE(buf, n);
1307 }
12651308
=== modified file 'patches/innodb51_builtin.patch'
--- patches/innodb51_builtin.patch 2013-03-13 05:02:58 +0000
+++ patches/innodb51_builtin.patch 2013-03-22 05:16:21 +0000
@@ -1029,6 +1029,47 @@
1029 #ifdef UNIV_MEM_DEBUG1029 #ifdef UNIV_MEM_DEBUG
1030 /**********************************************************************1030 /**********************************************************************
1031 Initializes an allocated memory field in the debug version. */1031 Initializes an allocated memory field in the debug version. */
1032@@ -221,18 +242,10 @@
1033 byte* buf, /* in: pointer to buffer */
1034 ulint n) /* in: length of buffer */
1035 {
1036- byte* ptr;
1037-
1038 UNIV_MEM_ASSERT_W(buf, n);
1039
1040- for (ptr = buf; ptr < buf + n; ptr++) {
1041-
1042- if (ut_rnd_gen_ibool()) {
1043- *ptr = 0xBA;
1044- } else {
1045- *ptr = 0xBE;
1046- }
1047- }
1048+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1049+ memset(buf, 0xBA, n);
1050
1051 UNIV_MEM_INVALID(buf, n);
1052 }
1053@@ -247,17 +260,10 @@
1054 byte* buf, /* in: pointer to buffer */
1055 ulint n) /* in: length of buffer */
1056 {
1057- byte* ptr;
1058-
1059 UNIV_MEM_ASSERT_W(buf, n);
1060
1061- for (ptr = buf; ptr < buf + n; ptr++) {
1062- if (ut_rnd_gen_ibool()) {
1063- *ptr = 0xDE;
1064- } else {
1065- *ptr = 0xAD;
1066- }
1067- }
1068+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1069+ memset(buf, 0xDE, n);
1070
1071 UNIV_MEM_FREE(buf, n);
1072 }
1032--- a/storage/innobase/mem/mem0mem.c1073--- a/storage/innobase/mem/mem0mem.c
1033+++ b/storage/innobase/mem/mem0mem.c1074+++ b/storage/innobase/mem/mem0mem.c
1034@@ -472,6 +472,7 @@1075@@ -472,6 +472,7 @@
10351076
=== modified file 'patches/innodb55.patch'
--- patches/innodb55.patch 2013-03-13 05:02:58 +0000
+++ patches/innodb55.patch 2013-03-22 05:16:21 +0000
@@ -1179,3 +1179,46 @@
1179 ut_a(purge_sys->trx->n_active_thrs == 0);1179 ut_a(purge_sys->trx->n_active_thrs == 0);
1180 1180
1181 rw_lock_x_lock(&purge_sys->latch);1181 rw_lock_x_lock(&purge_sys->latch);
1182--- a/storage/innobase/mem/mem0dbg.c
1183+++ b/storage/innobase/mem/mem0dbg.c
1184@@ -280,18 +280,10 @@
1185 byte* buf, /*!< in: pointer to buffer */
1186 ulint n) /*!< in: length of buffer */
1187 {
1188- byte* ptr;
1189-
1190 UNIV_MEM_ASSERT_W(buf, n);
1191
1192- for (ptr = buf; ptr < buf + n; ptr++) {
1193-
1194- if (ut_rnd_gen_ibool()) {
1195- *ptr = 0xBA;
1196- } else {
1197- *ptr = 0xBE;
1198- }
1199- }
1200+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1201+ memset(buf, 0xBA, n);
1202
1203 UNIV_MEM_INVALID(buf, n);
1204 }
1205@@ -306,17 +298,10 @@
1206 byte* buf, /*!< in: pointer to buffer */
1207 ulint n) /*!< in: length of buffer */
1208 {
1209- byte* ptr;
1210-
1211 UNIV_MEM_ASSERT_W(buf, n);
1212
1213- for (ptr = buf; ptr < buf + n; ptr++) {
1214- if (ut_rnd_gen_ibool()) {
1215- *ptr = 0xDE;
1216- } else {
1217- *ptr = 0xAD;
1218- }
1219- }
1220+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1221+ memset(buf, 0xDE, n);
1222
1223 UNIV_MEM_FREE(buf, n);
1224 }
11821225
=== modified file 'patches/xtradb51.patch'
--- patches/xtradb51.patch 2013-03-13 05:02:58 +0000
+++ patches/xtradb51.patch 2013-03-22 05:16:21 +0000
@@ -1345,3 +1345,46 @@
1345 1345
1346 /* Write the log but do not flush it to disk */1346 /* Write the log but do not flush it to disk */
1347 1347
1348--- a/storage/innodb_plugin/mem/mem0dbg.c
1349+++ b/storage/innodb_plugin/mem/mem0dbg.c
1350@@ -272,18 +272,10 @@
1351 byte* buf, /*!< in: pointer to buffer */
1352 ulint n) /*!< in: length of buffer */
1353 {
1354- byte* ptr;
1355-
1356 UNIV_MEM_ASSERT_W(buf, n);
1357
1358- for (ptr = buf; ptr < buf + n; ptr++) {
1359-
1360- if (ut_rnd_gen_ibool()) {
1361- *ptr = 0xBA;
1362- } else {
1363- *ptr = 0xBE;
1364- }
1365- }
1366+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1367+ memset(buf, 0xBA, n);
1368
1369 UNIV_MEM_INVALID(buf, n);
1370 }
1371@@ -298,17 +290,10 @@
1372 byte* buf, /*!< in: pointer to buffer */
1373 ulint n) /*!< in: length of buffer */
1374 {
1375- byte* ptr;
1376-
1377 UNIV_MEM_ASSERT_W(buf, n);
1378
1379- for (ptr = buf; ptr < buf + n; ptr++) {
1380- if (ut_rnd_gen_ibool()) {
1381- *ptr = 0xDE;
1382- } else {
1383- *ptr = 0xAD;
1384- }
1385- }
1386+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1387+ memset(buf, 0xDE, n);
1388
1389 UNIV_MEM_FREE(buf, n);
1390 }
13481391
=== modified file 'patches/xtradb55.patch'
--- patches/xtradb55.patch 2013-03-13 05:02:58 +0000
+++ patches/xtradb55.patch 2013-03-22 05:16:21 +0000
@@ -1339,3 +1339,46 @@
1339 LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})1339 LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})
1340 1340
1341 OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF)1341 OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF)
1342--- a/storage/innobase/mem/mem0dbg.c
1343+++ b/storage/innobase/mem/mem0dbg.c
1344@@ -280,18 +280,10 @@
1345 byte* buf, /*!< in: pointer to buffer */
1346 ulint n) /*!< in: length of buffer */
1347 {
1348- byte* ptr;
1349-
1350 UNIV_MEM_ASSERT_W(buf, n);
1351
1352- for (ptr = buf; ptr < buf + n; ptr++) {
1353-
1354- if (ut_rnd_gen_ibool()) {
1355- *ptr = 0xBA;
1356- } else {
1357- *ptr = 0xBE;
1358- }
1359- }
1360+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1361+ memset(buf, 0xBA, n);
1362
1363 UNIV_MEM_INVALID(buf, n);
1364 }
1365@@ -306,17 +298,10 @@
1366 byte* buf, /*!< in: pointer to buffer */
1367 ulint n) /*!< in: length of buffer */
1368 {
1369- byte* ptr;
1370-
1371 UNIV_MEM_ASSERT_W(buf, n);
1372
1373- for (ptr = buf; ptr < buf + n; ptr++) {
1374- if (ut_rnd_gen_ibool()) {
1375- *ptr = 0xDE;
1376- } else {
1377- *ptr = 0xAD;
1378- }
1379- }
1380+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1381+ memset(buf, 0xDE, n);
1382
1383 UNIV_MEM_FREE(buf, n);
1384 }

Subscribers

People subscribed via source and target branches