* [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN
@ 2020-01-20 10:50 Alexander V. Tikhonov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout Alexander V. Tikhonov
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Alexander V. Tikhonov @ 2020-01-20 10:50 UTC (permalink / raw)
To: Igor Munkin, Alexander Turenko; +Cc: tarantool-patches
Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-2058-asan-with-leaks
Issue: https://github.com/tarantool/tarantool/issues/2058
v1: https://lists.tarantool.org/pipermail/tarantool-patches/2020-January/013682.html
Changes v2:
- made suggested corrections
Changes v1:
- initial version
Alexander V. Tikhonov (2):
test: use default replication connection timeout
gitlab-ci: add memory leaks detection via LSAN
.travis.mk | 17 ++-
asan/asan.supp | 17 +++
asan/lsan.supp | 105 ++++++++++++++++++
cmake/profile.cmake | 4 +-
test/box/on_shutdown.skipcond | 7 ++
test/replication/autobootstrap.lua | 2 -
test/replication/autobootstrap.result | 2 +-
test/replication/autobootstrap.test.lua | 2 +-
test/replication/autobootstrap_guest.lua | 2 -
test/replication/before_replace.result | 6 +-
test/replication/before_replace.test.lua | 6 +-
test/replication/ddl.lua | 2 -
test/replication/hot_standby.lua | 1 -
test/replication/master.lua | 1 -
test/replication/master_quorum.lua | 2 -
test/replication/on_replace.lua | 2 -
test/replication/quorum.lua | 2 -
test/replication/quorum.result | 15 ++-
test/replication/quorum.test.lua | 15 ++-
test/replication/rebootstrap.lua | 2 -
test/replication/rebootstrap.result | 4 +-
test/replication/rebootstrap.test.lua | 4 +-
test/replication/recover_missing_xlog.result | 2 +-
.../replication/recover_missing_xlog.test.lua | 2 +-
test/replication/replica.lua | 1 -
test/replication/replica_auth.lua | 2 -
test/replication/replica_no_quorum.lua | 1 -
test/replication/replica_quorum.lua | 2 -
test/replication/replica_timeout.lua | 2 -
test/replication/replica_uuid.lua | 1 -
test/replication/replica_uuid_ro.lua | 2 -
test/replication/replicaset_ro_mostly.result | 2 +-
.../replication/replicaset_ro_mostly.test.lua | 2 +-
test/replication/wal_off.lua | 1 -
34 files changed, 172 insertions(+), 68 deletions(-)
create mode 100644 asan/asan.supp
create mode 100644 asan/lsan.supp
create mode 100644 test/box/on_shutdown.skipcond
--
2.17.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout
2020-01-20 10:50 [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN Alexander V. Tikhonov
@ 2020-01-20 10:50 ` Alexander V. Tikhonov
2020-03-27 14:07 ` Sergey Bronnikov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN Alexander V. Tikhonov
2020-01-21 14:25 ` [Tarantool-patches] [PATCH v2 0/2] " Igor Munkin
2 siblings, 1 reply; 9+ messages in thread
From: Alexander V. Tikhonov @ 2020-01-20 10:50 UTC (permalink / raw)
To: Igor Munkin, Alexander Turenko; +Cc: tarantool-patches
All local connection timeout settings not related to the testing
scenario are removed within this change. Instead of removed values
the default one from src/box/lua/load_cfg.lua will be used.
The approach with a single default value helps to avoid flaky test
results regarding different timeout values and makes the future
maintainence easier.
The change is required for LSAN and ASAN testing machinery since it
introduces a little overhead and cause failures for tests with
excessively strict time limits.
Needed for #2058
---
test/replication/autobootstrap.lua | 2 --
test/replication/autobootstrap.result | 2 +-
test/replication/autobootstrap.test.lua | 2 +-
test/replication/autobootstrap_guest.lua | 2 --
test/replication/before_replace.result | 6 +++---
test/replication/before_replace.test.lua | 6 +++---
test/replication/ddl.lua | 2 --
test/replication/hot_standby.lua | 1 -
test/replication/master.lua | 1 -
test/replication/master_quorum.lua | 2 --
test/replication/on_replace.lua | 2 --
test/replication/quorum.lua | 2 --
test/replication/quorum.result | 15 +++++++--------
test/replication/quorum.test.lua | 15 +++++++--------
test/replication/rebootstrap.lua | 2 --
test/replication/rebootstrap.result | 4 ++--
test/replication/rebootstrap.test.lua | 4 ++--
test/replication/recover_missing_xlog.result | 2 +-
test/replication/recover_missing_xlog.test.lua | 2 +-
test/replication/replica.lua | 1 -
test/replication/replica_auth.lua | 2 --
test/replication/replica_no_quorum.lua | 1 -
test/replication/replica_quorum.lua | 2 --
test/replication/replica_timeout.lua | 2 --
test/replication/replica_uuid.lua | 1 -
test/replication/replica_uuid_ro.lua | 2 --
test/replication/replicaset_ro_mostly.result | 2 +-
test/replication/replicaset_ro_mostly.test.lua | 2 +-
test/replication/wal_off.lua | 1 -
29 files changed, 30 insertions(+), 60 deletions(-)
diff --git a/test/replication/autobootstrap.lua b/test/replication/autobootstrap.lua
index 856b36e66..6d01fb2da 100644
--- a/test/replication/autobootstrap.lua
+++ b/test/replication/autobootstrap.lua
@@ -6,7 +6,6 @@ local USER = 'cluster'
local PASSWORD = 'somepassword'
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -25,7 +24,6 @@ box.cfg({
USER..':'..PASSWORD..'@'..instance_uri(3);
};
replication_timeout = TIMEOUT;
- replication_connect_timeout = CON_TIMEOUT;
})
box.once("bootstrap", function()
diff --git a/test/replication/autobootstrap.result b/test/replication/autobootstrap.result
index 743982d47..ec9667663 100644
--- a/test/replication/autobootstrap.result
+++ b/test/replication/autobootstrap.result
@@ -188,7 +188,7 @@ box.space.test_u:select()
_ = test_run:cmd("switch autobootstrap1")
---
...
-_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1 0.5'")
+_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1'")
_ = box.space.test_u:replace({5, 6, 7, 8})
---
...
diff --git a/test/replication/autobootstrap.test.lua b/test/replication/autobootstrap.test.lua
index 055ea4277..8c75d1322 100644
--- a/test/replication/autobootstrap.test.lua
+++ b/test/replication/autobootstrap.test.lua
@@ -86,7 +86,7 @@ box.space.test_u:select()
-- Rebootstrap one node and check that others follow.
--
_ = test_run:cmd("switch autobootstrap1")
-_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1 0.5'")
+_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1'")
_ = box.space.test_u:replace({5, 6, 7, 8})
box.space.test_u:select()
diff --git a/test/replication/autobootstrap_guest.lua b/test/replication/autobootstrap_guest.lua
index d7176ae5b..54febd1b6 100644
--- a/test/replication/autobootstrap_guest.lua
+++ b/test/replication/autobootstrap_guest.lua
@@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -25,7 +24,6 @@ box.cfg({
instance_uri(3);
};
replication_timeout = TIMEOUT;
- replication_connect_timeout = CON_TIMEOUT;
})
box.once("bootstrap", function()
diff --git a/test/replication/before_replace.result b/test/replication/before_replace.result
index ced40547e..ce66718d1 100644
--- a/test/replication/before_replace.result
+++ b/test/replication/before_replace.result
@@ -138,7 +138,7 @@ box.space.test:select()
- [9, 90]
- [10, 100]
...
-test_run:cmd('restart server autobootstrap1 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap1 with args="0.1"')
box.space.test:select()
---
- - [1, 10]
@@ -169,7 +169,7 @@ box.space.test:select()
- [9, 90]
- [10, 100]
...
-test_run:cmd('restart server autobootstrap2 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap2 with args="0.1"')
box.space.test:select()
---
- - [1, 10]
@@ -204,7 +204,7 @@ push_err
---
- Session 'applier' does not support push()
...
-test_run:cmd('restart server autobootstrap3 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap3 with args="0.1"')
box.space.test:select()
---
- - [1, 10]
diff --git a/test/replication/before_replace.test.lua b/test/replication/before_replace.test.lua
index bcc6dc00d..3b9910cbc 100644
--- a/test/replication/before_replace.test.lua
+++ b/test/replication/before_replace.test.lua
@@ -65,16 +65,16 @@ vclock2 = test_run:wait_cluster_vclock(SERVERS, vclock)
-- and the state persists after restart.
test_run:cmd("switch autobootstrap1")
box.space.test:select()
-test_run:cmd('restart server autobootstrap1 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap1 with args="0.1"')
box.space.test:select()
test_run:cmd("switch autobootstrap2")
box.space.test:select()
-test_run:cmd('restart server autobootstrap2 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap2 with args="0.1"')
box.space.test:select()
test_run:cmd("switch autobootstrap3")
box.space.test:select()
push_err
-test_run:cmd('restart server autobootstrap3 with args="0.1 0.5"')
+test_run:cmd('restart server autobootstrap3 with args="0.1"')
box.space.test:select()
-- Cleanup.
diff --git a/test/replication/ddl.lua b/test/replication/ddl.lua
index 72cf1db69..2db977d46 100644
--- a/test/replication/ddl.lua
+++ b/test/replication/ddl.lua
@@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -27,7 +26,6 @@ box.cfg({
USER..':'..PASSWORD..'@'..instance_uri(4);
};
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT,
})
box.once("bootstrap", function()
diff --git a/test/replication/hot_standby.lua b/test/replication/hot_standby.lua
index cd53fc776..30742ce4f 100644
--- a/test/replication/hot_standby.lua
+++ b/test/replication/hot_standby.lua
@@ -10,6 +10,5 @@ box.cfg({
vinyl_dir = "master",
hot_standby = true,
replication_timeout = 0.1,
- replication_connect_timeout = 0.5,
})
diff --git a/test/replication/master.lua b/test/replication/master.lua
index 9b96b7891..e924b5495 100644
--- a/test/replication/master.lua
+++ b/test/replication/master.lua
@@ -3,7 +3,6 @@ os = require('os')
box.cfg({
listen = os.getenv("LISTEN"),
memtx_memory = 107374182,
- replication_connect_timeout = 0.5,
replication_timeout = 0.1
})
diff --git a/test/replication/master_quorum.lua b/test/replication/master_quorum.lua
index 05272ac5e..20f161cc0 100644
--- a/test/replication/master_quorum.lua
+++ b/test/replication/master_quorum.lua
@@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -25,7 +24,6 @@ box.cfg({
};
replication_connect_quorum = 0;
replication_timeout = TIMEOUT;
- replication_connect_timeout = CON_TIMEOUT;
})
test_run = require('test_run').new()
diff --git a/test/replication/on_replace.lua b/test/replication/on_replace.lua
index 40c12a9ea..71e63d3f9 100644
--- a/test/replication/on_replace.lua
+++ b/test/replication/on_replace.lua
@@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -28,7 +27,6 @@ box.cfg({
USER..':'..PASSWORD..'@'..instance_uri(2);
};
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT,
})
box.once("bootstrap", function()
diff --git a/test/replication/quorum.lua b/test/replication/quorum.lua
index f61c8748f..129e676e0 100644
--- a/test/replication/quorum.lua
+++ b/test/replication/quorum.lua
@@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -20,7 +19,6 @@ box.cfg({
listen = instance_uri(INSTANCE_ID);
replication_timeout = TIMEOUT;
replication_sync_lag = 0.01;
- replication_connect_timeout = CON_TIMEOUT;
replication_connect_quorum = 3;
replication = {
instance_uri(1);
diff --git a/test/replication/quorum.result b/test/replication/quorum.result
index 07abe7f2a..8ea9fa22e 100644
--- a/test/replication/quorum.result
+++ b/test/replication/quorum.result
@@ -27,7 +27,7 @@ test_run:cmd('switch quorum2')
---
- true
...
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
---
- orphan
@@ -55,7 +55,7 @@ box.info.status -- running
---
- running
...
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
---
- orphan
@@ -86,7 +86,7 @@ box.info.status -- running
---
- running
...
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
---
- orphan
@@ -103,7 +103,7 @@ box.space.test:replace{100} -- error
---
- error: Can't modify data because this instance is in read-only mode.
...
-test_run:cmd('start server quorum1 with args="0.1 0.5"')
+test_run:cmd('start server quorum1 with args="0.1"')
---
- true
...
@@ -166,7 +166,7 @@ fiber = require('fiber')
fiber.sleep(0.1)
---
...
-test_run:cmd('start server quorum1 with args="0.1 0.5"')
+test_run:cmd('start server quorum1 with args="0.1"')
---
- true
...
@@ -204,7 +204,7 @@ test_run:cmd('switch quorum1')
---
- true
...
-test_run:cmd('restart server quorum1 with cleanup=1, args="0.1 0.5"')
+test_run:cmd('restart server quorum1 with cleanup=1, args="0.1"')
test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
---
- true
@@ -419,10 +419,9 @@ test_run:cmd('create server replica_quorum with script="replication/replica_quor
- true
...
-- Arguments are: replication_connect_quorum, replication_timeout
--- replication_connect_timeout.
-- If replication_connect_quorum was ignored here, the instance
-- would exit with an error.
-test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05 0.1"')
+test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05"')
---
- true
...
diff --git a/test/replication/quorum.test.lua b/test/replication/quorum.test.lua
index 5f2872675..31be48fc2 100644
--- a/test/replication/quorum.test.lua
+++ b/test/replication/quorum.test.lua
@@ -18,7 +18,7 @@ test_run:cmd('stop server quorum1')
test_run:cmd('switch quorum2')
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
box.ctl.wait_rw(0.001) -- timeout
box.info.ro -- true
@@ -27,7 +27,7 @@ box.space.test:replace{100} -- error
box.cfg{replication={}}
box.info.status -- running
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
box.ctl.wait_rw(0.001) -- timeout
box.info.ro -- true
@@ -37,12 +37,12 @@ box.ctl.wait_rw()
box.info.ro -- false
box.info.status -- running
-test_run:cmd('restart server quorum2 with args="0.1 0.5"')
+test_run:cmd('restart server quorum2 with args="0.1"')
box.info.status -- orphan
box.ctl.wait_rw(0.001) -- timeout
box.info.ro -- true
box.space.test:replace{100} -- error
-test_run:cmd('start server quorum1 with args="0.1 0.5"')
+test_run:cmd('start server quorum1 with args="0.1"')
box.ctl.wait_rw()
box.info.ro -- false
box.info.status -- running
@@ -65,7 +65,7 @@ for i = 1, 100 do box.space.test:insert{i} end
fiber = require('fiber')
fiber.sleep(0.1)
-test_run:cmd('start server quorum1 with args="0.1 0.5"')
+test_run:cmd('start server quorum1 with args="0.1"')
test_run:cmd('switch quorum1')
test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
@@ -81,7 +81,7 @@ test_run:cmd('switch quorum2')
box.snapshot()
test_run:cmd('switch quorum1')
-test_run:cmd('restart server quorum1 with cleanup=1, args="0.1 0.5"')
+test_run:cmd('restart server quorum1 with cleanup=1, args="0.1"')
test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
@@ -157,10 +157,9 @@ test_run:drop_cluster(SERVERS)
box.schema.user.grant('guest', 'replication')
test_run:cmd('create server replica_quorum with script="replication/replica_quorum.lua"')
-- Arguments are: replication_connect_quorum, replication_timeout
--- replication_connect_timeout.
-- If replication_connect_quorum was ignored here, the instance
-- would exit with an error.
-test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05 0.1"')
+test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05"')
test_run:cmd('switch replica_quorum')
-- If replication_connect_quorum was ignored here, the instance
-- would exit with an error.
diff --git a/test/replication/rebootstrap.lua b/test/replication/rebootstrap.lua
index 3e7d8f062..e8405e9d9 100644
--- a/test/replication/rebootstrap.lua
+++ b/test/replication/rebootstrap.lua
@@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
local function instance_uri(instance_id)
return SOCKET_DIR..'/rebootstrap'..instance_id..'.sock';
@@ -19,7 +18,6 @@ box.cfg({
listen = instance_uri(INSTANCE_ID),
instance_uuid = '12345678-abcd-1234-abcd-123456789ef' .. INSTANCE_ID,
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT,
replication = {
instance_uri(1);
instance_uri(2);
diff --git a/test/replication/rebootstrap.result b/test/replication/rebootstrap.result
index ea390c19f..d5e4d3967 100644
--- a/test/replication/rebootstrap.result
+++ b/test/replication/rebootstrap.result
@@ -20,11 +20,11 @@ test_run:cmd('stop server rebootstrap1')
---
- true
...
-test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1 2.0"')
+test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1"')
---
- true
...
-test_run:cmd('start server rebootstrap1 with args="0.1 0.5"')
+test_run:cmd('start server rebootstrap1 with args="0.1"')
---
- true
...
diff --git a/test/replication/rebootstrap.test.lua b/test/replication/rebootstrap.test.lua
index 8ddf77912..f532c4305 100644
--- a/test/replication/rebootstrap.test.lua
+++ b/test/replication/rebootstrap.test.lua
@@ -12,8 +12,8 @@ test_run:wait_fullmesh(SERVERS)
-- in 'orphan' mode.
--
test_run:cmd('stop server rebootstrap1')
-test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1 2.0"')
-test_run:cmd('start server rebootstrap1 with args="0.1 0.5"')
+test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1"')
+test_run:cmd('start server rebootstrap1 with args="0.1"')
test_run:cmd('switch rebootstrap1')
box.info.status -- running
diff --git a/test/replication/recover_missing_xlog.result b/test/replication/recover_missing_xlog.result
index ef4c29e50..f240be633 100644
--- a/test/replication/recover_missing_xlog.result
+++ b/test/replication/recover_missing_xlog.result
@@ -69,7 +69,7 @@ fio.unlink(list[#list])
---
- true
...
-test_run:cmd('start server autobootstrap1 with args="0.1 0.5"')
+test_run:cmd('start server autobootstrap1 with args="0.1"')
---
- true
...
diff --git a/test/replication/recover_missing_xlog.test.lua b/test/replication/recover_missing_xlog.test.lua
index 2cd73520f..499107e94 100644
--- a/test/replication/recover_missing_xlog.test.lua
+++ b/test/replication/recover_missing_xlog.test.lua
@@ -29,7 +29,7 @@ fio = require('fio')
-- in 'read-only' mode unless it receives all data.
list = fio.glob(fio.pathjoin(fio.abspath("."), 'autobootstrap1/*.xlog'))
fio.unlink(list[#list])
-test_run:cmd('start server autobootstrap1 with args="0.1 0.5"')
+test_run:cmd('start server autobootstrap1 with args="0.1"')
test_run:cmd("switch autobootstrap1")
for i = 10, 19 do box.space.test:insert{i, 'test' .. i} end
diff --git a/test/replication/replica.lua b/test/replication/replica.lua
index 20ac064e1..b8ab87c33 100644
--- a/test/replication/replica.lua
+++ b/test/replication/replica.lua
@@ -5,7 +5,6 @@ box.cfg({
replication = os.getenv("MASTER"),
memtx_memory = 107374182,
replication_timeout = 0.1,
- replication_connect_timeout = 0.5,
})
require('console').listen(os.getenv('ADMIN'))
diff --git a/test/replication/replica_auth.lua b/test/replication/replica_auth.lua
index 22ba9146c..61d046fc4 100644
--- a/test/replication/replica_auth.lua
+++ b/test/replication/replica_auth.lua
@@ -2,7 +2,6 @@
local USER_PASS = arg[1]
local TIMEOUT = arg[2] and tonumber(arg[2]) or 0.1
-local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
require('console').listen(os.getenv('ADMIN'))
@@ -10,5 +9,4 @@ box.cfg({
listen = os.getenv("LISTEN"),
replication = USER_PASS .. "@" .. os.getenv("MASTER"),
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT
})
diff --git a/test/replication/replica_no_quorum.lua b/test/replication/replica_no_quorum.lua
index c30c043cc..5868eb77b 100644
--- a/test/replication/replica_no_quorum.lua
+++ b/test/replication/replica_no_quorum.lua
@@ -6,7 +6,6 @@ box.cfg({
memtx_memory = 107374182,
replication_connect_quorum = 0,
replication_timeout = 0.1,
- replication_connect_timeout = 0.5,
})
require('console').listen(os.getenv('ADMIN'))
diff --git a/test/replication/replica_quorum.lua b/test/replication/replica_quorum.lua
index dd42b8214..fe51da802 100644
--- a/test/replication/replica_quorum.lua
+++ b/test/replication/replica_quorum.lua
@@ -4,7 +4,6 @@ local SOCKET_DIR = require('fio').cwd()
local QUORUM = tonumber(arg[1])
local TIMEOUT = arg[2] and tonumber(arg[2]) or 0.1
-local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
INSTANCE_URI = SOCKET_DIR .. '/replica_quorum.sock'
function nonexistent_uri(id)
@@ -16,7 +15,6 @@ require('console').listen(os.getenv('ADMIN'))
box.cfg{
listen = INSTANCE_URI,
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT,
replication_connect_quorum = QUORUM,
replication = {INSTANCE_URI,
nonexistent_uri(1),
diff --git a/test/replication/replica_timeout.lua b/test/replication/replica_timeout.lua
index 38922fa3d..34fd9f946 100644
--- a/test/replication/replica_timeout.lua
+++ b/test/replication/replica_timeout.lua
@@ -1,14 +1,12 @@
#!/usr/bin/env tarantool
local TIMEOUT = tonumber(arg[1])
-local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
box.cfg({
listen = os.getenv("LISTEN"),
replication = os.getenv("MASTER"),
memtx_memory = 107374182,
replication_timeout = TIMEOUT,
- replication_connect_timeout = CON_TIMEOUT,
})
require('console').listen(os.getenv('ADMIN'))
diff --git a/test/replication/replica_uuid.lua b/test/replication/replica_uuid.lua
index 4343cfd5b..72138428a 100644
--- a/test/replication/replica_uuid.lua
+++ b/test/replication/replica_uuid.lua
@@ -6,7 +6,6 @@ box.cfg({
replication = os.getenv("MASTER"),
memtx_memory = 107374182,
replication_timeout = 0.1,
- replication_connect_timeout = 0.5,
})
require('console').listen(os.getenv('ADMIN'))
diff --git a/test/replication/replica_uuid_ro.lua b/test/replication/replica_uuid_ro.lua
index d5ba55852..5c1a2f5b6 100644
--- a/test/replication/replica_uuid_ro.lua
+++ b/test/replication/replica_uuid_ro.lua
@@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
local SOCKET_DIR = require('fio').cwd()
local TIMEOUT = tonumber(arg[2])
-local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
local function instance_uri(instance_id)
--return 'localhost:'..(3310 + instance_id)
@@ -27,7 +26,6 @@ box.cfg({
};
read_only = (INSTANCE_ID ~= '1' and true or false);
replication_timeout = TIMEOUT;
- replication_connect_timeout = CON_TIMEOUT;
})
box.once("bootstrap", function()
diff --git a/test/replication/replicaset_ro_mostly.result b/test/replication/replicaset_ro_mostly.result
index 1ce7d6f8e..a471779d3 100644
--- a/test/replication/replicaset_ro_mostly.result
+++ b/test/replication/replicaset_ro_mostly.result
@@ -27,7 +27,7 @@ UUID = sort({uuid1, uuid2}, sort_cmp)
create_cluster_cmd1 = 'create server %s with script="replication/%s.lua"'
---
...
-create_cluster_cmd2 = 'start server %s with args="%s %s", wait_load=False, wait=False'
+create_cluster_cmd2 = 'start server %s with args="%s", wait_load=False, wait=False'
---
...
test_run:cmd("setopt delimiter ';'")
diff --git a/test/replication/replicaset_ro_mostly.test.lua b/test/replication/replicaset_ro_mostly.test.lua
index c75af7218..19cd1fe4a 100644
--- a/test/replication/replicaset_ro_mostly.test.lua
+++ b/test/replication/replicaset_ro_mostly.test.lua
@@ -12,7 +12,7 @@ function sort(t) table.sort(t, sort_cmp) return t end
UUID = sort({uuid1, uuid2}, sort_cmp)
create_cluster_cmd1 = 'create server %s with script="replication/%s.lua"'
-create_cluster_cmd2 = 'start server %s with args="%s %s", wait_load=False, wait=False'
+create_cluster_cmd2 = 'start server %s with args="%s", wait_load=False, wait=False'
test_run:cmd("setopt delimiter ';'")
function create_cluster_uuid(servers, uuids)
diff --git a/test/replication/wal_off.lua b/test/replication/wal_off.lua
index cfd488e4d..9da53ba98 100644
--- a/test/replication/wal_off.lua
+++ b/test/replication/wal_off.lua
@@ -6,7 +6,6 @@ box.cfg({
memtx_memory = 107374182,
wal_mode = 'none',
replication_timeout = 0.1,
- replication_connect_timeout = 0.5,
})
require('console').listen(os.getenv('ADMIN'))
--
2.17.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN
2020-01-20 10:50 [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN Alexander V. Tikhonov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout Alexander V. Tikhonov
@ 2020-01-20 10:50 ` Alexander V. Tikhonov
2020-03-27 14:06 ` Sergey Bronnikov
2020-01-21 14:25 ` [Tarantool-patches] [PATCH v2 0/2] " Igor Munkin
2 siblings, 1 reply; 9+ messages in thread
From: Alexander V. Tikhonov @ 2020-01-20 10:50 UTC (permalink / raw)
To: Igor Munkin, Alexander Turenko; +Cc: tarantool-patches
The change enables memory leaks detection to existing ASAN testing
routine and introduces suppression files with the corresponding
exception list:
* address sanitizer for compile-time: asan/asan.supp
* memory leak sanitizer for run-time: asan/lsan.supp
Furthermore, added engine and replication suites for ASAN testing
routine.
Additionally to the tests blacklisted within #4359,
'box/on_shutdown.test.lua' is also disabled since it fails the
introduced leak check. All blacklisted tests have to be enabled
within #4360.
Close #2058
---
.travis.mk | 17 ++++--
asan/asan.supp | 17 ++++++
asan/lsan.supp | 105 ++++++++++++++++++++++++++++++++++
cmake/profile.cmake | 4 +-
test/box/on_shutdown.skipcond | 7 +++
5 files changed, 142 insertions(+), 8 deletions(-)
create mode 100644 asan/asan.supp
create mode 100644 asan/lsan.supp
create mode 100644 test/box/on_shutdown.skipcond
diff --git a/.travis.mk b/.travis.mk
index 42969ff56..efbc00ba1 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -111,15 +111,20 @@ coverage_debian: deps_debian test_coverage_debian_no_deps
# ASAN
build_asan_debian:
- CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
- CC=clang-8 CXX=clang++-8 cmake . -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
+ CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DENABLE_WERROR=ON -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
make -j
test_asan_debian_no_deps: build_asan_debian
- # temporary excluded engine/ and replication/ suites with some tests from other suites by issue #4360
- cd test && ASAN=ON ASAN_OPTIONS=detect_leaks=0 ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) \
- app/ app-tap/ box/ box-py/ box-tap/ engine_long/ long_run-py/ luajit-tap/ \
- replication-py/ small/ sql/ sql-tap/ swim/ unit/ vinyl/ wal_off/ xlog/ xlog-py/
+ # Temporary excluded some tests by issue #4360:
+ # - To exclude tests from ASAN checks the asan/asan.supp file
+ # was set at the build time in cmake/profile.cmake file.
+ # - To exclude tests from LSAN checks the asan/lsan.supp file
+ # was set in environment options to be used at run time.
+ cd test && ASAN=ON \
+ LSAN_OPTIONS=suppressions=${PWD}/asan/lsan.supp \
+ ASAN_OPTIONS=heap_profile=0:unmap_shadow_on_exit=1:detect_invalid_pointer_pairs=1:symbolize=1:detect_leaks=1:dump_instruction_bytes=1:print_suppressions=0 \
+ ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
test_asan_debian: deps_debian deps_buster_clang_8 test_asan_debian_no_deps
diff --git a/asan/asan.supp b/asan/asan.supp
new file mode 100644
index 000000000..2a20114f4
--- /dev/null
+++ b/asan/asan.supp
@@ -0,0 +1,17 @@
+# File format:
+#fun:*
+#src:*
+
+# !test: app-tap/json.test.lua
+# source: third_party/lua-cjson/lua_cjson.c
+fun:json_decode
+
+# test: unit/base64.test.lua
+# source: third_party/base64.c
+fun:base64_decode_block
+# source: test/unit/base64.c
+fun:base64_test
+
+# !test: unit/msgpack.test
+# source: src/lib/msgpuck/test/msgpuck.c
+fun:test_mp_print
diff --git a/asan/lsan.supp b/asan/lsan.supp
new file mode 100644
index 000000000..a1237fb86
--- /dev/null
+++ b/asan/lsan.supp
@@ -0,0 +1,105 @@
+# File format:
+#leak:*
+
+# test: app/crypto.test.lua
+# source: /usr/lib/x86_64-linux-gnu/libcrypto.so
+leak:CRYPTO_zalloc
+
+# test: app-tap/http_client.test.lua
+# source: src/tarantool
+leak:Curl_setstropt
+leak:create_conn
+leak:Curl_conncache_add_conn
+leak:alloc_addbyter
+leak:Curl_getaddrinfo_ex
+leak:Curl_cache_addr
+leak:Curl_hash_init
+leak:Curl_hash_add
+leak:Curl_he2ai
+leak:Curl_open
+leak:Curl_resolver_init
+
+# test: app-tap/iconv.test.lua
+# source: /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
+leak:gconv_init
+
+# test: box*/
+# source: third_party/luajit
+leak:lj_BC_FUNCC
+
+# test: box/access.test.lua
+# test: box/access_bin.test.lua
+# test: box/access_misc.test.lua
+# source: src/box/error.cc
+leak:AccessDeniedError::AccessDeniedError
+
+# test: box/bitset.test.lua
+# source: src/lib/bitset/iterator.c
+leak:tt_bitset_iterator_init
+
+# test: box-py/args.test.py
+# source: /lib/x86_64-linux-gnu/libc.so*
+leak:libc.so*
+
+# test: box-tap/schema-mt.test.lua
+# source: src/lib/core/coio_task.c
+leak:coio_on_start
+# source: src/lib/salad/mhash.h
+leak:mh_i32ptr_new
+
+# test: replication/misc.test.lua
+# source: src/box/vy_log.c
+leak:vy_recovery_new_f
+# source: src/lib/salad/mhash.h
+leak:mh_i64ptr_new
+
+# test: sql-tap/gh2250-trigger-chain-limit.test.lua
+# source: src/lib/core/exception.cc
+leak:Exception::operator new
+
+# test: sql-tap/trigger9.test.lua
+# source: src/lib/core/fiber.c
+leak:cord_start
+
+# test: sql-tap/tkt-7bbfb7d442.test.lua
+# test: sql-tap/view.test.lua
+# test: sql-tap/with1.test.lua
+# test: sql-tap/with2.test.lua
+# source: src/box/sql/malloc.c
+leak:sql_sized_malloc
+
+# test: swim/errinj.test.lua
+# test: swim/swim.test.lua
+# source: src/lib/swim/swim.c
+leak:swim_member_new
+leak:swim_update_member_payload
+
+# !test: unit/bps_tree.test.lua
+# source: src/lib/salad/bps_tree.h
+leak:bps_tree_test_create_leaf
+leak:bps_tree_test_process_insert_leaf
+
+# !test: unit/heap.test.lua
+# source: test/unit/heap.c
+leak:test_random_delete_workload
+leak:test_delete_last_node
+
+# !test: unit/heap_iterator.test.lua
+# source: src/lib/salad/heap.h
+leak:test_heap_reserve
+
+# !test: unit/swim.test.lua
+# source: src/lib/swim/swim_io.c
+leak:swim_scheduler_set_codec
+
+# test: vinyl/errinj.test.lua
+# source: src/lib/core/fiber.h
+leak:fiber_cxx_invoke
+
+# test: vinyl/errinj_ddl.test.lua
+# source: src/box/vy_stmt.c
+leak:vy_stmt_alloc
+
+# test: vinyl/recover.test.lua
+# source: src/lib/core/fiber.c
+leak:cord_costart_thread_func
diff --git a/cmake/profile.cmake b/cmake/profile.cmake
index 0ba31fa2c..bc4bf67f5 100644
--- a/cmake/profile.cmake
+++ b/cmake/profile.cmake
@@ -53,7 +53,7 @@ if (ENABLE_ASAN)
"\n")
endif()
- set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
+ set(CMAKE_REQUIRED_FLAGS "-fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp")
check_c_source_compiles("int main(void) {
#include <sanitizer/asan_interface.h>
void *x;
@@ -76,5 +76,5 @@ if (ENABLE_ASAN)
message(FATAL_ERROR "Cannot enable AddressSanitizer")
endif()
- add_compile_flags("C;CXX" -fsanitize=address)
+ add_compile_flags("C;CXX" -fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp)
endif()
diff --git a/test/box/on_shutdown.skipcond b/test/box/on_shutdown.skipcond
new file mode 100644
index 000000000..e46fd1088
--- /dev/null
+++ b/test/box/on_shutdown.skipcond
@@ -0,0 +1,7 @@
+import os
+
+# Disabled at ASAN build due to issue #4360.
+if os.getenv("ASAN") == 'ON':
+ self.skip = 1
+
+# vim: set ft=python:
--
2.17.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN
2020-01-20 10:50 [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN Alexander V. Tikhonov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout Alexander V. Tikhonov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN Alexander V. Tikhonov
@ 2020-01-21 14:25 ` Igor Munkin
2 siblings, 0 replies; 9+ messages in thread
From: Igor Munkin @ 2020-01-21 14:25 UTC (permalink / raw)
To: Alexander V. Tikhonov; +Cc: tarantool-patches
Sasha Ti.,
Thanks, LGTM.
### NB:
AFAICS, there are also two more branches related to the issue: one for
1.10[1] and one for 2.2[2]. Please consider the following actions:
* Explicitly specify the target branches for the current patchset
* Adjust the braches for 1.10 and 2.2 regarding the comments I left for
the first version of the series
Sasha Tu. please proceed with the patchset.
On 20.01.20, Alexander V. Tikhonov wrote:
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-2058-asan-with-leaks
> Issue: https://github.com/tarantool/tarantool/issues/2058
>
> v1: https://lists.tarantool.org/pipermail/tarantool-patches/2020-January/013682.html
>
> Changes v2:
> - made suggested corrections
>
> Changes v1:
> - initial version
>
> Alexander V. Tikhonov (2):
> test: use default replication connection timeout
> gitlab-ci: add memory leaks detection via LSAN
>
> .travis.mk | 17 ++-
> asan/asan.supp | 17 +++
> asan/lsan.supp | 105 ++++++++++++++++++
> cmake/profile.cmake | 4 +-
> test/box/on_shutdown.skipcond | 7 ++
> test/replication/autobootstrap.lua | 2 -
> test/replication/autobootstrap.result | 2 +-
> test/replication/autobootstrap.test.lua | 2 +-
> test/replication/autobootstrap_guest.lua | 2 -
> test/replication/before_replace.result | 6 +-
> test/replication/before_replace.test.lua | 6 +-
> test/replication/ddl.lua | 2 -
> test/replication/hot_standby.lua | 1 -
> test/replication/master.lua | 1 -
> test/replication/master_quorum.lua | 2 -
> test/replication/on_replace.lua | 2 -
> test/replication/quorum.lua | 2 -
> test/replication/quorum.result | 15 ++-
> test/replication/quorum.test.lua | 15 ++-
> test/replication/rebootstrap.lua | 2 -
> test/replication/rebootstrap.result | 4 +-
> test/replication/rebootstrap.test.lua | 4 +-
> test/replication/recover_missing_xlog.result | 2 +-
> .../replication/recover_missing_xlog.test.lua | 2 +-
> test/replication/replica.lua | 1 -
> test/replication/replica_auth.lua | 2 -
> test/replication/replica_no_quorum.lua | 1 -
> test/replication/replica_quorum.lua | 2 -
> test/replication/replica_timeout.lua | 2 -
> test/replication/replica_uuid.lua | 1 -
> test/replication/replica_uuid_ro.lua | 2 -
> test/replication/replicaset_ro_mostly.result | 2 +-
> .../replication/replicaset_ro_mostly.test.lua | 2 +-
> test/replication/wal_off.lua | 1 -
> 34 files changed, 172 insertions(+), 68 deletions(-)
> create mode 100644 asan/asan.supp
> create mode 100644 asan/lsan.supp
> create mode 100644 test/box/on_shutdown.skipcond
>
> --
> 2.17.1
>
[1]: https://github.com/tarantool/tarantool/tree/avtikhon/gh-2058-asan-with-leaks_1.10
[2]: https://github.com/tarantool/tarantool/tree/avtikhon/gh-2058-asan-with-leaks_2.2
--
Best regards,
IM
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN Alexander V. Tikhonov
@ 2020-03-27 14:06 ` Sergey Bronnikov
2020-03-30 7:53 ` Alexander Tikhonov
0 siblings, 1 reply; 9+ messages in thread
From: Sergey Bronnikov @ 2020-03-27 14:06 UTC (permalink / raw)
To: Alexander V. Tikhonov; +Cc: tarantool-patches
I have no objections, so LGTM.
One question: there are some ASAN supressions related to our own code
without reference to tickets or any other resource with explanation why
we have added this supression or when we want to fix it. Looks like we
decided to silently mute warnings and forget about it. Please clarify.
Sergey
On 13:50 Mon 20 Jan , Alexander V. Tikhonov wrote:
> The change enables memory leaks detection to existing ASAN testing
> routine and introduces suppression files with the corresponding
> exception list:
> * address sanitizer for compile-time: asan/asan.supp
> * memory leak sanitizer for run-time: asan/lsan.supp
>
> Furthermore, added engine and replication suites for ASAN testing
> routine.
>
> Additionally to the tests blacklisted within #4359,
> 'box/on_shutdown.test.lua' is also disabled since it fails the
> introduced leak check. All blacklisted tests have to be enabled
> within #4360.
>
> Close #2058
> ---
> .travis.mk | 17 ++++--
> asan/asan.supp | 17 ++++++
> asan/lsan.supp | 105 ++++++++++++++++++++++++++++++++++
> cmake/profile.cmake | 4 +-
> test/box/on_shutdown.skipcond | 7 +++
> 5 files changed, 142 insertions(+), 8 deletions(-)
> create mode 100644 asan/asan.supp
> create mode 100644 asan/lsan.supp
> create mode 100644 test/box/on_shutdown.skipcond
>
> diff --git a/.travis.mk b/.travis.mk
> index 42969ff56..efbc00ba1 100644
> --- a/.travis.mk
> +++ b/.travis.mk
> @@ -111,15 +111,20 @@ coverage_debian: deps_debian test_coverage_debian_no_deps
> # ASAN
>
> build_asan_debian:
> - CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
> - CC=clang-8 CXX=clang++-8 cmake . -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
> + CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
> + -DENABLE_WERROR=ON -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
> make -j
>
> test_asan_debian_no_deps: build_asan_debian
> - # temporary excluded engine/ and replication/ suites with some tests from other suites by issue #4360
> - cd test && ASAN=ON ASAN_OPTIONS=detect_leaks=0 ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) \
> - app/ app-tap/ box/ box-py/ box-tap/ engine_long/ long_run-py/ luajit-tap/ \
> - replication-py/ small/ sql/ sql-tap/ swim/ unit/ vinyl/ wal_off/ xlog/ xlog-py/
> + # Temporary excluded some tests by issue #4360:
> + # - To exclude tests from ASAN checks the asan/asan.supp file
> + # was set at the build time in cmake/profile.cmake file.
> + # - To exclude tests from LSAN checks the asan/lsan.supp file
> + # was set in environment options to be used at run time.
> + cd test && ASAN=ON \
> + LSAN_OPTIONS=suppressions=${PWD}/asan/lsan.supp \
> + ASAN_OPTIONS=heap_profile=0:unmap_shadow_on_exit=1:detect_invalid_pointer_pairs=1:symbolize=1:detect_leaks=1:dump_instruction_bytes=1:print_suppressions=0 \
> + ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
>
> test_asan_debian: deps_debian deps_buster_clang_8 test_asan_debian_no_deps
>
> diff --git a/asan/asan.supp b/asan/asan.supp
> new file mode 100644
> index 000000000..2a20114f4
> --- /dev/null
> +++ b/asan/asan.supp
> @@ -0,0 +1,17 @@
> +# File format:
> +#fun:*
> +#src:*
> +
> +# !test: app-tap/json.test.lua
> +# source: third_party/lua-cjson/lua_cjson.c
> +fun:json_decode
> +
> +# test: unit/base64.test.lua
> +# source: third_party/base64.c
> +fun:base64_decode_block
> +# source: test/unit/base64.c
> +fun:base64_test
> +
> +# !test: unit/msgpack.test
> +# source: src/lib/msgpuck/test/msgpuck.c
> +fun:test_mp_print
> diff --git a/asan/lsan.supp b/asan/lsan.supp
> new file mode 100644
> index 000000000..a1237fb86
> --- /dev/null
> +++ b/asan/lsan.supp
> @@ -0,0 +1,105 @@
> +# File format:
> +#leak:*
> +
> +# test: app/crypto.test.lua
> +# source: /usr/lib/x86_64-linux-gnu/libcrypto.so
> +leak:CRYPTO_zalloc
> +
> +# test: app-tap/http_client.test.lua
> +# source: src/tarantool
> +leak:Curl_setstropt
> +leak:create_conn
> +leak:Curl_conncache_add_conn
> +leak:alloc_addbyter
> +leak:Curl_getaddrinfo_ex
> +leak:Curl_cache_addr
> +leak:Curl_hash_init
> +leak:Curl_hash_add
> +leak:Curl_he2ai
> +leak:Curl_open
> +leak:Curl_resolver_init
> +
> +# test: app-tap/iconv.test.lua
> +# source: /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
> +leak:gconv_init
> +
> +# test: box*/
> +# source: third_party/luajit
> +leak:lj_BC_FUNCC
> +
> +# test: box/access.test.lua
> +# test: box/access_bin.test.lua
> +# test: box/access_misc.test.lua
> +# source: src/box/error.cc
> +leak:AccessDeniedError::AccessDeniedError
> +
> +# test: box/bitset.test.lua
> +# source: src/lib/bitset/iterator.c
> +leak:tt_bitset_iterator_init
> +
> +# test: box-py/args.test.py
> +# source: /lib/x86_64-linux-gnu/libc.so*
> +leak:libc.so*
> +
> +# test: box-tap/schema-mt.test.lua
> +# source: src/lib/core/coio_task.c
> +leak:coio_on_start
> +# source: src/lib/salad/mhash.h
> +leak:mh_i32ptr_new
> +
> +# test: replication/misc.test.lua
> +# source: src/box/vy_log.c
> +leak:vy_recovery_new_f
> +# source: src/lib/salad/mhash.h
> +leak:mh_i64ptr_new
> +
> +# test: sql-tap/gh2250-trigger-chain-limit.test.lua
> +# source: src/lib/core/exception.cc
> +leak:Exception::operator new
> +
> +# test: sql-tap/trigger9.test.lua
> +# source: src/lib/core/fiber.c
> +leak:cord_start
> +
> +# test: sql-tap/tkt-7bbfb7d442.test.lua
> +# test: sql-tap/view.test.lua
> +# test: sql-tap/with1.test.lua
> +# test: sql-tap/with2.test.lua
> +# source: src/box/sql/malloc.c
> +leak:sql_sized_malloc
> +
> +# test: swim/errinj.test.lua
> +# test: swim/swim.test.lua
> +# source: src/lib/swim/swim.c
> +leak:swim_member_new
> +leak:swim_update_member_payload
> +
> +# !test: unit/bps_tree.test.lua
> +# source: src/lib/salad/bps_tree.h
> +leak:bps_tree_test_create_leaf
> +leak:bps_tree_test_process_insert_leaf
> +
> +# !test: unit/heap.test.lua
> +# source: test/unit/heap.c
> +leak:test_random_delete_workload
> +leak:test_delete_last_node
> +
> +# !test: unit/heap_iterator.test.lua
> +# source: src/lib/salad/heap.h
> +leak:test_heap_reserve
> +
> +# !test: unit/swim.test.lua
> +# source: src/lib/swim/swim_io.c
> +leak:swim_scheduler_set_codec
> +
> +# test: vinyl/errinj.test.lua
> +# source: src/lib/core/fiber.h
> +leak:fiber_cxx_invoke
> +
> +# test: vinyl/errinj_ddl.test.lua
> +# source: src/box/vy_stmt.c
> +leak:vy_stmt_alloc
> +
> +# test: vinyl/recover.test.lua
> +# source: src/lib/core/fiber.c
> +leak:cord_costart_thread_func
> diff --git a/cmake/profile.cmake b/cmake/profile.cmake
> index 0ba31fa2c..bc4bf67f5 100644
> --- a/cmake/profile.cmake
> +++ b/cmake/profile.cmake
> @@ -53,7 +53,7 @@ if (ENABLE_ASAN)
> "\n")
> endif()
>
> - set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
> + set(CMAKE_REQUIRED_FLAGS "-fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp")
> check_c_source_compiles("int main(void) {
> #include <sanitizer/asan_interface.h>
> void *x;
> @@ -76,5 +76,5 @@ if (ENABLE_ASAN)
> message(FATAL_ERROR "Cannot enable AddressSanitizer")
> endif()
>
> - add_compile_flags("C;CXX" -fsanitize=address)
> + add_compile_flags("C;CXX" -fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp)
> endif()
> diff --git a/test/box/on_shutdown.skipcond b/test/box/on_shutdown.skipcond
> new file mode 100644
> index 000000000..e46fd1088
> --- /dev/null
> +++ b/test/box/on_shutdown.skipcond
> @@ -0,0 +1,7 @@
> +import os
> +
> +# Disabled at ASAN build due to issue #4360.
> +if os.getenv("ASAN") == 'ON':
> + self.skip = 1
> +
> +# vim: set ft=python:
> --
> 2.17.1
>
--
sergeyb@
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout Alexander V. Tikhonov
@ 2020-03-27 14:07 ` Sergey Bronnikov
0 siblings, 0 replies; 9+ messages in thread
From: Sergey Bronnikov @ 2020-03-27 14:07 UTC (permalink / raw)
To: Alexander V. Tikhonov; +Cc: tarantool-patches
Hi,
LGTM, thanks for the patch.
On 13:50 Mon 20 Jan , Alexander V. Tikhonov wrote:
> All local connection timeout settings not related to the testing
> scenario are removed within this change. Instead of removed values
> the default one from src/box/lua/load_cfg.lua will be used.
> The approach with a single default value helps to avoid flaky test
> results regarding different timeout values and makes the future
> maintainence easier.
>
> The change is required for LSAN and ASAN testing machinery since it
> introduces a little overhead and cause failures for tests with
> excessively strict time limits.
>
> Needed for #2058
> ---
> test/replication/autobootstrap.lua | 2 --
> test/replication/autobootstrap.result | 2 +-
> test/replication/autobootstrap.test.lua | 2 +-
> test/replication/autobootstrap_guest.lua | 2 --
> test/replication/before_replace.result | 6 +++---
> test/replication/before_replace.test.lua | 6 +++---
> test/replication/ddl.lua | 2 --
> test/replication/hot_standby.lua | 1 -
> test/replication/master.lua | 1 -
> test/replication/master_quorum.lua | 2 --
> test/replication/on_replace.lua | 2 --
> test/replication/quorum.lua | 2 --
> test/replication/quorum.result | 15 +++++++--------
> test/replication/quorum.test.lua | 15 +++++++--------
> test/replication/rebootstrap.lua | 2 --
> test/replication/rebootstrap.result | 4 ++--
> test/replication/rebootstrap.test.lua | 4 ++--
> test/replication/recover_missing_xlog.result | 2 +-
> test/replication/recover_missing_xlog.test.lua | 2 +-
> test/replication/replica.lua | 1 -
> test/replication/replica_auth.lua | 2 --
> test/replication/replica_no_quorum.lua | 1 -
> test/replication/replica_quorum.lua | 2 --
> test/replication/replica_timeout.lua | 2 --
> test/replication/replica_uuid.lua | 1 -
> test/replication/replica_uuid_ro.lua | 2 --
> test/replication/replicaset_ro_mostly.result | 2 +-
> test/replication/replicaset_ro_mostly.test.lua | 2 +-
> test/replication/wal_off.lua | 1 -
> 29 files changed, 30 insertions(+), 60 deletions(-)
>
> diff --git a/test/replication/autobootstrap.lua b/test/replication/autobootstrap.lua
> index 856b36e66..6d01fb2da 100644
> --- a/test/replication/autobootstrap.lua
> +++ b/test/replication/autobootstrap.lua
> @@ -6,7 +6,6 @@ local USER = 'cluster'
> local PASSWORD = 'somepassword'
> local SOCKET_DIR = require('fio').cwd()
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -25,7 +24,6 @@ box.cfg({
> USER..':'..PASSWORD..'@'..instance_uri(3);
> };
> replication_timeout = TIMEOUT;
> - replication_connect_timeout = CON_TIMEOUT;
> })
>
> box.once("bootstrap", function()
> diff --git a/test/replication/autobootstrap.result b/test/replication/autobootstrap.result
> index 743982d47..ec9667663 100644
> --- a/test/replication/autobootstrap.result
> +++ b/test/replication/autobootstrap.result
> @@ -188,7 +188,7 @@ box.space.test_u:select()
> _ = test_run:cmd("switch autobootstrap1")
> ---
> ...
> -_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1 0.5'")
> +_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1'")
> _ = box.space.test_u:replace({5, 6, 7, 8})
> ---
> ...
> diff --git a/test/replication/autobootstrap.test.lua b/test/replication/autobootstrap.test.lua
> index 055ea4277..8c75d1322 100644
> --- a/test/replication/autobootstrap.test.lua
> +++ b/test/replication/autobootstrap.test.lua
> @@ -86,7 +86,7 @@ box.space.test_u:select()
> -- Rebootstrap one node and check that others follow.
> --
> _ = test_run:cmd("switch autobootstrap1")
> -_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1 0.5'")
> +_ = test_run:cmd("restart server autobootstrap1 with cleanup=1, args ='0.1'")
>
> _ = box.space.test_u:replace({5, 6, 7, 8})
> box.space.test_u:select()
> diff --git a/test/replication/autobootstrap_guest.lua b/test/replication/autobootstrap_guest.lua
> index d7176ae5b..54febd1b6 100644
> --- a/test/replication/autobootstrap_guest.lua
> +++ b/test/replication/autobootstrap_guest.lua
> @@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -25,7 +24,6 @@ box.cfg({
> instance_uri(3);
> };
> replication_timeout = TIMEOUT;
> - replication_connect_timeout = CON_TIMEOUT;
> })
>
> box.once("bootstrap", function()
> diff --git a/test/replication/before_replace.result b/test/replication/before_replace.result
> index ced40547e..ce66718d1 100644
> --- a/test/replication/before_replace.result
> +++ b/test/replication/before_replace.result
> @@ -138,7 +138,7 @@ box.space.test:select()
> - [9, 90]
> - [10, 100]
> ...
> -test_run:cmd('restart server autobootstrap1 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap1 with args="0.1"')
> box.space.test:select()
> ---
> - - [1, 10]
> @@ -169,7 +169,7 @@ box.space.test:select()
> - [9, 90]
> - [10, 100]
> ...
> -test_run:cmd('restart server autobootstrap2 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap2 with args="0.1"')
> box.space.test:select()
> ---
> - - [1, 10]
> @@ -204,7 +204,7 @@ push_err
> ---
> - Session 'applier' does not support push()
> ...
> -test_run:cmd('restart server autobootstrap3 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap3 with args="0.1"')
> box.space.test:select()
> ---
> - - [1, 10]
> diff --git a/test/replication/before_replace.test.lua b/test/replication/before_replace.test.lua
> index bcc6dc00d..3b9910cbc 100644
> --- a/test/replication/before_replace.test.lua
> +++ b/test/replication/before_replace.test.lua
> @@ -65,16 +65,16 @@ vclock2 = test_run:wait_cluster_vclock(SERVERS, vclock)
> -- and the state persists after restart.
> test_run:cmd("switch autobootstrap1")
> box.space.test:select()
> -test_run:cmd('restart server autobootstrap1 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap1 with args="0.1"')
> box.space.test:select()
> test_run:cmd("switch autobootstrap2")
> box.space.test:select()
> -test_run:cmd('restart server autobootstrap2 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap2 with args="0.1"')
> box.space.test:select()
> test_run:cmd("switch autobootstrap3")
> box.space.test:select()
> push_err
> -test_run:cmd('restart server autobootstrap3 with args="0.1 0.5"')
> +test_run:cmd('restart server autobootstrap3 with args="0.1"')
> box.space.test:select()
>
> -- Cleanup.
> diff --git a/test/replication/ddl.lua b/test/replication/ddl.lua
> index 72cf1db69..2db977d46 100644
> --- a/test/replication/ddl.lua
> +++ b/test/replication/ddl.lua
> @@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -27,7 +26,6 @@ box.cfg({
> USER..':'..PASSWORD..'@'..instance_uri(4);
> };
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT,
> })
>
> box.once("bootstrap", function()
> diff --git a/test/replication/hot_standby.lua b/test/replication/hot_standby.lua
> index cd53fc776..30742ce4f 100644
> --- a/test/replication/hot_standby.lua
> +++ b/test/replication/hot_standby.lua
> @@ -10,6 +10,5 @@ box.cfg({
> vinyl_dir = "master",
> hot_standby = true,
> replication_timeout = 0.1,
> - replication_connect_timeout = 0.5,
> })
>
> diff --git a/test/replication/master.lua b/test/replication/master.lua
> index 9b96b7891..e924b5495 100644
> --- a/test/replication/master.lua
> +++ b/test/replication/master.lua
> @@ -3,7 +3,6 @@ os = require('os')
> box.cfg({
> listen = os.getenv("LISTEN"),
> memtx_memory = 107374182,
> - replication_connect_timeout = 0.5,
> replication_timeout = 0.1
> })
>
> diff --git a/test/replication/master_quorum.lua b/test/replication/master_quorum.lua
> index 05272ac5e..20f161cc0 100644
> --- a/test/replication/master_quorum.lua
> +++ b/test/replication/master_quorum.lua
> @@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -25,7 +24,6 @@ box.cfg({
> };
> replication_connect_quorum = 0;
> replication_timeout = TIMEOUT;
> - replication_connect_timeout = CON_TIMEOUT;
> })
>
> test_run = require('test_run').new()
> diff --git a/test/replication/on_replace.lua b/test/replication/on_replace.lua
> index 40c12a9ea..71e63d3f9 100644
> --- a/test/replication/on_replace.lua
> +++ b/test/replication/on_replace.lua
> @@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -28,7 +27,6 @@ box.cfg({
> USER..':'..PASSWORD..'@'..instance_uri(2);
> };
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT,
> })
>
> box.once("bootstrap", function()
> diff --git a/test/replication/quorum.lua b/test/replication/quorum.lua
> index f61c8748f..129e676e0 100644
> --- a/test/replication/quorum.lua
> +++ b/test/replication/quorum.lua
> @@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -20,7 +19,6 @@ box.cfg({
> listen = instance_uri(INSTANCE_ID);
> replication_timeout = TIMEOUT;
> replication_sync_lag = 0.01;
> - replication_connect_timeout = CON_TIMEOUT;
> replication_connect_quorum = 3;
> replication = {
> instance_uri(1);
> diff --git a/test/replication/quorum.result b/test/replication/quorum.result
> index 07abe7f2a..8ea9fa22e 100644
> --- a/test/replication/quorum.result
> +++ b/test/replication/quorum.result
> @@ -27,7 +27,7 @@ test_run:cmd('switch quorum2')
> ---
> - true
> ...
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> ---
> - orphan
> @@ -55,7 +55,7 @@ box.info.status -- running
> ---
> - running
> ...
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> ---
> - orphan
> @@ -86,7 +86,7 @@ box.info.status -- running
> ---
> - running
> ...
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> ---
> - orphan
> @@ -103,7 +103,7 @@ box.space.test:replace{100} -- error
> ---
> - error: Can't modify data because this instance is in read-only mode.
> ...
> -test_run:cmd('start server quorum1 with args="0.1 0.5"')
> +test_run:cmd('start server quorum1 with args="0.1"')
> ---
> - true
> ...
> @@ -166,7 +166,7 @@ fiber = require('fiber')
> fiber.sleep(0.1)
> ---
> ...
> -test_run:cmd('start server quorum1 with args="0.1 0.5"')
> +test_run:cmd('start server quorum1 with args="0.1"')
> ---
> - true
> ...
> @@ -204,7 +204,7 @@ test_run:cmd('switch quorum1')
> ---
> - true
> ...
> -test_run:cmd('restart server quorum1 with cleanup=1, args="0.1 0.5"')
> +test_run:cmd('restart server quorum1 with cleanup=1, args="0.1"')
> test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
> ---
> - true
> @@ -419,10 +419,9 @@ test_run:cmd('create server replica_quorum with script="replication/replica_quor
> - true
> ...
> -- Arguments are: replication_connect_quorum, replication_timeout
> --- replication_connect_timeout.
> -- If replication_connect_quorum was ignored here, the instance
> -- would exit with an error.
> -test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05 0.1"')
> +test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05"')
> ---
> - true
> ...
> diff --git a/test/replication/quorum.test.lua b/test/replication/quorum.test.lua
> index 5f2872675..31be48fc2 100644
> --- a/test/replication/quorum.test.lua
> +++ b/test/replication/quorum.test.lua
> @@ -18,7 +18,7 @@ test_run:cmd('stop server quorum1')
>
> test_run:cmd('switch quorum2')
>
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> box.ctl.wait_rw(0.001) -- timeout
> box.info.ro -- true
> @@ -27,7 +27,7 @@ box.space.test:replace{100} -- error
> box.cfg{replication={}}
> box.info.status -- running
>
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> box.ctl.wait_rw(0.001) -- timeout
> box.info.ro -- true
> @@ -37,12 +37,12 @@ box.ctl.wait_rw()
> box.info.ro -- false
> box.info.status -- running
>
> -test_run:cmd('restart server quorum2 with args="0.1 0.5"')
> +test_run:cmd('restart server quorum2 with args="0.1"')
> box.info.status -- orphan
> box.ctl.wait_rw(0.001) -- timeout
> box.info.ro -- true
> box.space.test:replace{100} -- error
> -test_run:cmd('start server quorum1 with args="0.1 0.5"')
> +test_run:cmd('start server quorum1 with args="0.1"')
> box.ctl.wait_rw()
> box.info.ro -- false
> box.info.status -- running
> @@ -65,7 +65,7 @@ for i = 1, 100 do box.space.test:insert{i} end
> fiber = require('fiber')
> fiber.sleep(0.1)
>
> -test_run:cmd('start server quorum1 with args="0.1 0.5"')
> +test_run:cmd('start server quorum1 with args="0.1"')
> test_run:cmd('switch quorum1')
> test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
>
> @@ -81,7 +81,7 @@ test_run:cmd('switch quorum2')
> box.snapshot()
>
> test_run:cmd('switch quorum1')
> -test_run:cmd('restart server quorum1 with cleanup=1, args="0.1 0.5"')
> +test_run:cmd('restart server quorum1 with cleanup=1, args="0.1"')
>
> test_run:wait_cond(function() return box.space.test:count() == 100 end, 20)
>
> @@ -157,10 +157,9 @@ test_run:drop_cluster(SERVERS)
> box.schema.user.grant('guest', 'replication')
> test_run:cmd('create server replica_quorum with script="replication/replica_quorum.lua"')
> -- Arguments are: replication_connect_quorum, replication_timeout
> --- replication_connect_timeout.
> -- If replication_connect_quorum was ignored here, the instance
> -- would exit with an error.
> -test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05 0.1"')
> +test_run:cmd('start server replica_quorum with wait=True, wait_load=True, args="1 0.05"')
> test_run:cmd('switch replica_quorum')
> -- If replication_connect_quorum was ignored here, the instance
> -- would exit with an error.
> diff --git a/test/replication/rebootstrap.lua b/test/replication/rebootstrap.lua
> index 3e7d8f062..e8405e9d9 100644
> --- a/test/replication/rebootstrap.lua
> +++ b/test/replication/rebootstrap.lua
> @@ -6,7 +6,6 @@ local INSTANCE_ID = string.match(arg[0], "%d")
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> local function instance_uri(instance_id)
> return SOCKET_DIR..'/rebootstrap'..instance_id..'.sock';
> @@ -19,7 +18,6 @@ box.cfg({
> listen = instance_uri(INSTANCE_ID),
> instance_uuid = '12345678-abcd-1234-abcd-123456789ef' .. INSTANCE_ID,
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT,
> replication = {
> instance_uri(1);
> instance_uri(2);
> diff --git a/test/replication/rebootstrap.result b/test/replication/rebootstrap.result
> index ea390c19f..d5e4d3967 100644
> --- a/test/replication/rebootstrap.result
> +++ b/test/replication/rebootstrap.result
> @@ -20,11 +20,11 @@ test_run:cmd('stop server rebootstrap1')
> ---
> - true
> ...
> -test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1 2.0"')
> +test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1"')
> ---
> - true
> ...
> -test_run:cmd('start server rebootstrap1 with args="0.1 0.5"')
> +test_run:cmd('start server rebootstrap1 with args="0.1"')
> ---
> - true
> ...
> diff --git a/test/replication/rebootstrap.test.lua b/test/replication/rebootstrap.test.lua
> index 8ddf77912..f532c4305 100644
> --- a/test/replication/rebootstrap.test.lua
> +++ b/test/replication/rebootstrap.test.lua
> @@ -12,8 +12,8 @@ test_run:wait_fullmesh(SERVERS)
> -- in 'orphan' mode.
> --
> test_run:cmd('stop server rebootstrap1')
> -test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1 2.0"')
> -test_run:cmd('start server rebootstrap1 with args="0.1 0.5"')
> +test_run:cmd('restart server rebootstrap2 with cleanup=True, wait=False, wait_load=False, args="0.1"')
> +test_run:cmd('start server rebootstrap1 with args="0.1"')
> test_run:cmd('switch rebootstrap1')
> box.info.status -- running
>
> diff --git a/test/replication/recover_missing_xlog.result b/test/replication/recover_missing_xlog.result
> index ef4c29e50..f240be633 100644
> --- a/test/replication/recover_missing_xlog.result
> +++ b/test/replication/recover_missing_xlog.result
> @@ -69,7 +69,7 @@ fio.unlink(list[#list])
> ---
> - true
> ...
> -test_run:cmd('start server autobootstrap1 with args="0.1 0.5"')
> +test_run:cmd('start server autobootstrap1 with args="0.1"')
> ---
> - true
> ...
> diff --git a/test/replication/recover_missing_xlog.test.lua b/test/replication/recover_missing_xlog.test.lua
> index 2cd73520f..499107e94 100644
> --- a/test/replication/recover_missing_xlog.test.lua
> +++ b/test/replication/recover_missing_xlog.test.lua
> @@ -29,7 +29,7 @@ fio = require('fio')
> -- in 'read-only' mode unless it receives all data.
> list = fio.glob(fio.pathjoin(fio.abspath("."), 'autobootstrap1/*.xlog'))
> fio.unlink(list[#list])
> -test_run:cmd('start server autobootstrap1 with args="0.1 0.5"')
> +test_run:cmd('start server autobootstrap1 with args="0.1"')
>
> test_run:cmd("switch autobootstrap1")
> for i = 10, 19 do box.space.test:insert{i, 'test' .. i} end
> diff --git a/test/replication/replica.lua b/test/replication/replica.lua
> index 20ac064e1..b8ab87c33 100644
> --- a/test/replication/replica.lua
> +++ b/test/replication/replica.lua
> @@ -5,7 +5,6 @@ box.cfg({
> replication = os.getenv("MASTER"),
> memtx_memory = 107374182,
> replication_timeout = 0.1,
> - replication_connect_timeout = 0.5,
> })
>
> require('console').listen(os.getenv('ADMIN'))
> diff --git a/test/replication/replica_auth.lua b/test/replication/replica_auth.lua
> index 22ba9146c..61d046fc4 100644
> --- a/test/replication/replica_auth.lua
> +++ b/test/replication/replica_auth.lua
> @@ -2,7 +2,6 @@
>
> local USER_PASS = arg[1]
> local TIMEOUT = arg[2] and tonumber(arg[2]) or 0.1
> -local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
>
> require('console').listen(os.getenv('ADMIN'))
>
> @@ -10,5 +9,4 @@ box.cfg({
> listen = os.getenv("LISTEN"),
> replication = USER_PASS .. "@" .. os.getenv("MASTER"),
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT
> })
> diff --git a/test/replication/replica_no_quorum.lua b/test/replication/replica_no_quorum.lua
> index c30c043cc..5868eb77b 100644
> --- a/test/replication/replica_no_quorum.lua
> +++ b/test/replication/replica_no_quorum.lua
> @@ -6,7 +6,6 @@ box.cfg({
> memtx_memory = 107374182,
> replication_connect_quorum = 0,
> replication_timeout = 0.1,
> - replication_connect_timeout = 0.5,
> })
>
> require('console').listen(os.getenv('ADMIN'))
> diff --git a/test/replication/replica_quorum.lua b/test/replication/replica_quorum.lua
> index dd42b8214..fe51da802 100644
> --- a/test/replication/replica_quorum.lua
> +++ b/test/replication/replica_quorum.lua
> @@ -4,7 +4,6 @@ local SOCKET_DIR = require('fio').cwd()
>
> local QUORUM = tonumber(arg[1])
> local TIMEOUT = arg[2] and tonumber(arg[2]) or 0.1
> -local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
> INSTANCE_URI = SOCKET_DIR .. '/replica_quorum.sock'
>
> function nonexistent_uri(id)
> @@ -16,7 +15,6 @@ require('console').listen(os.getenv('ADMIN'))
> box.cfg{
> listen = INSTANCE_URI,
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT,
> replication_connect_quorum = QUORUM,
> replication = {INSTANCE_URI,
> nonexistent_uri(1),
> diff --git a/test/replication/replica_timeout.lua b/test/replication/replica_timeout.lua
> index 38922fa3d..34fd9f946 100644
> --- a/test/replication/replica_timeout.lua
> +++ b/test/replication/replica_timeout.lua
> @@ -1,14 +1,12 @@
> #!/usr/bin/env tarantool
>
> local TIMEOUT = tonumber(arg[1])
> -local CON_TIMEOUT = arg[2] and tonumber(arg[2]) or 30.0
>
> box.cfg({
> listen = os.getenv("LISTEN"),
> replication = os.getenv("MASTER"),
> memtx_memory = 107374182,
> replication_timeout = TIMEOUT,
> - replication_connect_timeout = CON_TIMEOUT,
> })
>
> require('console').listen(os.getenv('ADMIN'))
> diff --git a/test/replication/replica_uuid.lua b/test/replication/replica_uuid.lua
> index 4343cfd5b..72138428a 100644
> --- a/test/replication/replica_uuid.lua
> +++ b/test/replication/replica_uuid.lua
> @@ -6,7 +6,6 @@ box.cfg({
> replication = os.getenv("MASTER"),
> memtx_memory = 107374182,
> replication_timeout = 0.1,
> - replication_connect_timeout = 0.5,
> })
>
> require('console').listen(os.getenv('ADMIN'))
> diff --git a/test/replication/replica_uuid_ro.lua b/test/replication/replica_uuid_ro.lua
> index d5ba55852..5c1a2f5b6 100644
> --- a/test/replication/replica_uuid_ro.lua
> +++ b/test/replication/replica_uuid_ro.lua
> @@ -7,7 +7,6 @@ local PASSWORD = 'somepassword'
> local SOCKET_DIR = require('fio').cwd()
>
> local TIMEOUT = tonumber(arg[2])
> -local CON_TIMEOUT = arg[3] and tonumber(arg[3]) or 30.0
>
> local function instance_uri(instance_id)
> --return 'localhost:'..(3310 + instance_id)
> @@ -27,7 +26,6 @@ box.cfg({
> };
> read_only = (INSTANCE_ID ~= '1' and true or false);
> replication_timeout = TIMEOUT;
> - replication_connect_timeout = CON_TIMEOUT;
> })
>
> box.once("bootstrap", function()
> diff --git a/test/replication/replicaset_ro_mostly.result b/test/replication/replicaset_ro_mostly.result
> index 1ce7d6f8e..a471779d3 100644
> --- a/test/replication/replicaset_ro_mostly.result
> +++ b/test/replication/replicaset_ro_mostly.result
> @@ -27,7 +27,7 @@ UUID = sort({uuid1, uuid2}, sort_cmp)
> create_cluster_cmd1 = 'create server %s with script="replication/%s.lua"'
> ---
> ...
> -create_cluster_cmd2 = 'start server %s with args="%s %s", wait_load=False, wait=False'
> +create_cluster_cmd2 = 'start server %s with args="%s", wait_load=False, wait=False'
> ---
> ...
> test_run:cmd("setopt delimiter ';'")
> diff --git a/test/replication/replicaset_ro_mostly.test.lua b/test/replication/replicaset_ro_mostly.test.lua
> index c75af7218..19cd1fe4a 100644
> --- a/test/replication/replicaset_ro_mostly.test.lua
> +++ b/test/replication/replicaset_ro_mostly.test.lua
> @@ -12,7 +12,7 @@ function sort(t) table.sort(t, sort_cmp) return t end
> UUID = sort({uuid1, uuid2}, sort_cmp)
>
> create_cluster_cmd1 = 'create server %s with script="replication/%s.lua"'
> -create_cluster_cmd2 = 'start server %s with args="%s %s", wait_load=False, wait=False'
> +create_cluster_cmd2 = 'start server %s with args="%s", wait_load=False, wait=False'
>
> test_run:cmd("setopt delimiter ';'")
> function create_cluster_uuid(servers, uuids)
> diff --git a/test/replication/wal_off.lua b/test/replication/wal_off.lua
> index cfd488e4d..9da53ba98 100644
> --- a/test/replication/wal_off.lua
> +++ b/test/replication/wal_off.lua
> @@ -6,7 +6,6 @@ box.cfg({
> memtx_memory = 107374182,
> wal_mode = 'none',
> replication_timeout = 0.1,
> - replication_connect_timeout = 0.5,
> })
>
> require('console').listen(os.getenv('ADMIN'))
> --
> 2.17.1
>
--
sergeyb@
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN
2020-03-27 14:06 ` Sergey Bronnikov
@ 2020-03-30 7:53 ` Alexander Tikhonov
2020-03-30 8:09 ` Sergey Bronnikov
0 siblings, 1 reply; 9+ messages in thread
From: Alexander Tikhonov @ 2020-03-30 7:53 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 8121 bytes --]
Hi Sergey, thanks for the review, we decided to have separate issue for the exclusions:
https://github.com/tarantool/tarantool/issues/4360
During fixing the exclusions step-by-step the new issues will be created for each of them if it will be needed.
>Пятница, 27 марта 2020, 17:06 +03:00 от Sergey Bronnikov <sergeyb@tarantool.org>:
>
>I have no objections, so LGTM.
>
>One question: there are some ASAN supressions related to our own code
>without reference to tickets or any other resource with explanation why
>we have added this supression or when we want to fix it. Looks like we
>decided to silently mute warnings and forget about it. Please clarify.
>
>Sergey
>
>On 13:50 Mon 20 Jan , Alexander V. Tikhonov wrote:
>> The change enables memory leaks detection to existing ASAN testing
>> routine and introduces suppression files with the corresponding
>> exception list:
>> * address sanitizer for compile-time: asan/asan.supp
>> * memory leak sanitizer for run-time: asan/lsan.supp
>>
>> Furthermore, added engine and replication suites for ASAN testing
>> routine.
>>
>> Additionally to the tests blacklisted within #4359,
>> 'box/on_shutdown.test.lua' is also disabled since it fails the
>> introduced leak check. All blacklisted tests have to be enabled
>> within #4360.
>>
>> Close #2058
>> ---
>> .travis.mk | 17 ++++--
>> asan/asan.supp | 17 ++++++
>> asan/lsan.supp | 105 ++++++++++++++++++++++++++++++++++
>> cmake/profile.cmake | 4 +-
>> test/box/on_shutdown.skipcond | 7 +++
>> 5 files changed, 142 insertions(+), 8 deletions(-)
>> create mode 100644 asan/asan.supp
>> create mode 100644 asan/lsan.supp
>> create mode 100644 test/box/on_shutdown.skipcond
>>
>> diff --git a/.travis.mk b/.travis.mk
>> index 42969ff56..efbc00ba1 100644
>> --- a/.travis.mk
>> +++ b/.travis.mk
>> @@ -111,15 +111,20 @@ coverage_debian: deps_debian test_coverage_debian_no_deps
>> # ASAN
>>
>> build_asan_debian:
>> - CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
>> - CC=clang-8 CXX=clang++-8 cmake . -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
>> + CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>> + -DENABLE_WERROR=ON -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
>> make -j
>>
>> test_asan_debian_no_deps: build_asan_debian
>> - # temporary excluded engine/ and replication/ suites with some tests from other suites by issue #4360
>> - cd test && ASAN=ON ASAN_OPTIONS=detect_leaks=0 ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) \
>> - app/ app-tap/ box/ box-py/ box-tap/ engine_long/ long_run-py/ luajit-tap/ \
>> - replication-py/ small/ sql/ sql-tap/ swim/ unit/ vinyl/ wal_off/ xlog/ xlog-py/
>> + # Temporary excluded some tests by issue #4360:
>> + # - To exclude tests from ASAN checks the asan/asan.supp file
>> + # was set at the build time in cmake/profile.cmake file.
>> + # - To exclude tests from LSAN checks the asan/lsan.supp file
>> + # was set in environment options to be used at run time.
>> + cd test && ASAN=ON \
>> + LSAN_OPTIONS=suppressions=${PWD}/asan/lsan.supp \
>> + ASAN_OPTIONS=heap_profile=0:unmap_shadow_on_exit=1:detect_invalid_pointer_pairs=1:symbolize=1:detect_leaks=1:dump_instruction_bytes=1:print_suppressions=0 \
>> + ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
>>
>> test_asan_debian: deps_debian deps_buster_clang_8 test_asan_debian_no_deps
>>
>> diff --git a/asan/asan.supp b/asan/asan.supp
>> new file mode 100644
>> index 000000000..2a20114f4
>> --- /dev/null
>> +++ b/asan/asan.supp
>> @@ -0,0 +1,17 @@
>> +# File format:
>> +#fun:*
>> +#src:*
>> +
>> +# !test: app-tap/json.test.lua
>> +# source: third_party/lua-cjson/lua_cjson.c
>> +fun:json_decode
>> +
>> +# test: unit/base64.test.lua
>> +# source: third_party/base64.c
>> +fun:base64_decode_block
>> +# source: test/unit/base64.c
>> +fun:base64_test
>> +
>> +# !test: unit/msgpack.test
>> +# source: src/lib/msgpuck/test/msgpuck.c
>> +fun:test_mp_print
>> diff --git a/asan/lsan.supp b/asan/lsan.supp
>> new file mode 100644
>> index 000000000..a1237fb86
>> --- /dev/null
>> +++ b/asan/lsan.supp
>> @@ -0,0 +1,105 @@
>> +# File format:
>> +#leak:*
>> +
>> +# test: app/crypto.test.lua
>> +# source: /usr/lib/x86_64-linux-gnu/libcrypto.so
>> +leak:CRYPTO_zalloc
>> +
>> +# test: app-tap/http_client.test.lua
>> +# source: src/tarantool
>> +leak:Curl_setstropt
>> +leak:create_conn
>> +leak:Curl_conncache_add_conn
>> +leak:alloc_addbyter
>> +leak:Curl_getaddrinfo_ex
>> +leak:Curl_cache_addr
>> +leak:Curl_hash_init
>> +leak:Curl_hash_add
>> +leak:Curl_he2ai
>> +leak:Curl_open
>> +leak:Curl_resolver_init
>> +
>> +# test: app-tap/iconv.test.lua
>> +# source: /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
>> +leak:gconv_init
>> +
>> +# test: box*/
>> +# source: third_party/luajit
>> +leak:lj_BC_FUNCC
>> +
>> +# test: box/access.test.lua
>> +# test: box/access_bin.test.lua
>> +# test: box/access_misc.test.lua
>> +# source: src/box/error.cc
>> +leak:AccessDeniedError::AccessDeniedError
>> +
>> +# test: box/bitset.test.lua
>> +# source: src/lib/bitset/iterator.c
>> +leak:tt_bitset_iterator_init
>> +
>> +# test: box-py/args.test.py
>> +# source: /lib/x86_64-linux-gnu/libc.so*
>> +leak:libc.so*
>> +
>> +# test: box-tap/schema-mt.test.lua
>> +# source: src/lib/core/coio_task.c
>> +leak:coio_on_start
>> +# source: src/lib/salad/mhash.h
>> +leak:mh_i32ptr_new
>> +
>> +# test: replication/misc.test.lua
>> +# source: src/box/vy_log.c
>> +leak:vy_recovery_new_f
>> +# source: src/lib/salad/mhash.h
>> +leak:mh_i64ptr_new
>> +
>> +# test: sql-tap/gh2250-trigger-chain-limit.test.lua
>> +# source: src/lib/core/exception.cc
>> +leak:Exception::operator new
>> +
>> +# test: sql-tap/trigger9.test.lua
>> +# source: src/lib/core/fiber.c
>> +leak:cord_start
>> +
>> +# test: sql-tap/tkt-7bbfb7d442.test.lua
>> +# test: sql-tap/view.test.lua
>> +# test: sql-tap/with1.test.lua
>> +# test: sql-tap/with2.test.lua
>> +# source: src/box/sql/malloc.c
>> +leak:sql_sized_malloc
>> +
>> +# test: swim/errinj.test.lua
>> +# test: swim/swim.test.lua
>> +# source: src/lib/swim/swim.c
>> +leak:swim_member_new
>> +leak:swim_update_member_payload
>> +
>> +# !test: unit/bps_tree.test.lua
>> +# source: src/lib/salad/bps_tree.h
>> +leak:bps_tree_test_create_leaf
>> +leak:bps_tree_test_process_insert_leaf
>> +
>> +# !test: unit/heap.test.lua
>> +# source: test/unit/heap.c
>> +leak:test_random_delete_workload
>> +leak:test_delete_last_node
>> +
>> +# !test: unit/heap_iterator.test.lua
>> +# source: src/lib/salad/heap.h
>> +leak:test_heap_reserve
>> +
>> +# !test: unit/swim.test.lua
>> +# source: src/lib/swim/swim_io.c
>> +leak:swim_scheduler_set_codec
>> +
>> +# test: vinyl/errinj.test.lua
>> +# source: src/lib/core/fiber.h
>> +leak:fiber_cxx_invoke
>> +
>> +# test: vinyl/errinj_ddl.test.lua
>> +# source: src/box/vy_stmt.c
>> +leak:vy_stmt_alloc
>> +
>> +# test: vinyl/recover.test.lua
>> +# source: src/lib/core/fiber.c
>> +leak:cord_costart_thread_func
>> diff --git a/cmake/profile.cmake b/cmake/profile.cmake
>> index 0ba31fa2c..bc4bf67f5 100644
>> --- a/cmake/profile.cmake
>> +++ b/cmake/profile.cmake
>> @@ -53,7 +53,7 @@ if (ENABLE_ASAN)
>> "\n")
>> endif()
>>
>> - set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
>> + set(CMAKE_REQUIRED_FLAGS "-fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp")
>> check_c_source_compiles("int main(void) {
>> #include <sanitizer/asan_interface.h>
>> void *x;
>> @@ -76,5 +76,5 @@ if (ENABLE_ASAN)
>> message(FATAL_ERROR "Cannot enable AddressSanitizer")
>> endif()
>>
>> - add_compile_flags("C;CXX" -fsanitize=address)
>> + add_compile_flags("C;CXX" -fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp)
>> endif()
>> diff --git a/test/box/on_shutdown.skipcond b/test/box/on_shutdown.skipcond
>> new file mode 100644
>> index 000000000..e46fd1088
>> --- /dev/null
>> +++ b/test/box/on_shutdown.skipcond
>> @@ -0,0 +1,7 @@
>> +import os
>> +
>> +# Disabled at ASAN build due to issue #4360.
>> +if os.getenv("ASAN") == 'ON':
>> + self.skip = 1
>> +
>> +# vim: set ft=python:
>> --
>> 2.17.1
>>
>--
>sergeyb@
--
Alexander Tikhonov
[-- Attachment #2: Type: text/html, Size: 9840 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN
2020-03-30 7:53 ` Alexander Tikhonov
@ 2020-03-30 8:09 ` Sergey Bronnikov
2020-04-01 11:04 ` Alexander Tikhonov
0 siblings, 1 reply; 9+ messages in thread
From: Sergey Bronnikov @ 2020-03-30 8:09 UTC (permalink / raw)
To: Alexander Tikhonov; +Cc: tarantool-patches
Thanks! I propose to add a ticket number to a file with supressions.
On 10:53 Mon 30 Mar , Alexander Tikhonov wrote:
>
> Hi Sergey, thanks for the review, we decided to have separate issue for the exclusions:
> https://github.com/tarantool/tarantool/issues/4360
> During fixing the exclusions step-by-step the new issues will be created for each of them if it will be needed.
>
>
> >Пятница, 27 марта 2020, 17:06 +03:00 от Sergey Bronnikov <sergeyb@tarantool.org>:
> >
> >I have no objections, so LGTM.
> >
> >One question: there are some ASAN supressions related to our own code
> >without reference to tickets or any other resource with explanation why
> >we have added this supression or when we want to fix it. Looks like we
> >decided to silently mute warnings and forget about it. Please clarify.
> >
> >Sergey
> >
> >On 13:50 Mon 20 Jan , Alexander V. Tikhonov wrote:
> >> The change enables memory leaks detection to existing ASAN testing
> >> routine and introduces suppression files with the corresponding
> >> exception list:
> >> * address sanitizer for compile-time: asan/asan.supp
> >> * memory leak sanitizer for run-time: asan/lsan.supp
> >>
> >> Furthermore, added engine and replication suites for ASAN testing
> >> routine.
> >>
> >> Additionally to the tests blacklisted within #4359,
> >> 'box/on_shutdown.test.lua' is also disabled since it fails the
> >> introduced leak check. All blacklisted tests have to be enabled
> >> within #4360.
> >>
> >> Close #2058
> >> ---
> >> .travis.mk | 17 ++++--
> >> asan/asan.supp | 17 ++++++
> >> asan/lsan.supp | 105 ++++++++++++++++++++++++++++++++++
> >> cmake/profile.cmake | 4 +-
> >> test/box/on_shutdown.skipcond | 7 +++
> >> 5 files changed, 142 insertions(+), 8 deletions(-)
> >> create mode 100644 asan/asan.supp
> >> create mode 100644 asan/lsan.supp
> >> create mode 100644 test/box/on_shutdown.skipcond
> >>
> >> diff --git a/.travis.mk b/.travis.mk
> >> index 42969ff56..efbc00ba1 100644
> >> --- a/.travis.mk
> >> +++ b/.travis.mk
> >> @@ -111,15 +111,20 @@ coverage_debian: deps_debian test_coverage_debian_no_deps
> >> # ASAN
> >>
> >> build_asan_debian:
> >> - CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
> >> - CC=clang-8 CXX=clang++-8 cmake . -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
> >> + CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
> >> + -DENABLE_WERROR=ON -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
> >> make -j
> >>
> >> test_asan_debian_no_deps: build_asan_debian
> >> - # temporary excluded engine/ and replication/ suites with some tests from other suites by issue #4360
> >> - cd test && ASAN=ON ASAN_OPTIONS=detect_leaks=0 ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) \
> >> - app/ app-tap/ box/ box-py/ box-tap/ engine_long/ long_run-py/ luajit-tap/ \
> >> - replication-py/ small/ sql/ sql-tap/ swim/ unit/ vinyl/ wal_off/ xlog/ xlog-py/
> >> + # Temporary excluded some tests by issue #4360:
> >> + # - To exclude tests from ASAN checks the asan/asan.supp file
> >> + # was set at the build time in cmake/profile.cmake file.
> >> + # - To exclude tests from LSAN checks the asan/lsan.supp file
> >> + # was set in environment options to be used at run time.
> >> + cd test && ASAN=ON \
> >> + LSAN_OPTIONS=suppressions=${PWD}/asan/lsan.supp \
> >> + ASAN_OPTIONS=heap_profile=0:unmap_shadow_on_exit=1:detect_invalid_pointer_pairs=1:symbolize=1:detect_leaks=1:dump_instruction_bytes=1:print_suppressions=0 \
> >> + ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
> >>
> >> test_asan_debian: deps_debian deps_buster_clang_8 test_asan_debian_no_deps
> >>
> >> diff --git a/asan/asan.supp b/asan/asan.supp
> >> new file mode 100644
> >> index 000000000..2a20114f4
> >> --- /dev/null
> >> +++ b/asan/asan.supp
> >> @@ -0,0 +1,17 @@
> >> +# File format:
> >> +#fun:*
> >> +#src:*
> >> +
> >> +# !test: app-tap/json.test.lua
> >> +# source: third_party/lua-cjson/lua_cjson.c
> >> +fun:json_decode
> >> +
> >> +# test: unit/base64.test.lua
> >> +# source: third_party/base64.c
> >> +fun:base64_decode_block
> >> +# source: test/unit/base64.c
> >> +fun:base64_test
> >> +
> >> +# !test: unit/msgpack.test
> >> +# source: src/lib/msgpuck/test/msgpuck.c
> >> +fun:test_mp_print
> >> diff --git a/asan/lsan.supp b/asan/lsan.supp
> >> new file mode 100644
> >> index 000000000..a1237fb86
> >> --- /dev/null
> >> +++ b/asan/lsan.supp
> >> @@ -0,0 +1,105 @@
> >> +# File format:
> >> +#leak:*
> >> +
> >> +# test: app/crypto.test.lua
> >> +# source: /usr/lib/x86_64-linux-gnu/libcrypto.so
> >> +leak:CRYPTO_zalloc
> >> +
> >> +# test: app-tap/http_client.test.lua
> >> +# source: src/tarantool
> >> +leak:Curl_setstropt
> >> +leak:create_conn
> >> +leak:Curl_conncache_add_conn
> >> +leak:alloc_addbyter
> >> +leak:Curl_getaddrinfo_ex
> >> +leak:Curl_cache_addr
> >> +leak:Curl_hash_init
> >> +leak:Curl_hash_add
> >> +leak:Curl_he2ai
> >> +leak:Curl_open
> >> +leak:Curl_resolver_init
> >> +
> >> +# test: app-tap/iconv.test.lua
> >> +# source: /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
> >> +leak:gconv_init
> >> +
> >> +# test: box*/
> >> +# source: third_party/luajit
> >> +leak:lj_BC_FUNCC
> >> +
> >> +# test: box/access.test.lua
> >> +# test: box/access_bin.test.lua
> >> +# test: box/access_misc.test.lua
> >> +# source: src/box/error.cc
> >> +leak:AccessDeniedError::AccessDeniedError
> >> +
> >> +# test: box/bitset.test.lua
> >> +# source: src/lib/bitset/iterator.c
> >> +leak:tt_bitset_iterator_init
> >> +
> >> +# test: box-py/args.test.py
> >> +# source: /lib/x86_64-linux-gnu/libc.so*
> >> +leak:libc.so*
> >> +
> >> +# test: box-tap/schema-mt.test.lua
> >> +# source: src/lib/core/coio_task.c
> >> +leak:coio_on_start
> >> +# source: src/lib/salad/mhash.h
> >> +leak:mh_i32ptr_new
> >> +
> >> +# test: replication/misc.test.lua
> >> +# source: src/box/vy_log.c
> >> +leak:vy_recovery_new_f
> >> +# source: src/lib/salad/mhash.h
> >> +leak:mh_i64ptr_new
> >> +
> >> +# test: sql-tap/gh2250-trigger-chain-limit.test.lua
> >> +# source: src/lib/core/exception.cc
> >> +leak:Exception::operator new
> >> +
> >> +# test: sql-tap/trigger9.test.lua
> >> +# source: src/lib/core/fiber.c
> >> +leak:cord_start
> >> +
> >> +# test: sql-tap/tkt-7bbfb7d442.test.lua
> >> +# test: sql-tap/view.test.lua
> >> +# test: sql-tap/with1.test.lua
> >> +# test: sql-tap/with2.test.lua
> >> +# source: src/box/sql/malloc.c
> >> +leak:sql_sized_malloc
> >> +
> >> +# test: swim/errinj.test.lua
> >> +# test: swim/swim.test.lua
> >> +# source: src/lib/swim/swim.c
> >> +leak:swim_member_new
> >> +leak:swim_update_member_payload
> >> +
> >> +# !test: unit/bps_tree.test.lua
> >> +# source: src/lib/salad/bps_tree.h
> >> +leak:bps_tree_test_create_leaf
> >> +leak:bps_tree_test_process_insert_leaf
> >> +
> >> +# !test: unit/heap.test.lua
> >> +# source: test/unit/heap.c
> >> +leak:test_random_delete_workload
> >> +leak:test_delete_last_node
> >> +
> >> +# !test: unit/heap_iterator.test.lua
> >> +# source: src/lib/salad/heap.h
> >> +leak:test_heap_reserve
> >> +
> >> +# !test: unit/swim.test.lua
> >> +# source: src/lib/swim/swim_io.c
> >> +leak:swim_scheduler_set_codec
> >> +
> >> +# test: vinyl/errinj.test.lua
> >> +# source: src/lib/core/fiber.h
> >> +leak:fiber_cxx_invoke
> >> +
> >> +# test: vinyl/errinj_ddl.test.lua
> >> +# source: src/box/vy_stmt.c
> >> +leak:vy_stmt_alloc
> >> +
> >> +# test: vinyl/recover.test.lua
> >> +# source: src/lib/core/fiber.c
> >> +leak:cord_costart_thread_func
> >> diff --git a/cmake/profile.cmake b/cmake/profile.cmake
> >> index 0ba31fa2c..bc4bf67f5 100644
> >> --- a/cmake/profile.cmake
> >> +++ b/cmake/profile.cmake
> >> @@ -53,7 +53,7 @@ if (ENABLE_ASAN)
> >> "\n")
> >> endif()
> >>
> >> - set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
> >> + set(CMAKE_REQUIRED_FLAGS "-fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp")
> >> check_c_source_compiles("int main(void) {
> >> #include <sanitizer/asan_interface.h>
> >> void *x;
> >> @@ -76,5 +76,5 @@ if (ENABLE_ASAN)
> >> message(FATAL_ERROR "Cannot enable AddressSanitizer")
> >> endif()
> >>
> >> - add_compile_flags("C;CXX" -fsanitize=address)
> >> + add_compile_flags("C;CXX" -fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp)
> >> endif()
> >> diff --git a/test/box/on_shutdown.skipcond b/test/box/on_shutdown.skipcond
> >> new file mode 100644
> >> index 000000000..e46fd1088
> >> --- /dev/null
> >> +++ b/test/box/on_shutdown.skipcond
> >> @@ -0,0 +1,7 @@
> >> +import os
> >> +
> >> +# Disabled at ASAN build due to issue #4360.
> >> +if os.getenv("ASAN") == 'ON':
> >> + self.skip = 1
> >> +
> >> +# vim: set ft=python:
> >> --
> >> 2.17.1
> >>
> >--
> >sergeyb@
>
>
> --
> Alexander Tikhonov
>
--
sergeyb@
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN
2020-03-30 8:09 ` Sergey Bronnikov
@ 2020-04-01 11:04 ` Alexander Tikhonov
0 siblings, 0 replies; 9+ messages in thread
From: Alexander Tikhonov @ 2020-04-01 11:04 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: tarantool-patches
[-- Attachment #1: Type: text/plain, Size: 9293 bytes --]
Hi Sergey, thank you for the review, I’ve added the information on
the controlling issue in both suppression files as you suggested.
>Понедельник, 30 марта 2020, 11:09 +03:00 от Sergey Bronnikov <sergeyb@tarantool.org>:
>
>Thanks! I propose to add a ticket number to a file with supressions.
>
>On 10:53 Mon 30 Mar , Alexander Tikhonov wrote:
>>
>> Hi Sergey, thanks for the review, we decided to have separate issue for the exclusions:
>> https://github.com/tarantool/tarantool/issues/4360
>> During fixing the exclusions step-by-step the new issues will be created for each of them if it will be needed.
>>
>>
>> >Пятница, 27 марта 2020, 17:06 +03:00 от Sergey Bronnikov < sergeyb@tarantool.org >:
>> >
>> >I have no objections, so LGTM.
>> >
>> >One question: there are some ASAN supressions related to our own code
>> >without reference to tickets or any other resource with explanation why
>> >we have added this supression or when we want to fix it. Looks like we
>> >decided to silently mute warnings and forget about it. Please clarify.
>> >
>> >Sergey
>> >
>> >On 13:50 Mon 20 Jan , Alexander V. Tikhonov wrote:
>> >> The change enables memory leaks detection to existing ASAN testing
>> >> routine and introduces suppression files with the corresponding
>> >> exception list:
>> >> * address sanitizer for compile-time: asan/asan.supp
>> >> * memory leak sanitizer for run-time: asan/lsan.supp
>> >>
>> >> Furthermore, added engine and replication suites for ASAN testing
>> >> routine.
>> >>
>> >> Additionally to the tests blacklisted within #4359,
>> >> 'box/on_shutdown.test.lua' is also disabled since it fails the
>> >> introduced leak check. All blacklisted tests have to be enabled
>> >> within #4360.
>> >>
>> >> Close #2058
>> >> ---
>> >> .travis.mk | 17 ++++--
>> >> asan/asan.supp | 17 ++++++
>> >> asan/lsan.supp | 105 ++++++++++++++++++++++++++++++++++
>> >> cmake/profile.cmake | 4 +-
>> >> test/box/on_shutdown.skipcond | 7 +++
>> >> 5 files changed, 142 insertions(+), 8 deletions(-)
>> >> create mode 100644 asan/asan.supp
>> >> create mode 100644 asan/lsan.supp
>> >> create mode 100644 test/box/on_shutdown.skipcond
>> >>
>> >> diff --git a/.travis.mk b/.travis.mk
>> >> index 42969ff56..efbc00ba1 100644
>> >> --- a/.travis.mk
>> >> +++ b/.travis.mk
>> >> @@ -111,15 +111,20 @@ coverage_debian: deps_debian test_coverage_debian_no_deps
>> >> # ASAN
>> >>
>> >> build_asan_debian:
>> >> - CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_WERROR=ON ${CMAKE_EXTRA_PARAMS}
>> >> - CC=clang-8 CXX=clang++-8 cmake . -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
>> >> + CC=clang-8 CXX=clang++-8 cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
>> >> + -DENABLE_WERROR=ON -DENABLE_ASAN=ON ${CMAKE_EXTRA_PARAMS}
>> >> make -j
>> >>
>> >> test_asan_debian_no_deps: build_asan_debian
>> >> - # temporary excluded engine/ and replication/ suites with some tests from other suites by issue #4360
>> >> - cd test && ASAN=ON ASAN_OPTIONS=detect_leaks=0 ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS) \
>> >> - app/ app-tap/ box/ box-py/ box-tap/ engine_long/ long_run-py/ luajit-tap/ \
>> >> - replication-py/ small/ sql/ sql-tap/ swim/ unit/ vinyl/ wal_off/ xlog/ xlog-py/
>> >> + # Temporary excluded some tests by issue #4360:
>> >> + # - To exclude tests from ASAN checks the asan/asan.supp file
>> >> + # was set at the build time in cmake/profile.cmake file.
>> >> + # - To exclude tests from LSAN checks the asan/lsan.supp file
>> >> + # was set in environment options to be used at run time.
>> >> + cd test && ASAN=ON \
>> >> + LSAN_OPTIONS=suppressions=${PWD}/asan/lsan.supp \
>> >> + ASAN_OPTIONS=heap_profile=0:unmap_shadow_on_exit=1:detect_invalid_pointer_pairs=1:symbolize=1:detect_leaks=1:dump_instruction_bytes=1:print_suppressions=0 \
>> >> + ./test-run.py --force $(TEST_RUN_EXTRA_PARAMS)
>> >>
>> >> test_asan_debian: deps_debian deps_buster_clang_8 test_asan_debian_no_deps
>> >>
>> >> diff --git a/asan/asan.supp b/asan/asan.supp
>> >> new file mode 100644
>> >> index 000000000..2a20114f4
>> >> --- /dev/null
>> >> +++ b/asan/asan.supp
>> >> @@ -0,0 +1,17 @@
>> >> +# File format:
>> >> +#fun:*
>> >> +#src:*
>> >> +
>> >> +# !test: app-tap/json.test.lua
>> >> +# source: third_party/lua-cjson/lua_cjson.c
>> >> +fun:json_decode
>> >> +
>> >> +# test: unit/base64.test.lua
>> >> +# source: third_party/base64.c
>> >> +fun:base64_decode_block
>> >> +# source: test/unit/base64.c
>> >> +fun:base64_test
>> >> +
>> >> +# !test: unit/msgpack.test
>> >> +# source: src/lib/msgpuck/test/msgpuck.c
>> >> +fun:test_mp_print
>> >> diff --git a/asan/lsan.supp b/asan/lsan.supp
>> >> new file mode 100644
>> >> index 000000000..a1237fb86
>> >> --- /dev/null
>> >> +++ b/asan/lsan.supp
>> >> @@ -0,0 +1,105 @@
>> >> +# File format:
>> >> +#leak:*
>> >> +
>> >> +# test: app/crypto.test.lua
>> >> +# source: /usr/lib/x86_64-linux-gnu/libcrypto.so
>> >> +leak:CRYPTO_zalloc
>> >> +
>> >> +# test: app-tap/http_client.test.lua
>> >> +# source: src/tarantool
>> >> +leak:Curl_setstropt
>> >> +leak:create_conn
>> >> +leak:Curl_conncache_add_conn
>> >> +leak:alloc_addbyter
>> >> +leak:Curl_getaddrinfo_ex
>> >> +leak:Curl_cache_addr
>> >> +leak:Curl_hash_init
>> >> +leak:Curl_hash_add
>> >> +leak:Curl_he2ai
>> >> +leak:Curl_open
>> >> +leak:Curl_resolver_init
>> >> +
>> >> +# test: app-tap/iconv.test.lua
>> >> +# source: /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
>> >> +leak:gconv_init
>> >> +
>> >> +# test: box*/
>> >> +# source: third_party/luajit
>> >> +leak:lj_BC_FUNCC
>> >> +
>> >> +# test: box/access.test.lua
>> >> +# test: box/access_bin.test.lua
>> >> +# test: box/access_misc.test.lua
>> >> +# source: src/box/error.cc
>> >> +leak:AccessDeniedError::AccessDeniedError
>> >> +
>> >> +# test: box/bitset.test.lua
>> >> +# source: src/lib/bitset/iterator.c
>> >> +leak:tt_bitset_iterator_init
>> >> +
>> >> +# test: box-py/args.test.py
>> >> +# source: /lib/x86_64-linux-gnu/libc.so*
>> >> +leak:libc.so*
>> >> +
>> >> +# test: box-tap/schema-mt.test.lua
>> >> +# source: src/lib/core/coio_task.c
>> >> +leak:coio_on_start
>> >> +# source: src/lib/salad/mhash.h
>> >> +leak:mh_i32ptr_new
>> >> +
>> >> +# test: replication/misc.test.lua
>> >> +# source: src/box/vy_log.c
>> >> +leak:vy_recovery_new_f
>> >> +# source: src/lib/salad/mhash.h
>> >> +leak:mh_i64ptr_new
>> >> +
>> >> +# test: sql-tap/gh2250-trigger-chain-limit.test.lua
>> >> +# source: src/lib/core/exception.cc
>> >> +leak:Exception::operator new
>> >> +
>> >> +# test: sql-tap/trigger9.test.lua
>> >> +# source: src/lib/core/fiber.c
>> >> +leak:cord_start
>> >> +
>> >> +# test: sql-tap/tkt-7bbfb7d442.test.lua
>> >> +# test: sql-tap/view.test.lua
>> >> +# test: sql-tap/with1.test.lua
>> >> +# test: sql-tap/with2.test.lua
>> >> +# source: src/box/sql/malloc.c
>> >> +leak:sql_sized_malloc
>> >> +
>> >> +# test: swim/errinj.test.lua
>> >> +# test: swim/swim.test.lua
>> >> +# source: src/lib/swim/swim.c
>> >> +leak:swim_member_new
>> >> +leak:swim_update_member_payload
>> >> +
>> >> +# !test: unit/bps_tree.test.lua
>> >> +# source: src/lib/salad/bps_tree.h
>> >> +leak:bps_tree_test_create_leaf
>> >> +leak:bps_tree_test_process_insert_leaf
>> >> +
>> >> +# !test: unit/heap.test.lua
>> >> +# source: test/unit/heap.c
>> >> +leak:test_random_delete_workload
>> >> +leak:test_delete_last_node
>> >> +
>> >> +# !test: unit/heap_iterator.test.lua
>> >> +# source: src/lib/salad/heap.h
>> >> +leak:test_heap_reserve
>> >> +
>> >> +# !test: unit/swim.test.lua
>> >> +# source: src/lib/swim/swim_io.c
>> >> +leak:swim_scheduler_set_codec
>> >> +
>> >> +# test: vinyl/errinj.test.lua
>> >> +# source: src/lib/core/fiber.h
>> >> +leak:fiber_cxx_invoke
>> >> +
>> >> +# test: vinyl/errinj_ddl.test.lua
>> >> +# source: src/box/vy_stmt.c
>> >> +leak:vy_stmt_alloc
>> >> +
>> >> +# test: vinyl/recover.test.lua
>> >> +# source: src/lib/core/fiber.c
>> >> +leak:cord_costart_thread_func
>> >> diff --git a/cmake/profile.cmake b/cmake/profile.cmake
>> >> index 0ba31fa2c..bc4bf67f5 100644
>> >> --- a/cmake/profile.cmake
>> >> +++ b/cmake/profile.cmake
>> >> @@ -53,7 +53,7 @@ if (ENABLE_ASAN)
>> >> "\n")
>> >> endif()
>> >>
>> >> - set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
>> >> + set(CMAKE_REQUIRED_FLAGS "-fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp")
>> >> check_c_source_compiles("int main(void) {
>> >> #include <sanitizer/asan_interface.h>
>> >> void *x;
>> >> @@ -76,5 +76,5 @@ if (ENABLE_ASAN)
>> >> message(FATAL_ERROR "Cannot enable AddressSanitizer")
>> >> endif()
>> >>
>> >> - add_compile_flags("C;CXX" -fsanitize=address)
>> >> + add_compile_flags("C;CXX" -fsanitize=address -fsanitize-blacklist=${CMAKE_SOURCE_DIR}/asan/asan.supp)
>> >> endif()
>> >> diff --git a/test/box/on_shutdown.skipcond b/test/box/on_shutdown.skipcond
>> >> new file mode 100644
>> >> index 000000000..e46fd1088
>> >> --- /dev/null
>> >> +++ b/test/box/on_shutdown.skipcond
>> >> @@ -0,0 +1,7 @@
>> >> +import os
>> >> +
>> >> +# Disabled at ASAN build due to issue #4360.
>> >> +if os.getenv("ASAN") == 'ON':
>> >> + self.skip = 1
>> >> +
>> >> +# vim: set ft=python:
>> >> --
>> >> 2.17.1
>> >>
>> >--
>> >sergeyb@
>>
>>
>> --
>> Alexander Tikhonov
>>
>--
>sergeyb@
--
Alexander Tikhonov
[-- Attachment #2: Type: text/html, Size: 12630 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2020-04-01 11:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20 10:50 [Tarantool-patches] [PATCH v2 0/2] add memory leaks detection via LSAN Alexander V. Tikhonov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 1/2] test: use default replication connection timeout Alexander V. Tikhonov
2020-03-27 14:07 ` Sergey Bronnikov
2020-01-20 10:50 ` [Tarantool-patches] [PATCH v2 2/2] gitlab-ci: add memory leaks detection via LSAN Alexander V. Tikhonov
2020-03-27 14:06 ` Sergey Bronnikov
2020-03-30 7:53 ` Alexander Tikhonov
2020-03-30 8:09 ` Sergey Bronnikov
2020-04-01 11:04 ` Alexander Tikhonov
2020-01-21 14:25 ` [Tarantool-patches] [PATCH v2 0/2] " Igor Munkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox