Menu

#2746 mds: mds test is not thread safe

5.18.04
fixed
nobody
None
defect
mds
tests
major
False
2018-03-26
2017-12-21
No

there are several data races related to e.g. svc_to_mds_info structure, one example below:

Possible data race during write of size 4 at 0x35F72C by thread #4
==769== Locks held: none
==769== at 0x129E05: memset (string3.h:84)
==769== by 0x129E05: mds_service_retrieve (mdstipc_conf.c:1619)
==769== by 0x1120C4: tet_vdest_rcvr_thread (mdstipc_api.c:5584)
==769== by 0x4C30FA6: ??? (in /hostfs/rootfs/usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so)
==769== by 0x50CC183: start_thread (pthread_create.c:312)
==769== by 0x53DFFFC: clone (clone.S:111)
==769==
==769== This conflicts with a previous write of size 4 by thread #1
==769== Locks held: none
==769== at 0x12A0F3: memset (string3.h:84)
==769== by 0x12A0F3: mds_service_uninstall (mdstipc_conf.c:435)
==769== by 0x116547: tet_cleanup_setup (mdstipc_api.c:2726)
==769== by 0x11BCBF: tet_send_response_ack_tp_5 (mdstipc_api.c:6726)
==769== by 0x12B928: run_test_case (utest.c:178)
==769== by 0x12BD6D: test_run (utest.c:226)
==769== by 0x10DBA8: main (mdstest.c:92)
==769== Address 0x35f72c is 12 bytes inside data symbol "svc_to_mds_info"
==769==
==769==

this is likely the cause why some mds tests sometimes fails "randomly". The mds tests has to be thread safe and helgrind can be used to identify these thread synchronization issues.

Related

Tickets: #2746
Tickets: #2798
Wiki: ChangeLog-5.18.04

Discussion

  • Hans Nordebäck

    Hans Nordebäck - 2018-01-03
    • status: unassigned --> accepted
    • assigned_to: Hans Nordebäck
     
  • Anders Widell

    Anders Widell - 2018-02-02
    • Milestone: 5.18.01 --> 5.18.04
     
  • Hans Nordebäck

    Hans Nordebäck - 2018-03-12
    • status: accepted --> unassigned
    • assigned_to: Hans Nordebäck --> Hoa Le
     
  • Hoa Le

    Hoa Le - 2018-03-19
    • status: unassigned --> accepted
    • Component: unknown --> mds
    • Part: - --> tests
     
  • Hoa Le

    Hoa Le - 2018-03-21
    • status: accepted --> review
     
  • Hoa Le

    Hoa Le - 2018-03-26
    • status: review --> fixed
    • assigned_to: Hoa Le --> nobody
     
  • Hoa Le

    Hoa Le - 2018-03-26

    Release branch:
    commit d158f2aa831a55673214c4e7640d1fcaaf7ce7b3
    Author: Hoa Le hoa.le@dektech.com.au
    Date: Thu Mar 22 19:31:39 2018 +0700

    mds: improve thread safety in mdstest [#2746]
    - Correct helgrind issues in mds/apitest
    

    commit 24f02c09aaf15b264b9e37fd945329db4f00701a
    Author: Hoa Le hoa.le@dektech.com.au
    Date: Tue Mar 27 14:11:35 2018 +0700

    mds: improve thread safety in mdstest - part 2 [#2746]
    - Remove thread-local declaration of svc_to_mds_info
    

    Develop branch:
    commit dac6b5bf582e581252f21d32b470f91d5629b867
    Author: Hoa Le hoa.le@dektech.com.au
    Date: Thu Mar 22 19:31:39 2018 +0700

    mds: improve thread safety in mdstest [#2746]
    - Correct helgrind issues in mds/apitest
    

    commit 2e1b1228d0bb8f7aa66773f11ff915d5a39b0748
    Author: Hoa Le hoa.le@dektech.com.au
    Date: Tue Mar 27 14:11:35 2018 +0700

    mds: improve thread safety in mdstest - part 2 [#2746]
    - Remove thread-local declaration of svc_to_mds_info
    
     

    Related

    Tickets: #2746


    Last edit: Hoa Le 2018-03-27

Log in to post a comment.