Skip to contentSkip to conversation

Add HID over GATT functional tests

PATCH Superseded Luiz Augusto von Dentz 2 participants 10 messages Sep 24

Subsystems (2)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

v2 cover Add HID over GATT functional tests

From: Luiz Augusto von Dentz <[email protected]>

This adds functional tests for HID over GATT (HoG), with bluetoothctl registering a HID Service acting as a keyboard, with and without Shorter Connection Interval (SCI) support, using the new client/scripts/hog-device*.bt scripts, and the HID host:

- checking HID Information, HID SCI Mode and HID SCI Information over GATT with gatt.select-attribute/gatt.read
- receiving a few Input Reports notified by the HID device
- with SCI support, changing the SCI mode, followed by the connection rate with mgmt.conn-subrate, and receiving the notification from the HID device confirming the mode has been changed

The tests are documented in doc/functional-hog.rst.

To support them:

- bluetoothctl can now set descriptor values from scripts, and prints the MGMT Connection Subrate event
- btvirt defaults to the latest BR/EDR+LE version (6.2), so Shorter Connection Intervals are supported by the emulated controllers, with the new -C/--core option to emulate older versions

Also, with -n auto, the number of functional test workers is now limited by the memory available instead of one per CPU, since running out of memory with so many VM instances made tests fail at random, and check-functional uses -n auto by default (override with CHECK_FUNCTIONAL_JOBS).

v2:
- Add "attrib: Fix unregistering notifications registered with bt_gatt_client", fixing the heap-use-after-free in report_notify_destroy reported by TestFunctional on the HoG tests:
g_attrib_unregister did not unregister the notifications registered with bt_gatt_client, so their destroy callback was called after HoG had freed its reports.

Luiz Augusto von Dentz (8):
attrib: Fix unregistering notifications registered with bt_gatt_client client/gatt: Fix setting descriptor value from scripts client/mgmt: Print Connection Subrate event
emulator: Default to the latest BR/EDR+LE version client/scripts: Add HoG device scripts
doc: Add functional-hog documentation
test: functional: add HoG tests
test: functional: limit the workers by the memory available

 Makefile.am                      |   8 +-
 attrib/gattrib.c                 |  90 +++++++----
 client/gatt.c                    |  25 ++-
 client/mgmt.c                    |  31 ++++
 client/scripts/hog-device-sci.bt |  49 ++++++
 client/scripts/hog-device.bt     |  38 +++++
 doc/functional-hog.rst           | 188 +++++++++++++++++++++++
 doc/functional-testing.rst       |   1 +
 doc/test-functional.rst          |  25 +++
 emulator/main.c                  |  54 ++++++-
 emulator/server.c                |  15 +-
 emulator/server.h                |   2 +
 test/functional/conftest.py      |  46 ++++++
 test/functional/test_hog.py      | 252 +++++++++++++++++++++++++++++++
 14 files changed, 785 insertions(+), 39 deletions(-)
 create mode 100644 client/scripts/hog-device-sci.bt
 create mode 100644 client/scripts/hog-device.bt
 create mode 100644 doc/functional-hog.rst
 create mode 100644 test/functional/test_hog.py
Signature · 1 line
2.55.0
author maintainer
#1 lore raw

PATCH v2 1/8 attrib: Fix unregistering notifications registered with bt_gatt_client

From: Luiz Augusto von Dentz <[email protected]>

g_attrib_register registers ATT_OP_HANDLE_NOTIFY with bt_gatt_client, when there is one, returning its id, but g_attrib_unregister always unregisters with bt_att, so the notification was never unregistered and its destroy callback was called once bt_gatt_client was freed, after the user data was freed, e.g. the reports of HoG:

ERROR: AddressSanitizer: heap-use-after-free #11 report_notify_destroy profiles/input/hog-lib.c:359 #12 attrib_callbacks_destroy attrib/gattrib.c:126 #13 notify_data_unref src/shared/gatt-client.c:256
...
#17 bt_gatt_client_free src/shared/gatt-client.c:2293 #18 bt_gatt_client_unref src/shared/gatt-client.c:2605 #19 g_attrib_unref attrib/gattrib.c:154
#20 attio_cleanup src/device.c:874

Give out ids of our own, keeping track of how each one was registered so it is unregistered accordingly.

---
 attrib/gattrib.c | 90 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 63 insertions(+), 27 deletions(-)
attrib/gattrib.c +63 -27
index 3a988e131e94..05a17ba9393f 100644
@@ -45,6 +45,7 @@ struct _GAttrib {
 	uint8_t *buf;
 	int buflen;
 	struct queue *track_ids;
+	unsigned int next_reg_id;
 };
 
 struct attrib_callbacks {
@@ -55,6 +56,9 @@ struct attrib_callbacks {
 	gpointer user_data;
 	GAttrib *parent;
 	uint16_t notify_handle;
+	unsigned int reg_id;
+	unsigned int att_id;
+	unsigned int client_id;
 };
 
 GAttrib *g_attrib_new(GIOChannel *io, guint16 mtu, bool ext_signed)
@@ -363,38 +367,52 @@ guint g_attrib_register(GAttrib *attrib, guint8 opcode, guint16 handle,
 				GAttribNotifyFunc func, gpointer user_data,
 				GDestroyNotify notify)
 {
-	struct attrib_callbacks *cb = NULL;
+	struct attrib_callbacks *cb;
 
 	if (!attrib)
 		return 0;
 
-	if (func || notify) {
-		cb = new0(struct attrib_callbacks, 1);
-		if (!cb)
-			return 0;
-		cb->notify_func = func;
-		cb->notify_handle = handle;
-		cb->user_data = user_data;
-		cb->destroy_func = notify;
-		cb->parent = attrib;
-		queue_push_head(attrib->callbacks, cb);
-	}
+	cb = new0(struct attrib_callbacks, 1);
+	if (!cb)
+		return 0;
 
-	if (opcode == ATT_OP_HANDLE_NOTIFY && attrib->client) {
-		unsigned int id;
+	cb->notify_func = func;
+	cb->notify_handle = handle;
+	cb->user_data = user_data;
+	cb->destroy_func = notify;
+	cb->parent = attrib;
+	queue_push_head(attrib->callbacks, cb);
 
-		id = bt_gatt_client_register_notify(attrib->client, handle,
-						NULL, client_notify_cb, cb,
-						attrib_callbacks_remove);
-		if (id)
-			return id;
-	}
-
-	if (opcode == GATTRIB_ALL_REQS)
-		opcode = BT_ATT_ALL_REQUESTS;
-
-	return bt_att_register(attrib->att, opcode, attrib_callback_notify,
+	/* The notifications are registered with bt_gatt_client when there
+	 * is one, which uses ids of its own, so give out ids of our own to
+	 * know how to unregister them.
+	 */
+	if (opcode == ATT_OP_HANDLE_NOTIFY && attrib->client)
+		cb->client_id = bt_gatt_client_register_notify(attrib->client,
+						handle, NULL, client_notify_cb,
 						cb, attrib_callbacks_remove);
+
+	if (!cb->client_id) {
+		if (opcode == GATTRIB_ALL_REQS)
+			opcode = BT_ATT_ALL_REQUESTS;
+
+		cb->att_id = bt_att_register(attrib->att, opcode,
+						attrib_callback_notify, cb,
+						attrib_callbacks_remove);
+	}
+
+	if (!cb->client_id && !cb->att_id) {
+		queue_remove(attrib->callbacks, cb);
+		free(cb);
+		return 0;
+	}
+
+	if (++attrib->next_reg_id == 0)
+		++attrib->next_reg_id;
+
+	cb->reg_id = attrib->next_reg_id;
+
+	return cb->reg_id;
 }
 
 uint8_t *g_attrib_get_buffer(GAttrib *attrib, size_t *len)
@@ -456,12 +474,30 @@ gboolean g_attrib_attach_client(GAttrib *attrib, struct bt_gatt_client *client)
 	return TRUE;
 }
 
+static bool match_reg_id(const void *data, const void *match_data)
+{
+	const struct attrib_callbacks *cb = data;
+
+	return cb->reg_id && cb->reg_id == PTR_TO_UINT(match_data);
+}
+
 gboolean g_attrib_unregister(GAttrib *attrib, guint id)
 {
-	if (!attrib)
+	struct attrib_callbacks *cb;
+
+	if (!attrib || !id)
 		return FALSE;
 
-	return bt_att_unregister(attrib->att, id);
+	cb = queue_find(attrib->callbacks, match_reg_id, UINT_TO_PTR(id));
+	if (!cb)
+		return FALSE;
+
+	/* cb is freed by attrib_callbacks_remove once unregistered */
+	if (cb->client_id)
+		return bt_gatt_client_unregister_notify(attrib->client,
+							cb->client_id);
+
+	return bt_att_unregister(attrib->att, cb->att_id);
 }
 
 gboolean g_attrib_unregister_all(GAttrib *attrib)
Signature · 1 line
2.55.0
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1173166/

---Test result---

Test Summary:

CheckPatch                    PASS      3.04 seconds
GitLint                       FAIL      2.13 seconds
BuildEll                      PASS      17.71 seconds
BluezMake                     PASS      321.52 seconds
MakeCheck                     PASS      14.38 seconds
MakeDistcheck                 PASS      132.25 seconds
CheckValgrind                 PASS      238.68 seconds
CheckSmatch                   PASS      250.48 seconds
bluezmakeextell               PASS      90.64 seconds
TestFunctional                FAIL      1040.06 seconds
IncrementalBuild              PASS      373.42 seconds
ScanBuild                     PASS      1065.31 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[BlueZ,v2,1/8] attrib: Fix unregistering notifications registered with bt_gatt_client

1: T1 Title exceeds max length (85>80): "[BlueZ,v2,1/8] attrib: Fix unregistering notifications registered with bt_gatt_client"
##############################
Test: TestFunctional - FAIL
Desc: Run test-functional
Output:
FAIL functional.test_hog::test_hog[no-sci-hosts15-vm2]: failed on teardown with "pytest_bluezenv.plugin.CoredumpWarning: Core dump: test-bluezenv-hosts15.0-bluetoothd-1790261889-112.core

        /usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.
        [New LWP 112]
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/usr/lib/x86_64-linux-gnu/libthread_db.so.1".
        Core was generated by `/home/runner/work/bluez/bluez/src/src/src/bluetoothd --nodetach -f /run/bluetoo'.
        Program terminated with signal SIGABRT, Aborted.
        #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44

        warning: 44	./nptl/pthread_kill.c: No such file or directory

        Thread 1 (Thread 0x7f556fb87900 (LWP 112)):
        #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
                tid = <optimized out>
                ret = 0
                pd = <optimized out>
                old_mask = {__val = {0}}
                ret = <optimized out>
        #1  __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
        No locals.
        #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
        No locals.
        #3  0x00007f55702e2b7e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
                ret = <optimized out>
        #4  0x00007f55702c58ec in __GI_abort () at ./stdlib/abort.c:77
                act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
        #5  0x00007f5570eeda0f in __sanitizer::Abort () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:165
        No locals.
        #6  0x00007f5571013c2d in __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58
        No locals.
        #7  0x00007f5570fe893c in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7fff9fc589b6) at ../../../../src/libsanitizer/asan/asan_report.cpp:221
                buffer_copy = {buffer_ = {<__sanitizer::InternalMmapVectorNoCtor<char, false>> = {data_ = 0x7b5569cd9000 '=' <repeats 65 times>, "\n==112==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b956f000aa4 at pc 0x5620c8bcf2e3 bp 0x7fff9fc59630 sp 0x7fff9fc59620"..., capacity_bytes_ = 8192, size_ = 4298}, <No data fields>}}
                buffer_copy = <optimized out>
                l = <optimized out>
        #8  0x00007f5570fe7e02 in __asan::ReportGenericError (pc=94698806768355, bp=140735873914416, sp=sp@entry=140735873914400, addr=135881742617252, is_write=is_write@entry=true, access_size=4, fatal=true, exp=<optimized out>) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
                in_report = {error_report_lock_ = {<No data fields>}, static current_error_ = {kind = __asan::kErrorKindGeneric, {Base = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, DeadlySignal = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, signal = {siginfo = 0x7f5500000002, context = 0x7b956f000aa4, addr = 0, pc = 0, sp = 10342281250613, bp = 135881742617252, is_memory_access = 20, write_flag = __sanitizer::SignalContext::Unknown, is_true_faulting_addr = 144}}, DoubleFree = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, second_free_stack = 0x7f5500000002, addr_description = {addr = 135881742617252, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2408, chunk_access = {bad_addr = 135881742617252, offset = 20, chunk_begin = 135881742617232, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}}, NewDeleteTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, free_stack = 0x7f5500000002, addr_description = {addr = 135881742617252, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2408, chunk_access = {bad_addr = 135881742617252, offset = 20, chunk_begin = 135881742617232, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, delete_size = 5000786010338791936, delete_alignment = 16}, FreeNotMalloced = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, free_stack = 0x7f5500000002, addr_description = {data = {kind = 1862273700, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10342281250613, alloc_stack_id = 1862273700, free_stack_id = 31637, chunk_access = {bad_addr = 20, offset = 135881742617232, chunk_begin = 40, chunk_size = 61802964934664, user_requested_alignment = 512, access_type = 1, alloc_type = 2}}, stack = {addr = 0, tid = 0, offset = 10342281250613, frame_pc = 135881742617252, access_size = 20, frame_descr = 0x7b956f000a90 "h\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10342281250613, size_with_redzone = 135881742617252, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b956f000a90 "h\t", has_dynamic_init = 40, gcc_location = 0x38359fc56008, odr_indicator = 5000786010338791936}, {beg = 16, size = 140004932695682, size_with_redzone = 140735873912935, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7fff9fc59067 "", has_dynamic_init = 206158430224, gcc_location = 0x7fff9fc59640, odr_indicator = 140735873914192}, {beg = 140004932902368, size = 140004931726179, size_with_redzone = 136087900959056, name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, module_name = 0x7fff00000000 <error: Cannot access memory at address 0x7fff00000000>, has_dynamic_init = 140735873912960, gcc_location = 0x70, odr_indicator = 135606845974304}, {beg = 140735873912960, size = 49, size_with_redzone = 140735873912720, name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140735873912736, gcc_location = 0x7fff9fc58ee0, odr_indicator = 5000786010338791936}}, reg_sites = {2680525952, 32767, 0, 0}, access_size = 140735873912980, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, AllocTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, dealloc_stack = 0x7f5500000002, alloc_type = 1862273700, dealloc_type = 31637, addr_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 0, kind = (__asan::kShadowKindGap | unknown: 0x34), shadow_byte = 7 '\a'}, heap = {addr = 0, alloc_tid = 10342281250613, free_tid = 135881742617252, alloc_stack_id = 20, free_stack_id = 0, chunk_access = {bad_addr = 135881742617232, offset = 40, chunk_begin = 61802964934664, chunk_size = 5000786010338791936, user_requested_alignment = 16, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 10342281250613, offset = 135881742617252, frame_pc = 20, access_size = 135881742617232, frame_descr = 0x28 <error: Cannot access memory at address 0x28>}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 10342281250613, size = 135881742617252, size_with_redzone = 20, name = 0x7b956f000a90 "h\t", module_name = 0x28 <error: Cannot access memory at address 0x28>, has_dynamic_init = 61802964934664, gcc_location = 0x45665c618ffc9200, odr_indicator = 16}, {beg = 140004932695682, size = 140735873912935, size_with_redzone = 15, name = 0x7fff9fc59067 "", module_name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, has_dynamic_init = 140735873914432, gcc_location = 0x7fff9fc59550, odr_indicator = 140004932902368}, {beg = 140004931726179, size = 136087900959056, size_with_redzone = 5000786010338791936, name = 0x7fff00000000 <error: Cannot access memory at address 0x7fff00000000>, module_name = 0x7fff9fc59080 "f=\377pU\177", has_dynamic_init = 112, gcc_location = 0x7b556de22720, odr_indicator = 140735873912960}, {beg = 49, size = 140735873912720, size_with_redzone = 140004931142716, name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, module_name = 0x7fff9fc58fa0 "\037\033\357pU\177", has_dynamic_init = 140735873912544, gcc_location = 0x45665c618ffc9200, odr_indicator = 140735873913984}}, reg_sites = {0, 0, 2680524948, 32767}, access_size = 94698806768355, size = 48 '0'}, wild = {addr = 0, access_size = 10342281250613}}}}}, MallocUsableSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, addr_description = {data = {kind = 1862273700, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10342281250613, alloc_stack_id = 1862273700, free_stack_id = 31637, chunk_access = {bad_addr = 20, offset = 135881742617232, chunk_begin = 40, chunk_size = 61802964934664, user_requested_alignment = 512, access_type = 1, alloc_type = 2}}, stack = {addr = 0, tid = 0, offset = 10342281250613, frame_pc = 135881742617252, access_size = 20, frame_descr = 0x7b956f000a90 "h\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10342281250613, size_with_redzone = 135881742617252, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b956f000a90 "h\t", has_dynamic_init = 40, gcc_location = 0x38359fc56008, odr_indicator = 5000786010338791936}, {beg = 16, size = 140004932695682, size_with_redzone = 140735873912935, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7fff9fc59067 "", has_dynamic_init = 206158430224, gcc_location = 0x7fff9fc59640, odr_indicator = 140735873914192}, {beg = 140004932902368, size = 140004931726179, size_with_redzone = 136087900959056, name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, module_name = 0x7fff00000000 <error: Cannot access memory at address 0x7fff00000000>, has_dynamic_init = 140735873912960, gcc_location = 0x70, odr_indicator = 135606845974304}, {beg = 140735873912960, size = 49, size_with_redzone = 140735873912720, name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140735873912736, gcc_location = 0x7fff9fc58ee0, odr_indicator = 5000786010338791936}}, reg_sites = {2680525952, 32767, 0, 0}, access_size = 140735873912980, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, SanitizerGetAllocatedSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, addr_description = {data = {kind = 1862273700, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10342281250613, alloc_stack_id = 1862273700, free_stack_id = 31637, chunk_access = {bad_addr = 20, offset = 135881742617232, chunk_begin = 40, chunk_size = 61802964934664, user_requested_alignment = 512, access_type = 1, alloc_type = 2}}, stack = {addr = 0, tid = 0, offset = 10342281250613, frame_pc = 135881742617252, access_size = 20, frame_descr = 0x7b956f000a90 "h\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10342281250613, size_with_redzone = 135881742617252, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b956f000a90 "h\t", has_dynamic_init = 40, gcc_location = 0x38359fc56008, odr_indicator = 5000786010338791936}, {beg = 16, size = 140004932695682, size_with_redzone = 140735873912935, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7fff9fc59067 "", has_dynamic_init = 206158430224, gcc_location = 0x7fff9fc59640, odr_indicator = 140735873914192}, {beg = 140004932902368, size = 140004931726179, size_with_redzone = 136087900959056, name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, module_name = 0x7fff00000000 <error: Cannot access memory at address 0x7fff00000000>, has_dynamic_init = 140735873912960, gcc_location = 0x70, odr_indicator = 135606845974304}, {beg = 140735873912960, size = 49, size_with_redzone = 140735873912720, name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140735873912736, gcc_location = 0x7fff9fc58ee0, odr_indicator = 5000786010338791936}}, reg_sites = {2680525952, 32767, 0, 0}, access_size = 140735873912980, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, CallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, count = 135881742617252, size = 0}, ReallocArrayOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, count = 135881742617252, size = 0}, PvallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, size = 135881742617252}, InvalidAllocationAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, alignment = 135881742617252}, InvalidAlignedAllocAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, size = 135881742617252, alignment = 0}, InvalidPosixMemalignAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, alignment = 135881742617252}, AllocationSizeTooBig = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, user_size = 135881742617252, total_size = 0, max_size = 0}, RssLimitExceeded = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002}, OutOfMemory = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, requested_size = 135881742617252}, StringFunctionMemoryRangesOverlap = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, length1 = 135881742617252, length2 = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 10342281250613, kind = (unknown: 0xa4), shadow_byte = 10 '\n'}, heap = {addr = 10342281250613, alloc_tid = 135881742617252, free_tid = 20, alloc_stack_id = 1862273680, free_stack_id = 31637, chunk_access = {bad_addr = 40, offset = 61802964934664, chunk_begin = 5000786010338791936, chunk_size = 16, user_requested_alignment = 1666, access_type = 3, alloc_type = 2}}, stack = {addr = 10342281250613, tid = 135881742617252, offset = 20, frame_pc = 135881742617232, access_size = 40, frame_descr = 0x38359fc56008 <error: Cannot access memory at address 0x38359fc56008>}, global = {addr = 10342281250613, static kMaxGlobals = 4, globals = {{beg = 135881742617252, size = 20, size_with_redzone = 135881742617232, name = 0x28 <error: Cannot access memory at address 0x28>, module_name = 0x38359fc56008 <error: Cannot access memory at address 0x38359fc56008>, has_dynamic_init = 5000786010338791936, gcc_location = 0x10, odr_indicator = 140004932695682}, {beg = 140735873912935, size = 15, size_with_redzone = 140735873912935, name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, module_name = 0x7fff9fc59640 "\220\n", has_dynamic_init = 140735873914192, gcc_location = 0x7f55704adde0 <_nl_C_locobj>, odr_indicator = 140004931726179}, {beg = 136087900959056, size = 5000786010338791936, size_with_redzone = 140733193388032, name = 0x7fff9fc59080 "f=\377pU\177", module_name = 0x70 <error: Cannot access memory at address 0x70>, has_dynamic_init = 135606845974304, gcc_location = 0x7fff9fc59080, odr_indicator = 49}, {beg = 140735873912720, size = 140004931142716, size_with_redzone = 206158430240, name = 0x7fff9fc58fa0 "\037\033\357pU\177", module_name = 0x7fff9fc58ee0 "\200\224\305\237\377\177", has_dynamic_init = 5000786010338791936, gcc_location = 0x7fff9fc59480, odr_indicator = 0}}, reg_sites = {2680524948, 32767, 3367826147, 22048}, access_size = 140735873914416, size = 32 ' '}, wild = {addr = 10342281250613, access_size = 135881742617252}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140004945049495, kind = __asan::kShadowKindGap, shadow_byte = 253 '\375'}, heap = {addr = 140004945049495, alloc_tid = 57392033561857, free_tid = 16950855746784, alloc_stack_id = 65535, free_stack_id = 0, chunk_access = {bad_addr = 94698810902656, offset = 140735873914064, chunk_begin = 136156620396832, chunk_size = 94698807539558, user_requested_alignment = 1296, access_type = 1, alloc_type = 2}}, stack = {addr = 140004945049495, tid = 57392033561857, offset = 16950855746784, frame_pc = 65535, access_size = 94698810902656, frame_descr = 0x7fff9fc594d0 "\020\225\305\237\377\177"}, global = {addr = 140004945049495, static kMaxGlobals = 4, globals = {{beg = 57392033561857, size = 16950855746784, size_with_redzone = 65535, name = 0x5620c8fc0880 "%s:%s() ", module_name = 0x7fff9fc594d0 "\020\225\305\237\377\177", has_dynamic_init = 136156620396832, gcc_location = 0x5620c8c8b766 <btd_debug+358>, odr_indicator = 140735873914128}, {beg = 140004944431426, size = 19860395280, size_with_redzone = 87, name = 0x7f557104598c "sendmsg", module_name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, has_dynamic_init = 1, gcc_location = 0x7b556e057340, odr_indicator = 16950856035904}, {beg = 94698809707719, size = 135605002436695, size_with_redzone = 140735873914224, name = 0xf6aadc0ae40 <error: Cannot access memory at address 0xf6aadc0ae40>, module_name = 0x7b556e057250 "", has_dynamic_init = 140735873914496, gcc_location = 0x45665c618ffc9200, odr_indicator = 16950855890002}, {beg = 3847307972724495752, size = 94698810902592, size_with_redzone = 94698810911584, name = 0x7b956f000a90 "h\t", module_name = 0xa148d <error: Cannot access memory at address 0xa148d>, has_dynamic_init = 135606845974048, gcc_location = 0x45665c618ffc9200, odr_indicator = 67}}, reg_sites = {2680526312, 32767, 2680526560, 32767}, access_size = 140004931353514, size = 116 't'}, wild = {addr = 140004945049495, access_size = 57392033561857}}}}, function = 0x7fff9fc595e8 "0\254\344\310 V"}, StringFunctionSizeOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, addr_description = {data = {kind = 1862273700, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10342281250613, alloc_stack_id = 1862273700, free_stack_id = 31637, chunk_access = {bad_addr = 20, offset = 135881742617232, chunk_begin = 40, chunk_size = 61802964934664, user_requested_alignment = 512, access_type = 1, alloc_type = 2}}, stack = {addr = 0, tid = 0, offset = 10342281250613, frame_pc = 135881742617252, access_size = 20, frame_descr = 0x7b956f000a90 "h\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10342281250613, size_with_redzone = 135881742617252, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b956f000a90 "h\t", has_dynamic_init = 40, gcc_location = 0x38359fc56008, odr_indicator = 5000786010338791936}, {beg = 16, size = 140004932695682, size_with_redzone = 140735873912935, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7fff9fc59067 "", has_dynamic_init = 206158430224, gcc_location = 0x7fff9fc59640, odr_indicator = 140735873914192}, {beg = 140004932902368, size = 140004931726179, size_with_redzone = 136087900959056, name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, module_name = 0x7fff00000000 <error: Cannot access memory at address 0x7fff00000000>, has_dynamic_init = 140735873912960, gcc_location = 0x70, odr_indicator = 135606845974304}, {beg = 140735873912960, size = 49, size_with_redzone = 140735873912720, name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140735873912736, gcc_location = 0x7fff9fc58ee0, odr_indicator = 5000786010338791936}}, reg_sites = {2680525952, 32767, 0, 0}, access_size = 140735873912980, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}, size = 140735873914416}, BadParamsToAnnotateContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, beg = 135881742617252, end = 0, old_mid = 0, new_mid = 10342281250613}, BadParamsToAnnotateDoubleEndedContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, storage_beg = 135881742617252, storage_end = 0, old_container_beg = 0, old_container_end = 10342281250613, new_container_beg = 135881742617252, new_container_end = 20}, BadParamsToCopyContiguousContainerAnnotations = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, stack = 0x7f5500000002, old_storage_beg = 135881742617252, old_storage_end = 0, new_storage_beg = 0, new_storage_end = 10342281250613}, ODRViolation = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, global1 = {beg = 140003048947714, size = 135881742617252, size_with_redzone = 0, name = 0x0, module_name = 0x96800000735 <error: Cannot access memory at address 0x96800000735>, has_dynamic_init = 135881742617252, gcc_location = 0x14, odr_indicator = 135881742617232}, global2 = {beg = 40, size = 61802964934664, size_with_redzone = 5000786010338791936, name = 0x10 <error: Cannot access memory at address 0x10>, module_name = 0x7f557047b682 "T ", has_dynamic_init = 140735873912935, gcc_location = 0xf, odr_indicator = 140735873912935}, stack_id1 = 16, stack_id2 = 48}, InvalidPointerPair = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, pc = 140003048947714, bp = 135881742617252, sp = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 10342281250613, kind = (unknown: 0xa4), shadow_byte = 10 '\n'}, heap = {addr = 10342281250613, alloc_tid = 135881742617252, free_tid = 20, alloc_stack_id = 1862273680, free_stack_id = 31637, chunk_access = {bad_addr = 40, offset = 61802964934664, chunk_begin = 5000786010338791936, chunk_size = 16, user_requested_alignment = 1666, access_type = 3, alloc_type = 2}}, stack = {addr = 10342281250613, tid = 135881742617252, offset = 20, frame_pc = 135881742617232, access_size = 40, frame_descr = 0x38359fc56008 <error: Cannot access memory at address 0x38359fc56008>}, global = {addr = 10342281250613, static kMaxGlobals = 4, globals = {{beg = 135881742617252, size = 20, size_with_redzone = 135881742617232, name = 0x28 <error: Cannot access memory at address 0x28>, module_name = 0x38359fc56008 <error: Cannot access memory at address 0x38359fc56008>, has_dynamic_init = 5000786010338791936, gcc_location = 0x10, odr_indicator = 140004932695682}, {beg = 140735873912935, size = 15, size_with_redzone = 140735873912935, name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, module_name = 0x7fff9fc59640 "\220\n", has_dynamic_init = 140735873914192, gcc_location = 0x7f55704adde0 <_nl_C_locobj>, odr_indicator = 140004931726179}, {beg = 136087900959056, size = 5000786010338791936, size_with_redzone = 140733193388032, name = 0x7fff9fc59080 "f=\377pU\177", module_name = 0x70 <error: Cannot access memory at address 0x70>, has_dynamic_init = 135606845974304, gcc_location = 0x7fff9fc59080, odr_indicator = 49}, {beg = 140735873912720, size = 140004931142716, size_with_redzone = 206158430240, name = 0x7fff9fc58fa0 "\037\033\357pU\177", module_name = 0x7fff9fc58ee0 "\200\224\305\237\377\177", has_dynamic_init = 5000786010338791936, gcc_location = 0x7fff9fc59480, odr_indicator = 0}}, reg_sites = {2680524948, 32767, 3367826147, 22048}, access_size = 140735873914416, size = 32 ' '}, wild = {addr = 10342281250613, access_size = 135881742617252}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 140004945049495, kind = __asan::kShadowKindGap, shadow_byte = 253 '\375'}, heap = {addr = 140004945049495, alloc_tid = 57392033561857, free_tid = 16950855746784, alloc_stack_id = 65535, free_stack_id = 0, chunk_access = {bad_addr = 94698810902656, offset = 140735873914064, chunk_begin = 136156620396832, chunk_size = 94698807539558, user_requested_alignment = 1296, access_type = 1, alloc_type = 2}}, stack = {addr = 140004945049495, tid = 57392033561857, offset = 16950855746784, frame_pc = 65535, access_size = 94698810902656, frame_descr = 0x7fff9fc594d0 "\020\225\305\237\377\177"}, global = {addr = 140004945049495, static kMaxGlobals = 4, globals = {{beg = 57392033561857, size = 16950855746784, size_with_redzone = 65535, name = 0x5620c8fc0880 "%s:%s() ", module_name = 0x7fff9fc594d0 "\020\225\305\237\377\177", has_dynamic_init = 136156620396832, gcc_location = 0x5620c8c8b766 <btd_debug+358>, odr_indicator = 140735873914128}, {beg = 140004944431426, size = 19860395280, size_with_redzone = 87, name = 0x7f557104598c "sendmsg", module_name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, has_dynamic_init = 1, gcc_location = 0x7b556e057340, odr_indicator = 16950856035904}, {beg = 94698809707719, size = 135605002436695, size_with_redzone = 140735873914224, name = 0xf6aadc0ae40 <error: Cannot access memory at address 0xf6aadc0ae40>, module_name = 0x7b556e057250 "", has_dynamic_init = 140735873914496, gcc_location = 0x45665c618ffc9200, odr_indicator = 16950855890002}, {beg = 3847307972724495752, size = 94698810902592, size_with_redzone = 94698810911584, name = 0x7b956f000a90 "h\t", module_name = 0xa148d <error: Cannot access memory at address 0xa148d>, has_dynamic_init = 135606845974048, gcc_location = 0x45665c618ffc9200, odr_indicator = 67}}, reg_sites = {2680526312, 32767, 2680526560, 32767}, access_size = 140004931353514, size = 116 't'}, wild = {addr = 140004945049495, access_size = 57392033561857}}}}}, Generic = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 135881742617252, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 135881742617252, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2408, chunk_access = {bad_addr = 135881742617252, offset = 20, chunk_begin = 135881742617232, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 135881742617252, tid = 0, offset = 0, frame_pc = 10342281250613, access_size = 135881742617252, frame_descr = 0x14 <error: Cannot access memory at address 0x14>}, global = {addr = 135881742617252, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 10342281250613, name = 0x7b956f000aa4 "", module_name = 0x14 <error: Cannot access memory at address 0x14>, has_dynamic_init = 135881742617232, gcc_location = 0x28, odr_indicator = 61802964934664}, {beg = 5000786010338791936, size = 16, size_with_redzone = 140004932695682, name = 0x7fff9fc59067 "", module_name = 0xf <error: Cannot access memory at address 0xf>, has_dynamic_init = 140735873912935, gcc_location = 0x3000000010, odr_indicator = 140735873914432}, {beg = 140735873914192, size = 140004932902368, size_with_redzone = 140004931726179, name = 0x7bc56efeb150 "_", module_name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, has_dynamic_init = 140733193388032, gcc_location = 0x7fff9fc59080, odr_indicator = 112}, {beg = 135606845974304, size = 140735873912960, size_with_redzone = 49, name = 0x7fff9fc58f90 "\240'\342mU{", module_name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", has_dynamic_init = 206158430240, gcc_location = 0x7fff9fc58fa0, odr_indicator = 140735873912544}}, reg_sites = {2415694336, 1164336225, 2680525952, 32767}, access_size = 0, size = 148 '\224'}, wild = {addr = 135881742617252, access_size = 0}}}}, pc = 94698806768355, bp = 140735873914416, sp = 140735873914400, access_size = 4, bug_descr = 0x7f5571043797 "heap-use-after-free", is_write = true, shadow_val = 253 '\375'}}}, halt_on_error_ = true}
                error = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\260E\237\377\177\000\0002\000\000\000\000\000\000\000\240'\342mU{\000\0001\000\000\000\000\000\000\000\330\222\305\237\377\177\000\000\240'\342mU{\000\000@\212\305\237\377\177\000\000\037\033\357pU\177\000\000\001\000\000\000\000\000\000\000\240'\342mU{\000\000\220\222\305\237\377\177\000\000\322\265\375pU\177\000\000\240\212\305\237\377\177\000\0008w\357p\036\000\000\000p\212\305\237\377\177\000\000\003\000\000\000\000\000\000\000\020\266\375pU\177\000\000\217;3pU\177\000\000\273\321\351\310 V\000\000P\225\305\237"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 135881742617252, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 135881742617252, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2408, chunk_access = {bad_addr = 135881742617252, offset = 20, chunk_begin = 135881742617232, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 135881742617252, tid = 0, offset = 0, frame_pc = 10342281250613, access_size = 135881742617252, frame_descr = 0x14 <error: Cannot access memory at address 0x14>}, global = {addr = 135881742617252, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 10342281250613, name = 0x7b956f000aa4 "", module_name = 0x14 <error: Cannot access memory at address 0x14>, has_dynamic_init = 135881742617232, gcc_location = 0x28, odr_indicator = 61802964934664}, {beg = 5000786010338791936, size = 16, size_with_redzone = 140004932695682, name = 0x7fff9fc59067 "", module_name = 0xf <error: Cannot access memory at address 0xf>, has_dynamic_init = 140735873912935, gcc_location = 0x3000000010, odr_indicator = 140735873914432}, {beg = 140735873914192, size = 140004932902368, size_with_redzone = 140004931726179, name = 0x7bc56efeb150 "_", module_name = 0x45665c618ffc9200 <error: Cannot access memory at address 0x45665c618ffc9200>, has_dynamic_init = 140733193388032, gcc_location = 0x7fff9fc59080, odr_indicator = 112}, {beg = 135606845974304, size = 140735873912960, size_with_redzone = 49, name = 0x7fff9fc58f90 "\240'\342mU{", module_name = 0x7f557030043c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", has_dynamic_init = 206158430240, gcc_location = 0x7fff9fc58fa0, odr_indicator = 140735873912544}}, reg_sites = {2415694336, 1164336225, 2680525952, 32767}, access_size = 0, size = 148 '\224'}, wild = {addr = 135881742617252, access_size = 0}}}}, pc = 94698806768355, bp = 140735873914416, sp = 140735873914400, access_size = 4, bug_descr = 0x7f5571043797 "heap-use-after-free", is_write = true, shadow_val = 253 '\375'}
        #9  0x00007f5570fe7f8d in __asan::ReportGenericError (pc=<optimized out>, bp=bp@entry=140735873914416, sp=sp@entry=140735873914400, addr=<optimized out>, is_write=is_write@entry=true, access_size=access_size@entry=4, exp=<optimized out>, fatal=true) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
                in_report = <optimized out>
                error = <optimized out>
                enable_fp = <optimized out>
        #10 0x00007f5570fe985c in __asan::__asan_report_store4 (addr=<optimized out>) at ../../../../src/libsanitizer/asan/asan_rtl.cpp:135
                bp = 140735873914416
                pc = <optimized out>
                local_stack = 94698809371696
                sp = 140735873914400
        #11 0x00005620c8bcf2e3 in report_notify_destroy (user_data=<optimized out>) at profiles/input/hog-lib.c:359
                report = <optimized out>
                __func__ = "report_notify_destroy"
        #12 0x00005620c8c72052 in attrib_callbacks_destroy (data=0x7bb56eff1c60) at attrib/gattrib.c:130
                cb = 0x7bb56eff1c60
        #13 0x00005620c8e6151b in notify_data_unref (data=<optimized out>) at src/shared/gatt-client.c:256
                notify_data = <optimized out>
        #14 notify_data_unref (data=<optimized out>) at src/shared/gatt-client.c:248
                notify_data = <optimized out>
        #15 0x00005620c8e5c3e0 in destroy_write_op (data=0x7b856f000bc0) at src/shared/gatt-client.c:3189
                op = 0x7b856f000bc0
        #16 0x00005620c8e6c153 in request_unref (data=0x7b956f006510) at src/shared/gatt-client.c:201
                req = 0x7b956f006510
                client = 0x7c656efe1940
        #17 0x00005620c8e4b1a4 in destroy_att_send_op (data=0x7bb56eff2c20) at src/shared/att.c:215
                op = 0x7bb56eff2c20
        #18 0x00005620c8e54fe0 in bt_att_cancel (att=<optimized out>, id=<optimized out>) at src/shared/att.c:1925
                entry = 0x0
                op = <optimized out>
        #19 0x00005620c8e60cc3 in cancel_request (req=<optimized out>) at src/shared/gatt-client.c:2783
        No locals.
        #20 0x00005620c8e0bb32 in queue_remove_all (queue=0x7b856efeadb0, function=function@entry=0x0, user_data=user_data@entry=0x0, destroy=destroy@entry=0x5620c8e61230 <cancel_pending>) at src/shared/queue.c:341
                tmp = 0x7b756f00a3f0
                entry = 0x0
                count = <optimized out>
        #21 0x00005620c8e67d3f in bt_gatt_client_cancel_all (client=client@entry=0x7c656efe1940) at src/shared/gatt-client.c:2811
        No locals.
        #22 0x00005620c8e67fdd in bt_gatt_client_free (client=0x7c656efe1940) at src/shared/gatt-client.c:2290
        No locals.
        #23 0x00005620c8e69d1c in bt_gatt_client_unref (client=<optimized out>) at src/shared/gatt-client.c:2605
        No locals.
        #24 0x00005620c8c735ed in g_attrib_unref (attrib=0x7bd56efe18a0) at attrib/gattrib.c:158
                __func__ = "g_attrib_unref"
        #25 0x00005620c8d7752e in attio_cleanup (device=<optimized out>) at src/device.c:874
                attrib = <optimized out>
        #26 0x00005620c8d77a77 in device_free (user_data=0x7cc56efe0080) at src/device.c:918
                device = 0x7cc56efe0080
                __func__ = "device_free"
        #27 0x00005620c8df568a in remove_interface (data=0x7bc56efe4e70, name=name@entry=0x5620c9001ae0 "org.bluez.Device1") at gdbus/object.c:742
                iface = 0x7bb56efe5ae0
        #28 0x00005620c8df824c in g_dbus_unregister_interface (connection=<optimized out>, path=<optimized out>, name=<optimized out>) at gdbus/object.c:1499
                data = <optimized out>
        #29 0x00005620c8d32d48 in adapter_remove (adapter=adapter@entry=0x7c856efe0200) at src/adapter.c:7321
                device = 0x7cc56efe0080
                db = <optimized out>
                ranging_manager = <optimized out>
                __func__ = "adapter_remove"
        #30 0x00005620c8d33888 in adapter_cleanup () at src/adapter.c:11274
                adapter = 0x7c856efe0200
        #31 0x00005620c8ae4330 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1723
                context = <optimized out>
                err = <optimized out>
                sdp_mtu = 0
                sdp_flags = <optimized out>
                gdbus_flags = <optimized out>
                __func__ = "main""
FAIL functional.test_hog::test_hog[sci-hosts15-vm2]: failed on teardown with "pytest_bluezenv.plugin.CoredumpWarning: Core dump: test-bluezenv-hosts15.0-bluetoothd-1790261899-128.core
        /usr/bin/gdb: warning: Couldn't determine a path for the index cache directory.
        [New LWP 128]
        [Thread debugging using libthread_db enabled]
        Using host libthread_db library "/usr/lib/x86_64-linux-gnu/libthread_db.so.1".
        Core was generated by `/home/runner/work/bluez/bluez/src/src/src/bluetoothd --nodetach -f /run/bluetoo'.
        Program terminated with signal SIGABRT, Aborted.
        #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44

        warning: 44	./nptl/pthread_kill.c: No such file or directory

        Thread 1 (Thread 0x7f27f96d3900 (LWP 128)):
        #0  __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=0) at ./nptl/pthread_kill.c:44
                tid = <optimized out>
                ret = 0
                pd = <optimized out>
                old_mask = {__val = {0}}
                ret = <optimized out>
        #1  __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
        No locals.
        #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:100
        No locals.
        #3  0x00007f27f9e2eb7e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
                ret = <optimized out>
        #4  0x00007f27f9e118ec in __GI_abort () at ./stdlib/abort.c:77
                act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction = 0x0}, sa_mask = {__val = {0 <repeats 16 times>}}, sa_flags = 0, sa_restorer = 0x0}
        #5  0x00007f27faa39a0f in __sanitizer::Abort () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp:165
        No locals.
        #6  0x00007f27fab5fc2d in __sanitizer::Die () at ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cpp:58
        No locals.
        #7  0x00007f27fab3493c in __asan::ScopedInErrorReport::~ScopedInErrorReport (this=0x7ffe82debf76) at ../../../../src/libsanitizer/asan/asan_report.cpp:221
                buffer_copy = {buffer_ = {<__sanitizer::InternalMmapVectorNoCtor<char, false>> = {data_ = 0x7b27f3825000 '=' <repeats 65 times>, "\n==128==ERROR: AddressSanitizer: heap-use-after-free on address 0x7b67f8c006e4 at pc 0x558db2bfd2e3 bp 0x7ffe82decbf0 sp 0x7ffe82decbe0"..., capacity_bytes_ = 8192, size_ = 4298}, <No data fields>}}
                buffer_copy = <optimized out>
                l = <optimized out>
        #8  0x00007f27fab33e02 in __asan::ReportGenericError (pc=94067077665507, bp=140731094060016, sp=sp@entry=140731094060000, addr=135686485182180, is_write=is_write@entry=true, access_size=4, fatal=true, exp=<optimized out>) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
                in_report = {error_report_lock_ = {<No data fields>}, static current_error_ = {kind = __asan::kErrorKindGeneric, {Base = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, DeadlySignal = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, signal = {siginfo = 0x7f2700000002, context = 0x7b67f8c006e4, addr = 0, pc = 0, sp = 10441065498421, bp = 135686485182180, is_memory_access = 20, write_flag = __sanitizer::SignalContext::Unknown, is_true_faulting_addr = 208}}, DoubleFree = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, second_free_stack = 0x7f2700000002, addr_description = {addr = 135686485182180, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2431, chunk_access = {bad_addr = 135686485182180, offset = 20, chunk_begin = 135686485182160, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}}, NewDeleteTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, free_stack = 0x7f2700000002, addr_description = {addr = 135686485182180, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2431, chunk_access = {bad_addr = 135686485182180, offset = 20, chunk_begin = 135686485182160, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, delete_size = 11908522307766607616, delete_alignment = 16}, FreeNotMalloced = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, free_stack = 0x7f2700000002, addr_description = {data = {kind = 4173334244, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10441065498421, alloc_stack_id = 4173334244, free_stack_id = 31591, chunk_access = {bad_addr = 20, offset = 135686485182160, chunk_begin = 40, chunk_size = 62884811792392, user_requested_alignment = 3840, access_type = 1, alloc_type = 1}}, stack = {addr = 0, tid = 0, offset = 10441065498421, frame_pc = 135686485182180, access_size = 20, frame_descr = 0x7b67f8c006d0 "\177\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10441065498421, size_with_redzone = 135686485182180, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b67f8c006d0 "\177\t", has_dynamic_init = 40, gcc_location = 0x393182de6008, odr_indicator = 11908522307766607616}, {beg = 16, size = 139809674524290, size_with_redzone = 140731094058535, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7ffe82dec627 "", has_dynamic_init = 206158430224, gcc_location = 0x7ffe82decc00, odr_indicator = 140731094059792}, {beg = 139809674730976, size = 139809673554787, size_with_redzone = 135892643527184, name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, module_name = 0x7ffe00000000 <error: Cannot access memory at address 0x7ffe00000000>, has_dynamic_init = 140731094058560, gcc_location = 0x80, odr_indicator = 135411588563488}, {beg = 140731094058560, size = 49, size_with_redzone = 140731094058320, name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140731094058336, gcc_location = 0x7ffe82dec4a0, odr_indicator = 11908522307766607616}}, reg_sites = {2195638848, 32766, 0, 0}, access_size = 140731094058580, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, AllocTypeMismatch = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, dealloc_stack = 0x7f2700000002, alloc_type = 4173334244, dealloc_type = 31591, addr_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 0, kind = (__asan::kShadowKindGap | unknown: 0x34), shadow_byte = 7 '\a'}, heap = {addr = 0, alloc_tid = 10441065498421, free_tid = 135686485182180, alloc_stack_id = 20, free_stack_id = 0, chunk_access = {bad_addr = 135686485182160, offset = 40, chunk_begin = 62884811792392, chunk_size = 11908522307766607616, user_requested_alignment = 16, access_type = 0, alloc_type = 0}}, stack = {addr = 0, tid = 10441065498421, offset = 135686485182180, frame_pc = 20, access_size = 135686485182160, frame_descr = 0x28 <error: Cannot access memory at address 0x28>}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 10441065498421, size = 135686485182180, size_with_redzone = 20, name = 0x7b67f8c006d0 "\177\t", module_name = 0x28 <error: Cannot access memory at address 0x28>, has_dynamic_init = 62884811792392, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 16}, {beg = 139809674524290, size = 140731094058535, size_with_redzone = 15, name = 0x7ffe82dec627 "", module_name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, has_dynamic_init = 140731094060032, gcc_location = 0x7ffe82decb10, odr_indicator = 139809674730976}, {beg = 139809673554787, size = 135892643527184, size_with_redzone = 11908522307766607616, name = 0x7ffe00000000 <error: Cannot access memory at address 0x7ffe00000000>, module_name = 0x7ffe82dec640 "f\375\263\372'\177", has_dynamic_init = 128, gcc_location = 0x7b27f7a28220, odr_indicator = 140731094058560}, {beg = 49, size = 140731094058320, size_with_redzone = 139809672971324, name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, module_name = 0x7ffe82dec560 "\037\333\243\372'\177", has_dynamic_init = 140731094058144, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 140731094059584}}, reg_sites = {0, 0, 2195637844, 32766}, access_size = 94067077665507, size = 240 '\360'}, wild = {addr = 0, access_size = 10441065498421}}}}}, MallocUsableSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, addr_description = {data = {kind = 4173334244, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10441065498421, alloc_stack_id = 4173334244, free_stack_id = 31591, chunk_access = {bad_addr = 20, offset = 135686485182160, chunk_begin = 40, chunk_size = 62884811792392, user_requested_alignment = 3840, access_type = 1, alloc_type = 1}}, stack = {addr = 0, tid = 0, offset = 10441065498421, frame_pc = 135686485182180, access_size = 20, frame_descr = 0x7b67f8c006d0 "\177\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10441065498421, size_with_redzone = 135686485182180, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b67f8c006d0 "\177\t", has_dynamic_init = 40, gcc_location = 0x393182de6008, odr_indicator = 11908522307766607616}, {beg = 16, size = 139809674524290, size_with_redzone = 140731094058535, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7ffe82dec627 "", has_dynamic_init = 206158430224, gcc_location = 0x7ffe82decc00, odr_indicator = 140731094059792}, {beg = 139809674730976, size = 139809673554787, size_with_redzone = 135892643527184, name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, module_name = 0x7ffe00000000 <error: Cannot access memory at address 0x7ffe00000000>, has_dynamic_init = 140731094058560, gcc_location = 0x80, odr_indicator = 135411588563488}, {beg = 140731094058560, size = 49, size_with_redzone = 140731094058320, name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140731094058336, gcc_location = 0x7ffe82dec4a0, odr_indicator = 11908522307766607616}}, reg_sites = {2195638848, 32766, 0, 0}, access_size = 140731094058580, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, SanitizerGetAllocatedSizeNotOwned = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, addr_description = {data = {kind = 4173334244, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10441065498421, alloc_stack_id = 4173334244, free_stack_id = 31591, chunk_access = {bad_addr = 20, offset = 135686485182160, chunk_begin = 40, chunk_size = 62884811792392, user_requested_alignment = 3840, access_type = 1, alloc_type = 1}}, stack = {addr = 0, tid = 0, offset = 10441065498421, frame_pc = 135686485182180, access_size = 20, frame_descr = 0x7b67f8c006d0 "\177\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10441065498421, size_with_redzone = 135686485182180, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b67f8c006d0 "\177\t", has_dynamic_init = 40, gcc_location = 0x393182de6008, odr_indicator = 11908522307766607616}, {beg = 16, size = 139809674524290, size_with_redzone = 140731094058535, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7ffe82dec627 "", has_dynamic_init = 206158430224, gcc_location = 0x7ffe82decc00, odr_indicator = 140731094059792}, {beg = 139809674730976, size = 139809673554787, size_with_redzone = 135892643527184, name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, module_name = 0x7ffe00000000 <error: Cannot access memory at address 0x7ffe00000000>, has_dynamic_init = 140731094058560, gcc_location = 0x80, odr_indicator = 135411588563488}, {beg = 140731094058560, size = 49, size_with_redzone = 140731094058320, name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140731094058336, gcc_location = 0x7ffe82dec4a0, odr_indicator = 11908522307766607616}}, reg_sites = {2195638848, 32766, 0, 0}, access_size = 140731094058580, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}}, CallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, count = 135686485182180, size = 0}, ReallocArrayOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, count = 135686485182180, size = 0}, PvallocOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, size = 135686485182180}, InvalidAllocationAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, alignment = 135686485182180}, InvalidAlignedAllocAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, size = 135686485182180, alignment = 0}, InvalidPosixMemalignAlignment = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, alignment = 135686485182180}, AllocationSizeTooBig = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, user_size = 135686485182180, total_size = 0, max_size = 0}, RssLimitExceeded = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002}, OutOfMemory = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, requested_size = 135686485182180}, StringFunctionMemoryRangesOverlap = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, length1 = 135686485182180, length2 = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 10441065498421, kind = (unknown: 0xe4), shadow_byte = 6 '\006'}, heap = {addr = 10441065498421, alloc_tid = 135686485182180, free_tid = 20, alloc_stack_id = 4173334224, free_stack_id = 31591, chunk_access = {bad_addr = 40, offset = 62884811792392, chunk_begin = 11908522307766607616, chunk_size = 16, user_requested_alignment = 1666, access_type = 3, alloc_type = 1}}, stack = {addr = 10441065498421, tid = 135686485182180, offset = 20, frame_pc = 135686485182160, access_size = 40, frame_descr = 0x393182de6008 <error: Cannot access memory at address 0x393182de6008>}, global = {addr = 10441065498421, static kMaxGlobals = 4, globals = {{beg = 135686485182180, size = 20, size_with_redzone = 135686485182160, name = 0x28 <error: Cannot access memory at address 0x28>, module_name = 0x393182de6008 <error: Cannot access memory at address 0x393182de6008>, has_dynamic_init = 11908522307766607616, gcc_location = 0x10, odr_indicator = 139809674524290}, {beg = 140731094058535, size = 15, size_with_redzone = 140731094058535, name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, module_name = 0x7ffe82decc00 "\320\006\300\370g{", has_dynamic_init = 140731094059792, gcc_location = 0x7f27f9ff9de0 <_nl_C_locobj>, odr_indicator = 139809673554787}, {beg = 135892643527184, size = 11908522307766607616, size_with_redzone = 140728898420736, name = 0x7ffe82dec640 "f\375\263\372'\177", module_name = 0x80 <error: Cannot access memory at address 0x80>, has_dynamic_init = 135411588563488, gcc_location = 0x7ffe82dec640, odr_indicator = 49}, {beg = 140731094058320, size = 139809672971324, size_with_redzone = 206158430240, name = 0x7ffe82dec560 "\037\333\243\372'\177", module_name = 0x7ffe82dec4a0 "@\312\336\202\376\177", has_dynamic_init = 11908522307766607616, gcc_location = 0x7ffe82deca40, odr_indicator = 0}}, reg_sites = {2195637844, 32766, 2998915811, 21901}, access_size = 140731094060016, size = 224 '\340'}, wild = {addr = 10441065498421, access_size = 135686485182180}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 139809686878103, kind = __asan::kShadowKindGap, shadow_byte = 253 '\375'}, heap = {addr = 139809686878103, alloc_tid = 57391548660993, free_tid = 16926448570432, alloc_stack_id = 65535, free_stack_id = 0, chunk_access = {bad_addr = 94067081799808, offset = 140731094059664, chunk_begin = 135961362961568, chunk_size = 94067078436710, user_requested_alignment = 2768, access_type = 0, alloc_type = 3}}, stack = {addr = 139809686878103, tid = 57391548660993, offset = 16926448570432, frame_pc = 65535, access_size = 94067081799808, frame_descr = 0x7ffe82deca90 "\320\312\336\202\376\177"}, global = {addr = 139809686878103, static kMaxGlobals = 4, globals = {{beg = 57391548660993, size = 16926448570432, size_with_redzone = 65535, name = 0x558db2fee880 "%s:%s() ", module_name = 0x7ffe82deca90 "\320\312\336\202\376\177", has_dynamic_init = 135961362961568, gcc_location = 0x558db2cb9766 <btd_debug+358>, odr_indicator = 140731094059728}, {beg = 139809686260034, size = 19375508176, size_with_redzone = 87, name = 0x7f27fab9198c "sendmsg", module_name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, has_dynamic_init = 1, gcc_location = 0x7b27f7c60940, odr_indicator = 16926448861440}, {beg = 94067080604871, size = 135407433941079, size_with_redzone = 140731094059824, name = 0xf64fef8c100 <error: Cannot access memory at address 0xf64fef8c100>, module_name = 0x7b27f7c60850 "", has_dynamic_init = 140731094060096, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 16926448715730}, {beg = 3990578735385332552, size = 94067081799744, size_with_redzone = 94067081808736, name = 0x7b67f8c006d0 "\177\t", module_name = 0xa96fb <error: Cannot access memory at address 0xa96fb>, has_dynamic_init = 135411588563232, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 67}}, reg_sites = {2195639208, 32766, 2195639456, 32766}, access_size = 139809673182122, size = 116 't'}, wild = {addr = 139809686878103, access_size = 57391548660993}}}}, function = 0x7ffe82decba8 "0\214\347\262\215U"}, StringFunctionSizeOverflow = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, addr_description = {data = {kind = 4173334244, {shadow = {addr = 0, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 0, alloc_tid = 0, free_tid = 10441065498421, alloc_stack_id = 4173334244, free_stack_id = 31591, chunk_access = {bad_addr = 20, offset = 135686485182160, chunk_begin = 40, chunk_size = 62884811792392, user_requested_alignment = 3840, access_type = 1, alloc_type = 1}}, stack = {addr = 0, tid = 0, offset = 10441065498421, frame_pc = 135686485182180, access_size = 20, frame_descr = 0x7b67f8c006d0 "\177\t"}, global = {addr = 0, static kMaxGlobals = 4, globals = {{beg = 0, size = 10441065498421, size_with_redzone = 135686485182180, name = 0x14 <error: Cannot access memory at address 0x14>, module_name = 0x7b67f8c006d0 "\177\t", has_dynamic_init = 40, gcc_location = 0x393182de6008, odr_indicator = 11908522307766607616}, {beg = 16, size = 139809674524290, size_with_redzone = 140731094058535, name = 0xf <error: Cannot access memory at address 0xf>, module_name = 0x7ffe82dec627 "", has_dynamic_init = 206158430224, gcc_location = 0x7ffe82decc00, odr_indicator = 140731094059792}, {beg = 139809674730976, size = 139809673554787, size_with_redzone = 135892643527184, name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, module_name = 0x7ffe00000000 <error: Cannot access memory at address 0x7ffe00000000>, has_dynamic_init = 140731094058560, gcc_location = 0x80, odr_indicator = 135411588563488}, {beg = 140731094058560, size = 49, size_with_redzone = 140731094058320, name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", module_name = 0x3000000020 <error: Cannot access memory at address 0x3000000020>, has_dynamic_init = 140731094058336, gcc_location = 0x7ffe82dec4a0, odr_indicator = 11908522307766607616}}, reg_sites = {2195638848, 32766, 0, 0}, access_size = 140731094058580, size = 227 '\343'}, wild = {addr = 0, access_size = 0}}}}, size = 140731094060016}, BadParamsToAnnotateContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, beg = 135686485182180, end = 0, old_mid = 0, new_mid = 10441065498421}, BadParamsToAnnotateDoubleEndedContiguousContainer = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, storage_beg = 135686485182180, storage_end = 0, old_container_beg = 0, old_container_end = 10441065498421, new_container_beg = 135686485182180, new_container_end = 20}, BadParamsToCopyContiguousContainerAnnotations = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, stack = 0x7f2700000002, old_storage_beg = 135686485182180, old_storage_end = 0, new_storage_beg = 0, new_storage_end = 10441065498421}, ODRViolation = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, global1 = {beg = 139805480452098, size = 135686485182180, size_with_redzone = 0, name = 0x0, module_name = 0x97f00000735 <error: Cannot access memory at address 0x97f00000735>, has_dynamic_init = 135686485182180, gcc_location = 0x14, odr_indicator = 135686485182160}, global2 = {beg = 40, size = 62884811792392, size_with_redzone = 11908522307766607616, name = 0x10 <error: Cannot access memory at address 0x10>, module_name = 0x7f27f9fc7682 "T ", has_dynamic_init = 140731094058535, gcc_location = 0xf, odr_indicator = 140731094058535}, stack_id1 = 16, stack_id2 = 48}, InvalidPointerPair = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, pc = 139805480452098, bp = 135686485182180, sp = 0, addr1_description = {data = {kind = __asan::kAddressKindWild, {shadow = {addr = 10441065498421, kind = (unknown: 0xe4), shadow_byte = 6 '\006'}, heap = {addr = 10441065498421, alloc_tid = 135686485182180, free_tid = 20, alloc_stack_id = 4173334224, free_stack_id = 31591, chunk_access = {bad_addr = 40, offset = 62884811792392, chunk_begin = 11908522307766607616, chunk_size = 16, user_requested_alignment = 1666, access_type = 3, alloc_type = 1}}, stack = {addr = 10441065498421, tid = 135686485182180, offset = 20, frame_pc = 135686485182160, access_size = 40, frame_descr = 0x393182de6008 <error: Cannot access memory at address 0x393182de6008>}, global = {addr = 10441065498421, static kMaxGlobals = 4, globals = {{beg = 135686485182180, size = 20, size_with_redzone = 135686485182160, name = 0x28 <error: Cannot access memory at address 0x28>, module_name = 0x393182de6008 <error: Cannot access memory at address 0x393182de6008>, has_dynamic_init = 11908522307766607616, gcc_location = 0x10, odr_indicator = 139809674524290}, {beg = 140731094058535, size = 15, size_with_redzone = 140731094058535, name = 0x3000000010 <error: Cannot access memory at address 0x3000000010>, module_name = 0x7ffe82decc00 "\320\006\300\370g{", has_dynamic_init = 140731094059792, gcc_location = 0x7f27f9ff9de0 <_nl_C_locobj>, odr_indicator = 139809673554787}, {beg = 135892643527184, size = 11908522307766607616, size_with_redzone = 140728898420736, name = 0x7ffe82dec640 "f\375\263\372'\177", module_name = 0x80 <error: Cannot access memory at address 0x80>, has_dynamic_init = 135411588563488, gcc_location = 0x7ffe82dec640, odr_indicator = 49}, {beg = 140731094058320, size = 139809672971324, size_with_redzone = 206158430240, name = 0x7ffe82dec560 "\037\333\243\372'\177", module_name = 0x7ffe82dec4a0 "@\312\336\202\376\177", has_dynamic_init = 11908522307766607616, gcc_location = 0x7ffe82deca40, odr_indicator = 0}}, reg_sites = {2195637844, 32766, 2998915811, 21901}, access_size = 140731094060016, size = 224 '\340'}, wild = {addr = 10441065498421, access_size = 135686485182180}}}}, addr2_description = {data = {kind = __asan::kAddressKindGlobal, {shadow = {addr = 139809686878103, kind = __asan::kShadowKindGap, shadow_byte = 253 '\375'}, heap = {addr = 139809686878103, alloc_tid = 57391548660993, free_tid = 16926448570432, alloc_stack_id = 65535, free_stack_id = 0, chunk_access = {bad_addr = 94067081799808, offset = 140731094059664, chunk_begin = 135961362961568, chunk_size = 94067078436710, user_requested_alignment = 2768, access_type = 0, alloc_type = 3}}, stack = {addr = 139809686878103, tid = 57391548660993, offset = 16926448570432, frame_pc = 65535, access_size = 94067081799808, frame_descr = 0x7ffe82deca90 "\320\312\336\202\376\177"}, global = {addr = 139809686878103, static kMaxGlobals = 4, globals = {{beg = 57391548660993, size = 16926448570432, size_with_redzone = 65535, name = 0x558db2fee880 "%s:%s() ", module_name = 0x7ffe82deca90 "\320\312\336\202\376\177", has_dynamic_init = 135961362961568, gcc_location = 0x558db2cb9766 <btd_debug+358>, odr_indicator = 140731094059728}, {beg = 139809686260034, size = 19375508176, size_with_redzone = 87, name = 0x7f27fab9198c "sendmsg", module_name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, has_dynamic_init = 1, gcc_location = 0x7b27f7c60940, odr_indicator = 16926448861440}, {beg = 94067080604871, size = 135407433941079, size_with_redzone = 140731094059824, name = 0xf64fef8c100 <error: Cannot access memory at address 0xf64fef8c100>, module_name = 0x7b27f7c60850 "", has_dynamic_init = 140731094060096, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 16926448715730}, {beg = 3990578735385332552, size = 94067081799744, size_with_redzone = 94067081808736, name = 0x7b67f8c006d0 "\177\t", module_name = 0xa96fb <error: Cannot access memory at address 0xa96fb>, has_dynamic_init = 135411588563232, gcc_location = 0xa54391f1e23e5f00, odr_indicator = 67}}, reg_sites = {2195639208, 32766, 2195639456, 32766}, access_size = 139809673182122, size = 116 't'}, wild = {addr = 139809686878103, access_size = 57391548660993}}}}}, Generic = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 135686485182180, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 135686485182180, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2431, chunk_access = {bad_addr = 135686485182180, offset = 20, chunk_begin = 135686485182160, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 135686485182180, tid = 0, offset = 0, frame_pc = 10441065498421, access_size = 135686485182180, frame_descr = 0x14 <error: Cannot access memory at address 0x14>}, global = {addr = 135686485182180, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 10441065498421, name = 0x7b67f8c006e4 "", module_name = 0x14 <error: Cannot access memory at address 0x14>, has_dynamic_init = 135686485182160, gcc_location = 0x28, odr_indicator = 62884811792392}, {beg = 11908522307766607616, size = 16, size_with_redzone = 139809674524290, name = 0x7ffe82dec627 "", module_name = 0xf <error: Cannot access memory at address 0xf>, has_dynamic_init = 140731094058535, gcc_location = 0x3000000010, odr_indicator = 140731094060032}, {beg = 140731094059792, size = 139809674730976, size_with_redzone = 139809673554787, name = 0x7b97f8beba10 "_", module_name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, has_dynamic_init = 140728898420736, gcc_location = 0x7ffe82dec640, odr_indicator = 128}, {beg = 135411588563488, size = 140731094058560, size_with_redzone = 49, name = 0x7ffe82dec550 "\240\202\242\367'{", module_name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", has_dynamic_init = 206158430240, gcc_location = 0x7ffe82dec560, odr_indicator = 140731094058144}}, reg_sites = {3795738368, 2772668913, 2195638848, 32766}, access_size = 0, size = 84 'T'}, wild = {addr = 135686485182180, access_size = 0}}}}, pc = 94067077665507, bp = 140731094060016, sp = 140731094060000, access_size = 4, bug_descr = 0x7f27fab8f797 "heap-use-after-free", is_write = true, shadow_val = 253 '\375'}}}, halt_on_error_ = true}
                error = {<__asan::ErrorBase> = {scariness = {score = 46, descr = "4-byte-write-heap-use-after-free\000\000\000\0002\000\000\000\000\000\000\000\000\360^\202\376\177\000\0002\000\000\000\000\000\000\000\240\202\242\367'{\000\0001\000\000\000\000\000\000\000\230\310\336\202\376\177\000\000\240\202\242\367'{\000\000\000\300\336\202\376\177\000\000\037\333\243\372'\177\000\000\001\000\000\000\000\000\000\000\240\202\242\367'{\000\000P\310\336\202\376\177\000\000\322u\262\372'\177\000\000`\300\336\202\376\177\000\00087\244\372\036\000\000\0000\300\336\202\376\177\000\000\003\000\000\000\000\000\000\000\020v\262\372'\177\000\000\217\373\347\371'\177\000\000\273\261\354\262\215U\000\000\020\313\336\202"...}, tid = 0}, addr_description = {data = {kind = __asan::kAddressKindHeap, {shadow = {addr = 135686485182180, kind = __asan::kShadowKindLow, shadow_byte = 0 '\000'}, heap = {addr = 135686485182180, alloc_tid = 0, free_tid = 0, alloc_stack_id = 1845, free_stack_id = 2431, chunk_access = {bad_addr = 135686485182180, offset = 20, chunk_begin = 135686485182160, chunk_size = 40, user_requested_alignment = 8, access_type = 2, alloc_type = 1}}, stack = {addr = 135686485182180, tid = 0, offset = 0, frame_pc = 10441065498421, access_size = 135686485182180, frame_descr = 0x14 <error: Cannot access memory at address 0x14>}, global = {addr = 135686485182180, static kMaxGlobals = 4, globals = {{beg = 0, size = 0, size_with_redzone = 10441065498421, name = 0x7b67f8c006e4 "", module_name = 0x14 <error: Cannot access memory at address 0x14>, has_dynamic_init = 135686485182160, gcc_location = 0x28, odr_indicator = 62884811792392}, {beg = 11908522307766607616, size = 16, size_with_redzone = 139809674524290, name = 0x7ffe82dec627 "", module_name = 0xf <error: Cannot access memory at address 0xf>, has_dynamic_init = 140731094058535, gcc_location = 0x3000000010, odr_indicator = 140731094060032}, {beg = 140731094059792, size = 139809674730976, size_with_redzone = 139809673554787, name = 0x7b97f8beba10 "_", module_name = 0xa54391f1e23e5f00 <error: Cannot access memory at address 0xa54391f1e23e5f00>, has_dynamic_init = 140728898420736, gcc_location = 0x7ffe82dec640, odr_indicator = 128}, {beg = 135411588563488, size = 140731094058560, size_with_redzone = 49, name = 0x7ffe82dec550 "\240\202\242\367'{", module_name = 0x7f27f9e4c43c <__GI___dprintf+156> "H\213\225H\377\377\377dH+\024%(", has_dynamic_init = 206158430240, gcc_location = 0x7ffe82dec560, odr_indicator = 140731094058144}}, reg_sites = {3795738368, 2772668913, 2195638848, 32766}, access_size = 0, size = 84 'T'}, wild = {addr = 135686485182180, access_size = 0}}}}, pc = 94067077665507, bp = 140731094060016, sp = 140731094060000, access_size = 4, bug_descr = 0x7f27fab8f797 "heap-use-after-free", is_write = true, shadow_val = 253 '\375'}
        #9  0x00007f27fab33f8d in __asan::ReportGenericError (pc=<optimized out>, bp=bp@entry=140731094060016, sp=sp@entry=140731094060000, addr=<optimized out>, is_write=is_write@entry=true, access_size=access_size@entry=4, exp=<optimized out>, fatal=true) at ../../../../src/libsanitizer/asan/asan_report.cpp:536
                in_report = <optimized out>
                error = <optimized out>
                enable_fp = <optimized out>
        #10 0x00007f27fab3585c in __asan::__asan_report_store4 (addr=<optimized out>) at ../../../../src/libsanitizer/asan/asan_rtl.cpp:135
                bp = 140731094060016
                pc = <optimized out>
                local_stack = 94067080268848
                sp = 140731094060000
        #11 0x0000558db2bfd2e3 in report_notify_destroy (user_data=<optimized out>) at profiles/input/hog-lib.c:359
                report = <optimized out>
                __func__ = "report_notify_destroy"
        #12 0x0000558db2ca0052 in attrib_callbacks_destroy (data=0x7b87f8bf2560) at attrib/gattrib.c:130
                cb = 0x7b87f8bf2560
        #13 0x0000558db2e8f51b in notify_data_unref (data=<optimized out>) at src/shared/gatt-client.c:256
                notify_data = <optimized out>
        #14 notify_data_unref (data=<optimized out>) at src/shared/gatt-client.c:248
                notify_data = <optimized out>
        #15 0x0000558db2e8a3e0 in destroy_write_op (data=0x7b57f8c02a20) at src/shared/gatt-client.c:3189
                op = 0x7b57f8c02a20
        #16 0x0000558db2e9a153 in request_unref (data=0x7b67f8c07250) at src/shared/gatt-client.c:201
                req = 0x7b67f8c07250
                client = 0x7c37f8be1080
        #17 0x0000558db2e791a4 in destroy_att_send_op (data=0x7b87f8bf3f40) at src/shared/att.c:215
                op = 0x7b87f8bf3f40
        #18 0x0000558db2e82fe0 in bt_att_cancel (att=<optimized out>, id=<optimized out>) at src/shared/att.c:1925
                entry = 0x0
                op = <optimized out>
        #19 0x0000558db2e8ecc3 in cancel_request (req=<optimized out>) at src/shared/gatt-client.c:2783
        No locals.
        #20 0x0000558db2e39b32 in queue_remove_all (queue=0x7b57f8be9820, function=function@entry=0x0, user_data=user_data@entry=0x0, destroy=destroy@entry=0x558db2e8f230 <cancel_pending>) at src/shared/queue.c:341
                tmp = 0x7b47f8c0c6d0
                entry = 0x0
                count = <optimized out>
        #21 0x0000558db2e95d3f in bt_gatt_client_cancel_all (client=client@entry=0x7c37f8be1080) at src/shared/gatt-client.c:2811
        No locals.
        #22 0x0000558db2e95fdd in bt_gatt_client_free (client=0x7c37f8be1080) at src/shared/gatt-client.c:2290
        No locals.
        #23 0x0000558db2e97d1c in bt_gatt_client_unref (client=<optimized out>) at src/shared/gatt-client.c:2605
        No locals.
        #24 0x0000558db2ca15ed in g_attrib_unref (attrib=0x7ba7f8be1420) at attrib/gattrib.c:158
                __func__ = "g_attrib_unref"
        #25 0x0000558db2da552e in attio_cleanup (device=<optimized out>) at src/device.c:874
                attrib = <optimized out>
        #26 0x0000558db2da5a77 in device_free (user_data=0x7c97f8be0080) at src/device.c:918
                device = 0x7c97f8be0080
                __func__ = "device_free"
        #27 0x0000558db2e2368a in remove_interface (data=0x7b97f8be4ee0, name=name@entry=0x558db302fae0 "org.bluez.Device1") at gdbus/object.c:742
                iface = 0x7b87f8be5ae0
        #28 0x0000558db2e2624c in g_dbus_unregister_interface (connection=<optimized out>, path=<optimized out>, name=<optimized out>) at gdbus/object.c:1499
                data = <optimized out>
        #29 0x0000558db2d60d48 in adapter_remove (adapter=adapter@entry=0x7c57f8be0200) at src/adapter.c:7321
                device = 0x7c97f8be0080
                db = <optimized out>
                ranging_manager = <optimized out>
                __func__ = "adapter_remove"
        #30 0x0000558db2d61888 in adapter_cleanup () at src/adapter.c:11274
                adapter = 0x7c57f8be0200
        #31 0x0000558db2b12330 in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:1723
                context = <optimized out>
                err = <optimized out>
                sdp_mtu = 0
                sdp_flags = <optimized out>
                gdbus_flags = <optimized out>
                __func__ = "main""

https://github.com/bluez/bluez/pull/2577

---
Regards,
Linux Bluetooth

author maintainer
#3 lore raw

PATCH v2 2/8 client/gatt: Fix setting descriptor value from scripts

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

gatt.register-descriptor completed the command right after prompting for the value, so when run from a script the line with the value was executed as a command instead of being passed to the prompt, causing the descriptor to be unregistered.

Complete the command once the value is set, as done for characteristics, and parse a copy of the value so the input line is not truncated by strsep while still in use by the shell.

---
 client/gatt.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)
client/gatt.c +18 -7
index 6dc80e2a31cd..ebbe4e3c7a32 100644
@@ -700,13 +700,20 @@ void gatt_read_local_attribute(char *data, int argc, char *argv[])
 	return bt_shell_noninteractive_quit(EXIT_FAILURE);
 }
 
-static uint8_t *str2bytearray(char *arg, size_t *val_len)
+static uint8_t *str2bytearray(const char *arg, size_t *val_len)
 {
 	uint8_t value[MAX_ATTR_VAL_LEN];
-	char *entry;
+	char *str, *next, *entry;
 	unsigned int i;
 
-	for (i = 0; (entry = strsep(&arg, " \t")) != NULL; i++) {
+	/* Parse a copy as strsep modifies the string, which may still be
+	 * in use by the caller, e.g. the shell printing the input line.
+	 */
+	str = next = strdup(arg);
+	if (!str)
+		return NULL;
+
+	for (i = 0; (entry = strsep(&next, " \t")) != NULL; i++) {
 		long val;
 		char *endptr = NULL;
 
@@ -715,18 +722,22 @@ static uint8_t *str2bytearray(char *arg, size_t *val_len)
 
 		if (i >= G_N_ELEMENTS(value)) {
 			bt_shell_printf("Too much data\n");
+			free(str);
 			return NULL;
 		}
 
 		val = strtol(entry, &endptr, 0);
 		if (!endptr || *endptr != '\0' || val > UINT8_MAX) {
 			bt_shell_printf("Invalid value at index %d\n", i);
+			free(str);
 			return NULL;
 		}
 
 		value[i] = val;
 	}
 
+	free(str);
+
 	*val_len = i;
 
 	return util_memdup(value, i);
@@ -2788,7 +2799,7 @@ static void chrc_set_value(const char *input, void *user_data)
 
 	g_free(chrc->value);
 
-	chrc->value = str2bytearray((char *) input, &chrc->value_len);
+	chrc->value = str2bytearray(input, &chrc->value_len);
 
 	if (!chrc->value) {
 		print_chrc(chrc, COLORED_DEL);
@@ -3078,7 +3089,7 @@ static void desc_set_value(const char *input, void *user_data)
 
 	g_free(desc->value);
 
-	desc->value = str2bytearray((char *) input, &desc->value_len);
+	desc->value = str2bytearray(input, &desc->value_len);
 
 	if (!desc->value) {
 		print_desc(desc, COLORED_DEL);
@@ -3086,6 +3097,8 @@ static void desc_set_value(const char *input, void *user_data)
 	}
 
 	desc->max_val_len = desc->value_len;
+
+	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 void gatt_register_desc(DBusConnection *conn, GDBusProxy *proxy,
@@ -3134,8 +3147,6 @@ void gatt_register_desc(DBusConnection *conn, GDBusProxy *proxy,
 	print_desc(desc, COLORED_NEW);
 
 	bt_shell_prompt_input(desc->path, "Enter value:", desc_set_value, desc);
-
-	return bt_shell_noninteractive_quit(EXIT_SUCCESS);
 }
 
 static struct desc *desc_find(const char *pattern)
Signature · 1 line
2.55.0
author maintainer
#4 lore raw

PATCH v2 3/8 client/mgmt: Print Connection Subrate event

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Print the MGMT Connection Subrate event, generated as a result of a LE Connection Rate Request, e.g. after mgmt.conn-subrate, or a change initiated by the remote device, so the new connection rate can be confirmed.

---
 client/mgmt.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
client/mgmt.c +31 -0
index cd2ef80221ad..a7069e5bbb37 100644
@@ -499,6 +499,35 @@ static void disconnected(uint16_t index, uint16_t len, const void *param,
 			index, addr, typestr(ev->addr.type), reason);
 }
 
+static void conn_subrate(uint16_t index, uint16_t len, const void *param,
+							void *user_data)
+{
+	const struct mgmt_ev_conn_subrate *ev = param;
+	char addr[18];
+
+	if (len < sizeof(*ev)) {
+		error("Invalid connection subrate event length (%u bytes)",
+									len);
+		return;
+	}
+
+	ba2str(&ev->addr.bdaddr, addr);
+
+	if (ev->status) {
+		print("hci%u %s type %s connection subrate failed status "
+			"0x%02x (%s)", index, addr, typestr(ev->addr.type),
+			ev->status, mgmt_errstr(ev->status));
+		return;
+	}
+
+	print("hci%u %s type %s connection subrate interval 0x%04x "
+		"subrate 0x%04x latency 0x%04x cont_num 0x%04x timeout 0x%04x",
+		index, addr, typestr(ev->addr.type),
+		le16_to_cpu(ev->interval), le16_to_cpu(ev->subrate),
+		le16_to_cpu(ev->latency), le16_to_cpu(ev->cont_num),
+		le16_to_cpu(ev->supv_timeout));
+}
+
 static void conn_failed(uint16_t index, uint16_t len, const void *param,
 							void *user_data)
 {
@@ -6006,6 +6035,8 @@ static void register_mgmt_callbacks(struct mgmt *mgmt, uint16_t index)
 								NULL, NULL);
 	mgmt_register(mgmt, MGMT_EV_CONNECT_FAILED, index, conn_failed,
 								NULL, NULL);
+	mgmt_register(mgmt, MGMT_EV_CONN_SUBRATE, index, conn_subrate,
+								NULL, NULL);
 	mgmt_register(mgmt, MGMT_EV_AUTH_FAILED, index, auth_failed,
 								NULL, NULL);
 	mgmt_register(mgmt, MGMT_EV_CLASS_OF_DEV_CHANGED, index,
Signature · 1 line
2.55.0
author maintainer
#5 lore raw

PATCH v2 4/8 emulator: Default to the latest BR/EDR+LE version

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Emulate BR/EDR+LE 6.2 controllers by default, for both local (-l) and server (--server, --tcp) controllers, so the latest features such as Shorter Connection Intervals (LE Connection Rate Request) are supported, e.g. by test-functional which uses --server.

Add the -C/--core=<version> option to emulate older versions instead:
5.0, 5.2, 6.0 or 6.2.

---
 emulator/main.c   | 54 ++++++++++++++++++++++++++++++++++++++++++++---
 emulator/server.c | 15 ++++++++++++-
 emulator/server.h |  2 ++
 3 files changed, 67 insertions(+), 4 deletions(-)
emulator/main.c +51 -3
index c21640adc359..b18e77cf191b 100644
@@ -24,8 +24,8 @@
 #include "src/shared/util.h"
 
 #include "serial.h"
-#include "server.h"
 #include "btdev.h"
+#include "server.h"
 #include "vhci.h"
 #include "le.h"
 
@@ -54,6 +54,9 @@ static void usage(void)
 		"\t-U[num]               Number of test LE controllers\n"
 		"\t-B                    Create BR/EDR only controller\n"
 		"\t-A                    Create AMP controller\n"
+		"\t-C, --core=<version>  Core Specification version of the\n"
+		"\t                      BR/EDR/LE controllers:\n"
+		"\t                      5.0, 5.2, 6.0 or 6.2 (default)\n"
 		"\t-T[num]               Number of test AMP controllers\n"
 		"\t-h, --help            Show help options\n");
 }
@@ -67,12 +70,37 @@ static const struct option main_options[] = {
 	{ "le",      no_argument,       NULL, 'L' },
 	{ "bredr",   no_argument,       NULL, 'B' },
 	{ "amp",     no_argument,       NULL, 'A' },
+	{ "core",    required_argument, NULL, 'C' },
 	{ "letest",  optional_argument, NULL, 'U' },
 	{ "version", no_argument,	NULL, 'v' },
 	{ "help",    no_argument,	NULL, 'h' },
 	{ }
 };
 
+static const struct {
+	const char *version;
+	enum btdev_type type;
+} core_versions[] = {
+	{ "5.0", BTDEV_TYPE_BREDRLE50 },
+	{ "5.2", BTDEV_TYPE_BREDRLE52 },
+	{ "6.0", BTDEV_TYPE_BREDRLE60 },
+	{ "6.2", BTDEV_TYPE_BREDRLE62 },
+};
+
+static bool parse_core_version(const char *version, enum btdev_type *type)
+{
+	size_t i;
+
+	for (i = 0; i < ARRAY_SIZE(core_versions); i++) {
+		if (!strcmp(core_versions[i].version, version)) {
+			*type = core_versions[i].type;
+			return true;
+		}
+	}
+
+	return false;
+}
+
 static void vhci_debug(const char *str, void *user_data)
 {
 	int i = PTR_TO_UINT(user_data);
@@ -101,7 +129,10 @@ int main(int argc, char *argv[])
 	bool serial_enabled = false;
 	int letest_count = 0;
 	int vhci_count = 0;
-	enum btdev_type type = BTDEV_TYPE_BREDRLE60;
+	/* Default to the latest version supported by the emulator */
+	enum btdev_type bredrle_type = BTDEV_TYPE_BREDRLE62;
+	enum btdev_type type;
+	bool type_set = false;
 	int i;
 
 	mainloop_init();
@@ -109,7 +140,7 @@ int main(int argc, char *argv[])
 	for (;;) {
 		int opt;
 
-		opt = getopt_long(argc, argv, "dSs::t::l::LBAU::T::vh",
+		opt = getopt_long(argc, argv, "dSs::t::l::LBAC:U::T::vh",
 						main_options, NULL);
 		if (opt < 0)
 			break;
@@ -140,12 +171,22 @@ int main(int argc, char *argv[])
 			break;
 		case 'L':
 			type = BTDEV_TYPE_LE;
+			type_set = true;
 			break;
 		case 'B':
 			type = BTDEV_TYPE_BREDR;
+			type_set = true;
 			break;
 		case 'A':
 			type = BTDEV_TYPE_AMP;
+			type_set = true;
+			break;
+		case 'C':
+			if (!parse_core_version(optarg, &bredrle_type)) {
+				fprintf(stderr, "Unsupported version: %s\n",
+								optarg);
+				return EXIT_FAILURE;
+			}
 			break;
 		case 'U':
 			if (optarg)
@@ -164,6 +205,9 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	if (!type_set)
+		type = bredrle_type;
+
 	if (letest_count < 1 && vhci_count < 1 && !server_enabled &&
 						!tcp_port && !serial_enabled) {
 		fprintf(stderr, "No emulator specified\n");
@@ -214,6 +258,8 @@ int main(int argc, char *argv[])
 		server1 = server_open_unix(SERVER_TYPE_BREDRLE, path);
 		if (!server1)
 			fprintf(stderr, "Failed to open BR/EDR/LE server\n");
+		else
+			server_set_bredrle_type(server1, bredrle_type);
 
 		snprintf(path, sizeof(path), "%s/%s", server_path,
 							"bt-server-bredr");
@@ -255,6 +301,8 @@ int main(int argc, char *argv[])
 		tcp_server = server_open_tcp(SERVER_TYPE_BREDRLE, tcp_port);
 		if (!tcp_server)
 			fprintf(stderr, "Failed to open TCP port\n");
+		else
+			server_set_bredrle_type(tcp_server, bredrle_type);
 		fprintf(stderr, "Listening TCP on 127.0.0.1:%d\n", tcp_port);
 	}
 
emulator/server.c +14 -1
index e3eda8458ae0..5a827b24531e 100644
@@ -38,6 +38,7 @@
 
 struct server {
 	enum server_type type;
+	enum btdev_type bredrle_type;
 	uint16_t id;
 	int fd;
 	struct queue *clients;
@@ -281,7 +282,7 @@ static void server_accept_callback(int fd, uint32_t events, void *user_data)
 
 	switch (server->type) {
 	case SERVER_TYPE_BREDRLE:
-		type = BTDEV_TYPE_BREDRLE52;
+		type = server->bredrle_type;
 		break;
 	case SERVER_TYPE_BREDR:
 		type = BTDEV_TYPE_BREDR;
@@ -361,6 +362,7 @@ struct server *server_open_unix(enum server_type type, const char *path)
 
 	memset(server, 0, sizeof(*server));
 	server->type = type;
+	server->bredrle_type = BTDEV_TYPE_BREDRLE62;
 	server->id = 0x42;
 
 	server->fd = open_unix(path);
@@ -429,6 +431,7 @@ struct server *server_open_tcp(enum server_type type, uint16_t port)
 
 	memset(server, 0, sizeof(*server));
 	server->type = type;
+	server->bredrle_type = BTDEV_TYPE_BREDRLE62;
 	server->id = 0x43;
 
 	server->fd = open_tcp(port);
@@ -455,6 +458,16 @@ void server_close(struct server *server)
 	mainloop_remove_fd(server->fd);
 }
 
+bool server_set_bredrle_type(struct server *server, enum btdev_type type)
+{
+	if (!server || server->type != SERVER_TYPE_BREDRLE)
+		return false;
+
+	server->bredrle_type = type;
+
+	return true;
+}
+
 bool server_set_debug(struct server *server, server_debug_func_t callback,
 			void *user_data, server_destroy_func_t destroy)
 {
emulator/server.h +2 -0
index 1844a9871af1..5fc3a284f53f 100644
@@ -25,6 +25,8 @@ struct server *server_open_unix(enum server_type type, const char *path);
 struct server *server_open_tcp(enum server_type type, uint16_t port);
 void server_close(struct server *server);
 
+bool server_set_bredrle_type(struct server *server, enum btdev_type type);
+
 typedef void (*server_debug_func_t)(const char *str, void *user_data);
 typedef void (*server_destroy_func_t)(void *user_data);
 bool server_set_debug(struct server *server, server_debug_func_t callback,
Signature · 1 line
2.55.0
author maintainer
#6 lore raw

PATCH v2 5/8 client/scripts: Add HoG device scripts

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Add scripts registering a HID Service (HIDS) acting as a HID over GATT keyboard, with and without Shorter Connection Interval (SCI) support.

HID SCI Mode can be notified so the device can confirm a mode change.

---
 client/scripts/hog-device-sci.bt | 49 ++++++++++++++++++++++++++++++++
 client/scripts/hog-device.bt     | 38 +++++++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 client/scripts/hog-device-sci.bt
 create mode 100644 client/scripts/hog-device.bt
client/scripts/hog-device-sci.bt new file +49 -0
new file mode 100644
index 000000000000..1bf3a0a90db7
@@ -0,0 +1,49 @@
+#
+# Register a HID Service (HIDS) acting as a HID over GATT (HoG) keyboard
+# with Shorter Connection Interval (SCI) support.
+#
+gatt.register-service 0x1812
+# Primary
+yes
+#
+# HID Information: bcdHID 1.11, bCountryCode 0x00,
+# Flags: NormallyConnectable and SCI Supported
+gatt.register-characteristic 0x2a4a read
+0x11 0x01 0x00 0x06
+#
+# Report Map: keyboard with Report ID 1
+gatt.register-characteristic 0x2a4b read
+0x05 0x01 0x09 0x06 0xa1 0x01 0x85 0x01 0x05 0x07 0x19 0xe0 0x29 0xe7 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x08 0x81 0x02 0x95 0x01 0x75 0x08 0x81 0x01 0x95 0x06 0x75 0x08 0x15 0x00 0x25 0x65 0x05 0x07 0x19 0x00 0x29 0x65 0x81 0x00 0xc0
+#
+# Report: Input Report ID 1
+gatt.register-characteristic 0x2a4d read,notify
+0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+# Report Reference: Report ID 1, Input
+gatt.register-descriptor 0x2908 read
+0x01 0x01
+#
+# Protocol Mode: Report Protocol Mode
+gatt.register-characteristic 0x2a4e read,write-without-response
+0x01
+#
+# HID Control Point
+gatt.register-characteristic 0x2a4c write-without-response
+0x00
+#
+# HID SCI Mode: None (0x00), notified when changed
+gatt.register-characteristic 0x2c39 read,write,notify
+0x00
+#
+# HID SCI Information (intervals in units of 0.125 ms):
+# Minimum Supported Connection Interval: 0x08 (1 ms)
+# Number of Supported Subgroups: 1
+# Subgroup[0]: Min 0x0008 (1 ms) Max 0x0050 (10 ms) Stride 0x0008 (1 ms)
+gatt.register-characteristic 0x2c3a read
+0x08 0x01 0x08 0x00 0x50 0x00 0x08 0x00
+#
+gatt.register-application
+#
+# Advertise as a keyboard with HIDS
+advertise.uuids 0x1812
+advertise.appearance 0x03c1
+power on
client/scripts/hog-device.bt new file +38 -0
new file mode 100644
index 000000000000..42b324eda020
@@ -0,0 +1,38 @@
+#
+# Register a HID Service (HIDS) acting as a HID over GATT (HoG) keyboard
+# without Shorter Connection Interval (SCI) support.
+#
+gatt.register-service 0x1812
+# Primary
+yes
+#
+# HID Information: bcdHID 1.11, bCountryCode 0x00,
+# Flags: NormallyConnectable
+gatt.register-characteristic 0x2a4a read
+0x11 0x01 0x00 0x02
+#
+# Report Map: keyboard with Report ID 1
+gatt.register-characteristic 0x2a4b read
+0x05 0x01 0x09 0x06 0xa1 0x01 0x85 0x01 0x05 0x07 0x19 0xe0 0x29 0xe7 0x15 0x00 0x25 0x01 0x75 0x01 0x95 0x08 0x81 0x02 0x95 0x01 0x75 0x08 0x81 0x01 0x95 0x06 0x75 0x08 0x15 0x00 0x25 0x65 0x05 0x07 0x19 0x00 0x29 0x65 0x81 0x00 0xc0
+#
+# Report: Input Report ID 1
+gatt.register-characteristic 0x2a4d read,notify
+0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
+# Report Reference: Report ID 1, Input
+gatt.register-descriptor 0x2908 read
+0x01 0x01
+#
+# Protocol Mode: Report Protocol Mode
+gatt.register-characteristic 0x2a4e read,write-without-response
+0x01
+#
+# HID Control Point
+gatt.register-characteristic 0x2a4c write-without-response
+0x00
+#
+gatt.register-application
+#
+# Advertise as a keyboard with HIDS
+advertise.uuids 0x1812
+advertise.appearance 0x03c1
+power on
Signature · 1 line
2.55.0
author maintainer
#7 lore raw

PATCH v2 6/8 doc: Add functional-hog documentation

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Document the HoG functional tests, where bluetoothctl registers a HID Service with and without Shorter Connection Interval (SCI) support using client/scripts/hog-device*.bt, and the HID host:

- checks HID Information, HID SCI Mode and HID SCI Information with gatt.select-attribute/gatt.read
- receives a few Input Reports notified by the HID device
- changes the SCI mode, followed by the connection rate with mgmt.conn-subrate, and receives the notification from the HID device confirming the mode has been changed

---
 Makefile.am                |   1 +
 doc/functional-hog.rst     | 188 +++++++++++++++++++++++++++++++++++++
 doc/functional-testing.rst |   1 +
 3 files changed, 190 insertions(+)
 create mode 100644 doc/functional-hog.rst
Makefile.am +1 -0
index 1d46b9b938cf..17348788a30b 100644
@@ -501,6 +501,7 @@ EXTRA_DIST += doc/assigned-numbers.rst doc/supported-features.txt \
 				doc/functional-a2dp.rst \
 				doc/functional-avrcp.rst \
 				doc/functional-bap.rst \
+				doc/functional-hog.rst \
 				doc/functional-mpris-proxy.rst \
 				doc/functional-obex.rst \
 				doc/settings-storage.txt
doc/functional-hog.rst new file +188 -0

188 lines not on this page · raw message

doc/functional-testing.rst +1 -0
index ca7bfa672a76..7b3cad1c66b1 100644
@@ -15,6 +15,7 @@ are documented separately:
 - **functional-a2dp(7)**: `test/functional/test_a2dp.py`
 - **functional-avrcp(7)**: `test/functional/test_avrcp.py`
 - **functional-bap(7)**: `test/functional/test_bap.py`
+- **functional-hog(7)**: `test/functional/test_hog.py`
 - **functional-mpris-proxy(7)**: `test/functional/test_mpris_proxy.py`
 - **functional-obex(7)**: `test/functional/test_obex.py`
 
Signature · 1 line
2.55.0
author maintainer
#8 lore raw

PATCH v2 7/8 test: functional: add HoG tests

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Add tests where bluetoothctl registers a HID Service, with and without SCI support, using client/scripts/hog-device*.bt, and the HID host checks the service, receives Input Reports and, with SCI support, changes the SCI mode and the connection rate.

See doc/functional-hog.rst for details.

---
 test/functional/test_hog.py | 252 ++++++++++++++++++++++++++++++++++++
 1 file changed, 252 insertions(+)
 create mode 100644 test/functional/test_hog.py
test/functional/test_hog.py new file +252 -0
new file mode 100644
index 000000000000..ea54882d059d
@@ -0,0 +1,252 @@
+# -*- coding: utf-8; mode: python; eval: (blacken-mode); -*-
+# SPDX-License-Identifier: GPL-2.0-or-later
+"""
+Tests for HID over GATT (HoG) using bluetoothctl in VM instances
+
+The HID device (host1) registers a HID Service (HIDS) with bluetoothctl,
+using client/scripts/hog-device.bt or client/scripts/hog-device-sci.bt,
+and the HID host (host0) pairs with it and checks the service over GATT.
+"""
+
+import warnings
+
+import pytest
+
+from pytest_bluezenv import Bluetoothd, Pexpect, find_exe, host_config
+from pytest_bluezenv.utils import bluez_src_dir
+
+pytestmark = [pytest.mark.vm]
+
+# The HID Service is claimed by the input plugin of the HID host, so it
+# has to be exported read-write for bluetoothctl to write HID SCI Mode
+HOG_CONF = """[General]
+ControllerMode = le
+
+[GATT]
+ExportClaimedServices = read-write
+"""
+
+HIDS_UUID = "00001812-0000-1000-8000-00805f9b34fb"
+
+# Local attributes registered by client/scripts/hog-device*.bt
+LOCAL_REPORT = "/org/bluez/app/service0/chrc2"
+LOCAL_SCI_MODE = "/org/bluez/app/service0/chrc5"
+
+# Keyboard Input Reports: Modifiers, Reserved, then 6 Key Codes
+REPORTS = [
+    "00 00 04 00 00 00 00 00",  # a pressed
+    "02 00 05 00 00 00 00 00",  # Left Shift + b pressed
+    "00 00 00 00 00 00 00 00",  # released
+]
+
+# HID SCI Mode: Fast Mode
+SCI_FAST_MODE = "03"
+
+# LE Connection Rate parameters requested with mgmt.conn-subrate once in
+# SCI Fast Mode: interval 1 ms to 2 ms (units of 0.125 ms), within the
+# range given in HID SCI Information, no subrating, no latency and 5 s
+# supervision timeout (units of 10 ms)
+SCI_RATE = ["0x0008", "0x0010", "1", "1", "0", "0", "0x01f4"]
+
+# Reported when an operation cannot complete, so a test does not have to
+# wait for its timeout to know it is not going to
+FAILURES = [
+    r"(Failed to \w+[^\r\n]*)",
+    r"(Device \S+ not available)",
+    r"(No device connected)",
+    r"(No attribute selected)",
+]
+
+# What a command reports is printed as it runs, unlike what the peers
+# report over the air, so waiting the default timeout for it only makes
+# a failure slower
+REPLY_TIMEOUT = 5
+
+
+def script(name):
+    src = bluez_src_dir()
+    if src is None:
+        pytest.skip("BlueZ source directory not known")
+
+    path = src / "client" / "scripts" / name
+    if not path.exists():
+        pytest.skip(f"{path} not found")
+
+    return str(path)
+
+
+def spawn_bluetoothctl(host, init_script=None):
+    exe = find_exe("client", "bluetoothctl")
+    # Accept pairing and authorize services without prompting, with a
+    # capability pairing Just Works, as there is no one to answer the
+    # entry of a passkey
+    args = [exe, "-a", "auto:NoInputNoOutput"]
+    if init_script:
+        args += ["--init-script", script(init_script)]
+    return host.pexpect.spawn(args)
+
+
+def expect(ctl, patterns, **kwargs):
+    """
+    Expect one of the patterns, failing as soon as one of the failures
+    shows up. Return the index of the pattern matched and its groups.
+    """
+    if isinstance(patterns, str):
+        patterns = [patterns]
+
+    idx, m = ctl.expect(FAILURES + list(patterns), **kwargs)
+    if idx < len(FAILURES):
+        raise AssertionError(m[0].decode("utf-8") if m else "failed")
+
+    return idx - len(FAILURES), m
+
+
+def expect_all(ctl, patterns, **kwargs):
+    """Expect all the given patterns, in any order."""
+    pending = list(patterns)
+
+    while pending:
+        idx, _ = expect(ctl, pending, **kwargs)
+        pending.pop(idx)
+
+
+def pair_le(host0, ctl0, host1, ctl1):
+    ctl0.send("scan on\n")
+    expect(ctl0, f"Controller {host0.bdaddr.upper()} Discovering: yes")
+
+    ctl1.send("advertise on\n")
+    expect(ctl1, "Advertising object registered")
+
+    expect(ctl0, f"Device {host1.bdaddr.upper()}")
+    ctl0.send(f"pair {host1.bdaddr.upper()}\n")
+
+    # See test_bluetoothctl_pair_le: passkey confirmation is handled by
+    # the auto agent, but legacy passkey entry still needs an answer
+    legacy = r"\[agent\].*Passkey:.*m(\d+)"
+    pending = [
+        r"Pairing successful",
+        f"Device {host1.bdaddr.upper()} ServicesResolved: yes",
+    ]
+
+    while pending:
+        idx, m = expect(ctl0, [legacy] + pending)
+        if idx == 0:
+            warnings.warn(
+                "BUG: we got passkey authentication, bluetoothd/kernel "
+                "should be fixed"
+            )
+            ctl1.expect(r"\[agent\] Enter passkey \(number in 0-999999\):")
+            ctl1.send(f"{m[0].decode('utf-8')}\n")
+            continue
+        pending.pop(idx - 1)
+
+    ctl0.send("scan off\n")
+
+
+def read_attribute(ctl, uuid):
+    """Read the given remote attribute, returning its value as hex string."""
+    ctl.send(f"gatt.select-attribute {uuid}\n")
+    ctl.send("gatt.read\n")
+    expect(ctl, r"Attempting to read \S+", timeout=REPLY_TIMEOUT)
+    return expect_hexdump(ctl)
+
+
+def hexbytes(value):
+    """Turn a hex string into the format taken by gatt.write."""
+    return " ".join(f"0x{byte}" for byte in value.split())
+
+
+def expect_hexdump(ctl, **kwargs):
+    """Expect a value printed by bluetoothctl, returning it as hex string."""
+    _, m = expect(ctl, r"((?: [0-9a-f]{2})+)  ", **kwargs)
+    return m[0].decode("utf-8").strip()
+
+
+def expect_notification(ctl):
+    """Expect a notification of the remote attribute, returning its value."""
+    expect(ctl, rf"CHG.*? Attribute /\S+ Value:")
+    return expect_hexdump(ctl)
+
+
+def enable_notifications(ctl, device, uuid, local):
+    """Enable notifications of the given attribute, on the HID host."""
+    ctl.send(f"gatt.select-attribute {uuid}\n")
+    ctl.send("gatt.notify on\n")
+    expect(ctl, r"Notify started", timeout=REPLY_TIMEOUT)
+    # Either subscribed with StartNotify, or with AcquireNotify as done by
+    # the input plugin of the HID host for the Input Reports
+    expect(
+        device,
+        rf"Attribute {local} (\S+ )?(notifications enabled|Notify sock acquired)",
+    )
+
+
+def notify(device, local, value):
+    """Notify the given value of a local attribute, on the HID device."""
+    device.send(f"gatt.select-attribute local {local}\n")
+    device.send(f'gatt.write "{hexbytes(value)}"\n')
+    expect(device, rf"Attribute {local} .*written", timeout=REPLY_TIMEOUT)
+
+
+@host_config(
+    [Bluetoothd(conf=HOG_CONF), Pexpect()],
+    [Bluetoothd(conf=HOG_CONF), Pexpect()],
+)
[email protected](
+    "init_script, flags, sci",
+    [
+        ("hog-device.bt", "02", None),
+        ("hog-device-sci.bt", "06", ("00", "08 01 08 00 50 00 08 00")),
+    ],
+    ids=["no-sci", "sci"],
+)
+def test_hog(hosts, init_script, flags, sci):
+    host0, host1 = hosts
+
+    device = spawn_bluetoothctl(host1, init_script)
+    expect(device, "Application registered")
+
+    ctl = spawn_bluetoothctl(host0)
+    pair_le(host0, ctl, host1, device)
+
+    ctl.send(f"info {host1.bdaddr.upper()}\n")
+    expect(ctl, rf"Human Interface Device\s+\({HIDS_UUID}\)", timeout=REPLY_TIMEOUT)
+
+    # HID Information: bcdHID 1.11, bCountryCode 0x00 and Flags
+    assert read_attribute(ctl, "2a4a") == f"11 01 00 {flags}"
+
+    # Input Reports: the HID device notifies a few key presses
+    enable_notifications(ctl, device, "2a4d", LOCAL_REPORT)
+
+    for report in REPORTS:
+        notify(device, LOCAL_REPORT, report)
+        assert expect_notification(ctl) == report
+
+    if sci is None:
+        return
+
+    mode, info = sci
+    assert read_attribute(ctl, "2c39") == mode
+    assert read_attribute(ctl, "2c3a") == info
+
+    # SCI mode change: the HID host writes the new mode to the HID device
+    enable_notifications(ctl, device, "2c39", LOCAL_SCI_MODE)
+
+    ctl.send(f'gatt.write "{hexbytes(SCI_FAST_MODE)}"\n')
+    expect(device, rf"\[{LOCAL_SCI_MODE} .*\] WriteValue:")
+    assert expect_hexdump(device) == SCI_FAST_MODE
+
+    # The HID host, as central, changes the connection rate accordingly
+    ctl.send(f"mgmt.conn-subrate {host1.bdaddr} {' '.join(SCI_RATE)}\n")
+    # The connection rate may change before the command completes, so the
+    # event may be printed before the reply
+    rate = rf"{{}} type .* connection subrate interval {SCI_RATE[0]}"
+    expect_all(
+        ctl,
+        [r"Connection Subrate loaded successfully", rate.format(host1.bdaddr.upper())],
+    )
+    expect(device, rate.format(host0.bdaddr.upper()))
+
+    # Then the HID device confirms the mode has been changed
+    notify(device, LOCAL_SCI_MODE, SCI_FAST_MODE)
+    assert expect_notification(ctl) == SCI_FAST_MODE
Signature · 1 line
2.55.0
author maintainer
#9 lore raw

PATCH v2 8/8 test: functional: limit the workers by the memory available

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

Each worker of pytest-xdist runs VM instances, so using one worker per CPU could run out of memory, with the OOM killer terminating some of them and tests failing at random.

With -n auto, limit the number of workers by the memory available, estimating each worker needs memory for 3 VM instances of 256M of guest memory plus the overhead of qemu, and use -n auto for check-functional by default, which can be overridden with CHECK_FUNCTIONAL_JOBS.

---
 Makefile.am                 |  7 +++++-
 doc/test-functional.rst     | 25 ++++++++++++++++++++
 test/functional/conftest.py | 46 +++++++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+), 1 deletion(-)
Makefile.am +6 -1
index 17348788a30b..e5587c55d2dd 100644
@@ -885,9 +885,14 @@ check-TESTS recheck: AM_MAKEFLAGS += -j$(CHECK_JOBS)
 
 # The functional tests are parallelized by pytest-xdist, loadgroup is required
 # since pytest-bluezenv groups the tests sharing a host/VM setup together.
+# Each worker runs VM instances, so by default the number of workers is limited
+# by the memory available (see test/functional/conftest.py), override with e.g.
+# CHECK_FUNCTIONAL_JOBS=4.
+CHECK_FUNCTIONAL_JOBS ?= auto
+
 check-functional: all
 	python3 -m pytest "$(srcdir)/test/functional" -v \
-		-n $(CHECK_JOBS) --dist loadgroup \
+		-n $(CHECK_FUNCTIONAL_JOBS) --dist loadgroup \
 		-m "not tester" \
 		--kernel="$(FUNCTIONAL_TESTING_KERNEL)" \
 		--bluez-build-dir="$(top_builddir)" \
doc/test-functional.rst +25 -0
index 3ffcbf6dec5c..9cf0a8bb48e5 100644
@@ -472,6 +472,31 @@ pytest-xdist is required for parallel execution. To run:
 
 	$ test/test-functional -n auto --dist loadgroup
 
+With ``-n auto`` the number of workers is limited by the memory
+available, rather than using one worker per CPU, as each worker runs
+VM instances and running out of memory makes the OOM killer terminate
+some of them, failing tests at random. Each worker is estimated to need
+memory for 3 VM instances (the maximum used by a test) of 256M of guest
+memory plus the overhead of qemu, see `test/functional/conftest.py`.
+The estimate is printed when starting:
+
+.. code-block::
+
+	Using 9 workers: 22 CPUs, 12159 MiB available, 1218 MiB per worker (3 VMs of 406 MiB)
+
+To use a given number of workers instead:
+
+.. code-block::
+
+	$ test/test-functional -n 4 --dist loadgroup
+
+``make check-functional`` uses ``-n auto`` as well, which can be
+overridden with ``CHECK_FUNCTIONAL_JOBS``:
+
+.. code-block::
+
+	$ make check-functional CHECK_FUNCTIONAL_JOBS=4
+
 Logging in to a test VM instance
 --------------------------------
 
test/functional/conftest.py +46 -0

52 lines not on this page · raw message

Signature · 1 line
2.55.0