Unit test lf-t unstable

Bug #1609422 reported by Laurynas Biveinis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Status tracked in 5.7
5.5
Fix Released
Low
Laurynas Biveinis
5.6
Fix Released
Low
Laurynas Biveinis
5.7
Fix Released
Low
Laurynas Biveinis

Bug Description

11/14 Test #11: lf ...............................***Failed 7.12 sec
# N CPUs: 4, atomic ops: gcc-builtins-smp
1..7
ok 1 - my_atomic_initialize() returned 0
# Testing lf_pinbox (with my_thread_init) with 30 threads, 3000 iterations...
ok 2 - tested lf_pinbox (with my_thread_init) in 0.0131241 secs (0)
# Testing lf_alloc (with my_thread_init) with 30 threads, 3000 iterations...
# 0 mallocs, 4 pins in stack
ok 3 - tested lf_alloc (with my_thread_init) in 0.0163577 secs (0)
# Testing lf_hash (with my_thread_init) with 30 threads, 300 iterations...
# 0 mallocs, 2 pins in stack, 1 hash size, 0 inserts
ok 4 - tested lf_hash (with my_thread_init) in 0.0053816 secs (0)
# Testing lf_pinbox (without my_thread_init) with 30 threads, 3000 iterations...
ok 5 - tested lf_pinbox (without my_thread_init) in 0.0096111 secs (0)
# Testing lf_alloc (without my_thread_init) with 30 threads, 3000 iterations...
# 0 mallocs, 5 pins in stack
ok 6 - tested lf_alloc (without my_thread_init) in 0.0579291 secs (0)
# Testing lf_hash (without my_thread_init) with 30 threads, 300 iterations...
# 0 mallocs, 2 pins in stack, 1 hash size, 0 inserts
ok 7 - tested lf_hash (without my_thread_init) in 0.0042839 secs (0)
Error in my_thread_global_end(): 1 threads didn't exit

=================================================================
==1810==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 280 byte(s) in 1 object(s) allocated from:
    #0 0x7fb21177579a in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x9879a)
    #1 0x4089cc in my_thread_init /mnt/workspace/percona-server-5.5-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/mysys/my_thr_init.c:344
    #2 0x40321e in test_lf_hash /mnt/workspace/percona-server-5.5-asan-param/BUILD_TYPE/debug-asan/Host/ubuntu-xenial-64bit/unittest/mysys/lf-t.c:124
    #3 0x7fb2114c76f9 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x76f9)

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

This is caused by a race: the last test thread with my_thread_init=1 reads with_my_thread_init 2nd time to determine whether it should call my_thread_end, after signaling the main thread that the test is complete. And the main thread sets my_thread_init from 1 to 0 after the first three tests, resulting in my_thread_init/my_thread_end mismatch.

Tags: ci upstream
tags: added: ci upstream
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2165

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.