Skip to content

Commit 956d254

Browse files
committed
Remove redundant UT_LIST_INIT() calls
The macro UT_LIST_INIT() zero-initializes the UT_LIST_NODE. There is no need to call this macro on a buffer that has already been zero-initialized by mem_zalloc() or mem_heap_zalloc() or similar. For some reason, the statement UT_LIST_INIT(srv_sys->tasks) in srv_init() caused a SIGSEGV on server startup when compiling with GCC 7.1.0 for AMD64 using -O3. The zero-initialization was attempted by the instruction movaps %xmm0,0x50(%rax), while the proper offset of srv_sys->tasks would seem to have been 0x48.
1 parent 4754f88 commit 956d254

File tree

10 files changed

+8
-24
lines changed

10 files changed

+8
-24
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, Google Inc.
5+
Copyright (c) 2017, MariaDB Corporation.
56
67
Portions of this file contain modifications contributed and copyrighted by
78
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1343,8 +1344,6 @@ buf_pool_init_instance(
13431344
buf_pool->chunks = chunk =
13441345
(buf_chunk_t*) mem_zalloc(sizeof *chunk);
13451346

1346-
UT_LIST_INIT(buf_pool->free);
1347-
13481347
if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) {
13491348
mem_free(chunk);
13501349
mem_free(buf_pool);

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2014, 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2014, 2017, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -1546,8 +1546,6 @@ fil_init(
15461546
fil_system->spaces = hash_create(hash_size);
15471547
fil_system->name_hash = hash_create(hash_size);
15481548

1549-
UT_LIST_INIT(fil_system->LRU);
1550-
15511549
fil_system->max_n_open = max_n_open;
15521550
}
15531551

storage/innobase/row/row0ftsort.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -225,9 +226,6 @@ row_fts_psort_info_init(
225226
each parallel sort thread. Each "sort bucket" holds records for
226227
a particular "FTS index partition" */
227228
for (j = 0; j < fts_sort_pll_degree; j++) {
228-
229-
UT_LIST_INIT(psort_info[j].fts_doc_list);
230-
231229
for (i = 0; i < FTS_NUM_AUX_INDEX; i++) {
232230

233231
psort_info[j].merge_file[i] =

storage/innobase/srv/srv0srv.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,8 +1011,6 @@ srv_init(void)
10111011
srv_monitor_event = os_event_create();
10121012

10131013
srv_buf_dump_event = os_event_create();
1014-
1015-
UT_LIST_INIT(srv_sys->tasks);
10161014
}
10171015

10181016
/* page_zip_stat_per_index_mutex is acquired from:

storage/innobase/usr/usr0sess.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -48,8 +49,6 @@ sess_open(void)
4849
sess->trx = trx_allocate_for_background();
4950
sess->trx->sess = sess;
5051

51-
UT_LIST_INIT(sess->graphs);
52-
5352
return(sess);
5453
}
5554

storage/xtradb/buf/buf0buf.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2008, Google Inc.
5+
Copyright (c) 2017, MariaDB Corporation.
56
67
Portions of this file contain modifications contributed and copyrighted by
78
Google, Inc. Those modifications are gratefully acknowledged and are described
@@ -1432,8 +1433,6 @@ buf_pool_init_instance(
14321433
buf_pool->chunks = chunk =
14331434
(buf_chunk_t*) mem_zalloc(sizeof *chunk);
14341435

1435-
UT_LIST_INIT(buf_pool->free);
1436-
14371436
if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) {
14381437
mem_free(chunk);
14391438
mem_free(buf_pool);

storage/xtradb/fil/fil0fil.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
4-
Copyright (c) 2014, 2017, MariaDB Corporation. All Rights Reserved.
4+
Copyright (c) 2014, 2017, MariaDB Corporation.
55
66
This program is free software; you can redistribute it and/or modify it under
77
the terms of the GNU General Public License as published by the Free Software
@@ -1598,8 +1598,6 @@ fil_init(
15981598
fil_system->spaces = hash_create(hash_size);
15991599
fil_system->name_hash = hash_create(hash_size);
16001600

1601-
UT_LIST_INIT(fil_system->LRU);
1602-
16031601
fil_system->max_n_open = max_n_open;
16041602
}
16051603

storage/xtradb/row/row0ftsort.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -228,9 +229,6 @@ row_fts_psort_info_init(
228229
each parallel sort thread. Each "sort bucket" holds records for
229230
a particular "FTS index partition" */
230231
for (j = 0; j < fts_sort_pll_degree; j++) {
231-
232-
UT_LIST_INIT(psort_info[j].fts_doc_list);
233-
234232
for (i = 0; i < FTS_NUM_AUX_INDEX; i++) {
235233

236234
psort_info[j].merge_file[i] =

storage/xtradb/srv/srv0srv.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,8 +1164,6 @@ srv_init(void)
11641164
if (srv_track_changed_pages) {
11651165
os_event_set(srv_redo_log_tracked_event);
11661166
}
1167-
1168-
UT_LIST_INIT(srv_sys->tasks);
11691167
}
11701168

11711169
/* page_zip_stat_per_index_mutex is acquired from:

storage/xtradb/usr/usr0sess.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2011, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -48,8 +49,6 @@ sess_open(void)
4849
sess->trx = trx_allocate_for_background();
4950
sess->trx->sess = sess;
5051

51-
UT_LIST_INIT(sess->graphs);
52-
5352
return(sess);
5453
}
5554

0 commit comments

Comments
 (0)