[MDEV-21336] Blocks are still reachable in loss record in os_event_create / rw_lock_create_func Created: 2019-12-17  Updated: 2021-05-05  Resolved: 2020-05-14

Status: Closed
Project: MariaDB Server
Component/s: Server, Tests
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.33, 10.3.24, 10.4.14

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: affects-tests, not-10.5
Environment:

gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 , valgrind-3.12.0.SVN


Issue Links:
Relates
relates to MDEV-25599 innodb_debug_sync for mariadb 10.5+ Closed

 Description   

10.2 8129ff14

perl ./mtr --valgrind rpl.rpl_parallel_partition
 
rpl.rpl_parallel_partition 'innodb,mix'  [ fail ]  Found warnings/errors in server log file!
        Test ended at 2019-12-17 15:28:31
line
==18753== 112 bytes in 1 blocks are still reachable in loss record 3 of 7
==18753==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18753==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18753==    by 0xD4EEC2: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:237)
==18753==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18753==    by 0xD3F7C6: srv_purge_coordinator_thread (srv0srv.cc:2859)
==18753==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18753==    by 0x6938D0E: clone (clone.S:97)
==18753== 112 bytes in 1 blocks are still reachable in loss record 4 of 7
==18753==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18753==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18753==    by 0xD4EED7: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:238)
==18753==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18753==    by 0xD3F7C6: srv_purge_coordinator_thread (srv0srv.cc:2859)
==18753==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18753==    by 0x6938D0E: clone (clone.S:97)
==18753== 336 bytes in 3 blocks are still reachable in loss record 6 of 7
==18753==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18753==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18753==    by 0xD4EEC2: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:237)
==18753==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18753==    by 0xD3EECE: srv_worker_thread (srv0srv.cc:2605)
==18753==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18753==    by 0x6938D0E: clone (clone.S:97)
==18753== 336 bytes in 3 blocks are still reachable in loss record 7 of 7
==18753==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18753==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18753==    by 0xD4EED7: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:238)
==18753==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18753==    by 0xD3EECE: srv_worker_thread (srv0srv.cc:2605)
==18753==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18753==    by 0x6938D0E: clone (clone.S:97)
^ Found warnings in /data/bld/10.2-valgrind-nightly/mysql-test/var/log/mysqld.1.err
ok
 
 - saving '/data/bld/10.2-valgrind-nightly/mysql-test/var/log/rpl.rpl_parallel_partition-innodb,mix/' to '/data/bld/10.2-valgrind-nightly/mysql-test/var/log/rpl.rpl_parallel_partition-innodb,mix/'
***Warnings generated in error logs during shutdown after running tests: rpl.rpl_parallel_partition
 
==18837== 112 bytes in 1 blocks are still reachable in loss record 3 of 7
==18837==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18837==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18837==    by 0xD4EEC2: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:237)
==18837==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18837==    by 0xD3F7C6: srv_purge_coordinator_thread (srv0srv.cc:2859)
==18837==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18837==    by 0x6938D0E: clone (clone.S:97)
==18837== 112 bytes in 1 blocks are still reachable in loss record 4 of 7
==18837==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18837==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18837==    by 0xD4EED7: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:238)
==18837==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18837==    by 0xD3F7C6: srv_purge_coordinator_thread (srv0srv.cc:2859)
==18837==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18837==    by 0x6938D0E: clone (clone.S:97)
==18837== 336 bytes in 3 blocks are still reachable in loss record 6 of 7
==18837==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18837==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18837==    by 0xD4EEC2: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:237)
==18837==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18837==    by 0xD3EECE: srv_worker_thread (srv0srv.cc:2605)
==18837==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18837==    by 0x6938D0E: clone (clone.S:97)
==18837== 336 bytes in 3 blocks are still reachable in loss record 7 of 7
==18837==    at 0x4C2C4AF: operator new(unsigned long, std::nothrow_t const&) (vg_replace_malloc.c:377)
==18837==    by 0xC48FE9: os_event_create(char const*) (os0event.cc:434)
==18837==    by 0xD4EED7: rw_lock_create_func(rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.cc:238)
==18837==    by 0xD3A06C: pfs_rw_lock_create_func(unsigned int, rw_lock_t*, latch_level_t, char const*, unsigned int) (sync0rw.ic:508)
==18837==    by 0xD3EECE: srv_worker_thread (srv0srv.cc:2605)
==18837==    by 0x4E3F4A3: start_thread (pthread_create.c:456)
==18837==    by 0x6938D0E: clone (clone.S:97)

Many other tests fail the same way



 Comments   
Comment by Sergey Vojtovich [ 2019-12-17 ]

Introduced by b393e2cb0c079b30563dcc87a62002c9c778643c, pure InnoDB issue: missing rw_lock_free().

Comment by Marko Mäkelä [ 2020-02-25 ]

nikitamalyavin, you introduced the debug code that @svoj identified as the cause of this memory leak. Side note: the code was removed in 10.5.0 as part of MDEV-16264.

Comment by Sergey Vojtovich [ 2020-05-13 ]

Priority raised per request from nikitamalyavin

Comment by Marko Mäkelä [ 2020-05-14 ]

I reverted the DEBUG_SYNC instrumentation that caused the memory leak. In 10.5, it had already been removed due to incompatibility with MDEV-16264.

Generated at Thu Feb 08 09:06:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.