Skip to content

Memory leak in in coio_connect_timeout #10482

@nshy

Description

@nshy

Found by ASAN.

It is easier to demonstrate using ASAN. Reproducer:

local net = require('net.box')
net.connect(777)
 $ ./build-asan-debug/src/tarantool test.lua

=================================================================
==437649==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 76 byte(s) in 1 object(s) allocated from:
    #0 0x5a240d91c349 in malloc (/home/shiny/dev/tarantool/build-asan-debug/src/tarantool+0x1256349) (BuildId: cf86baf56ac08c441fd7e98ccd34d38f9f70bc00)
    #1 0x7f65acf55767 in generate_addrinfo /usr/src/debug/glibc/glibc/nss/getaddrinfo.c:1081:16
    #2 0x7f65acf55767 in gaih_inet /usr/src/debug/glibc/glibc/nss/getaddrinfo.c:1199:12
    #3 0x7f65acf55767 in getaddrinfo /usr/src/debug/glibc/glibc/nss/getaddrinfo.c:2391:12
    #4 0x5a240d8d38d9 in getaddrinfo.part.0 asan_interceptors.cpp.o
    #5 0x5a240ed8fccb in getaddrinfo_cb /home/shiny/dev/tarantool/src/lib/core/coio_task.c:327:13
    #6 0x5a240ed8a06a in coio_on_feed /home/shiny/dev/tarantool/src/lib/core/coio_task.c:163:16
    #7 0x5a240fd55430 in eio_execute /home/shiny/dev/tarantool/third_party/libeio/eio.c:2015:9
    #8 0x5a240fd4f878 in etp_proc /home/shiny/dev/tarantool/third_party/libeio/etp.c:373:7
    #9 0x5a240d853156 in asan_thread_start(void*) asan_interceptors.cpp.o

SUMMARY: AddressSanitizer: 76 byte(s) leaked in 1 allocation(s).

Note that repro is done with #10207 applied but coio_connect_timeout() fixes reverted.

Introduced in 2.10.0-beta1-222-g97457a399d.

Metadata

Metadata

Assignees

Labels

2.11Target is 2.11 and all newer release/master branches3.2Target is 3.2 and all newer release/master branchesbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions