Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race in _seglun_grow #136

Open
PerilousApricot opened this issue Oct 13, 2016 · 1 comment
Open

Race in _seglun_grow #136

PerilousApricot opened this issue Oct 13, 2016 · 1 comment

Comments

@PerilousApricot
Copy link
Member

PerilousApricot commented Oct 13, 2016

==================
WARNING: ThreadSanitizer: data race (pid=34917)
  Write of size 8 at 0x7d2c00073758 by thread T15 (mutexes: write M0):
    #0 _seglun_grow /home/meloam/lstore/src/lio/segment/lun.c:924:23 (liblio.so.0+0x00000017c413)
    #1 _slun_truncate /home/meloam/lstore/src/lio/segment/lun.c:1061:15 (liblio.so.0+0x00000017e4d6)
    #2 seglun_rw_func /home/meloam/lstore/src/lio/segment/lun.c:1749:26 (liblio.so.0+0x00000018985d)
    #3 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #4 gop_waitany /home/meloam/lstore/src/gop/gop.c:381:13 (libgop.so.0+0x000000010f19)
    #5 gop_waitany /home/meloam/lstore/src/gop/gop.c:364:13 (libgop.so.0+0x000000010801)
    #6 segjerase_write_func /home/meloam/lstore/src/lio/segment/jerasure.c:1568:27 (liblio.so.0+0x00000014f581)
    #7 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #8 thread_pool_func /home/meloam/lstore/vendor/apr-util-accre/misc/apr_thread_pool.c:271:13 (libgop.so.0+0x00000005bd0b)

  Previous read of size 8 at 0x7d2c00073758 by thread T14:
    #0 seglun_rw_func /home/meloam/lstore/src/lio/segment/lun.c:1731:5 (liblio.so.0+0x000000189306)
    #1 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #2 gop_waitany /home/meloam/lstore/src/gop/gop.c:381:13 (libgop.so.0+0x000000010f19)
    #3 gop_waitany /home/meloam/lstore/src/gop/gop.c:364:13 (libgop.so.0+0x000000010801)
    #4 segjerase_write_func /home/meloam/lstore/src/lio/segment/jerasure.c:1568:27 (liblio.so.0+0x00000014f581)
    #5 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #6 thread_pool_func /home/meloam/lstore/vendor/apr-util-accre/misc/apr_thread_pool.c:271:13 (libgop.so.0+0x00000005bd0b)

  Location is heap block of size 176 at 0x7d2c00073750 allocated by thread T34:
    #0 malloc /home/meloam/llvm/llvm-3.9.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:591 (globus-gridftp-server+0x00000044d5cf)
    #1 segment_lun_create /home/meloam/lstore/src/lio/segment/lun.c:2882:5 (liblio.so.0+0x000000182b1e)
    #2 segment_lun_load /home/meloam/lstore/src/lio/segment/lun.c:2929:26 (liblio.so.0+0x000000198590)
    #3 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #4 segjerase_deserialize_text /home/meloam/lstore/src/lio/segment/jerasure.c:1987:20 (liblio.so.0+0x000000153021)
    #5 segjerase_deserialize /home/meloam/lstore/src/lio/segment/jerasure.c:2062:16 (liblio.so.0+0x000000154378)
    #6 segment_jerasure_load /home/meloam/lstore/src/lio/segment/jerasure.c:2153:9 (liblio.so.0+0x000000154782)
    #7 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #8 segcache_deserialize_text /home/meloam/lstore/src/lio/segment/cache.c:3367:20 (liblio.so.0+0x000000136e13)
    #9 segcache_deserialize /home/meloam/lstore/src/lio/segment/cache.c:3460:16 (liblio.so.0+0x000000138908)
    #10 segment_cache_load /home/meloam/lstore/src/lio/segment/cache.c:3641:9 (liblio.so.0+0x000000139c92)
    #11 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #12 lio_exnode_deserialize_text /home/meloam/lstore/src/lio/ex3.c:456:19 (liblio.so.0+0x000000033c37)
    #13 lio_exnode_deserialize /home/meloam/lstore/src/lio/ex3.c:495:16 (liblio.so.0+0x000000033f98)
    #14 lio_myopen_fn /home/meloam/lstore/src/lio/lio_core_io.c:482:9 (liblio.so.0+0x000000044a5b)
    #15 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #16 gop_sync_exec /home/meloam/lstore/src/gop/gop.c:607:13 (libgop.so.0+0x0000000139e4)
    #17 plugin_xfer_init /home/meloam/lstore/binding/gridftp/src/xfer.c:53:18 (libglobus_gridftp_server_lstore.so+0x000000009cad)
    #18 user_recv_init /home/meloam/lstore/binding/gridftp/src/thunk.c:221:18 (libglobus_gridftp_server_lstore.so+0x0000000079ea)
    #19 globus_l_gfs_lstore_recv /home/meloam/lstore/binding/gridftp/src/lstore_dsi.c:316:18 (libglobus_gridftp_server_lstore.so+0x0000000033e5)
    #20 globus_l_gfs_blocking_dispatch_kickout <null> (libglobus_gridftp_server.so.6+0x000000047020)
    #21 globus_l_gfs_authorize_cb <null> (libglobus_gridftp_server.so.6+0x0000000340c8)
    #22 globus_l_gfs_acl_kickout <null> (libglobus_gridftp_server.so.6+0x00000002a911)
    #23 globus_l_callback_thread_poll <null> (libglobus_common.so.0+0x00000002517e)
    #24 globus_l_thread_pool_thread_start <null> (libglobus_common.so.0+0x000000063084)
    #25 thread_starter <null> (libglobus_thread_pthread.so+0x000000003b30)

  Mutex M0 (0x7d900122e0a8) created at:
    #0 pthread_mutex_init /home/meloam/llvm/llvm-3.9.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1119 (globus-gridftp-server+0x000000433f55)
    #1 apr_thread_mutex_create /home/meloam/lstore/vendor/apr-accre/locks/unix/thread_mutex.c:71:14 (liblio.so.0+0x0000001a8b26)
    #2 segment_lun_load /home/meloam/lstore/src/lio/segment/lun.c:2929:26 (liblio.so.0+0x000000198590)
    #3 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #4 segjerase_deserialize_text /home/meloam/lstore/src/lio/segment/jerasure.c:1987:20 (liblio.so.0+0x000000153021)
    #5 segjerase_deserialize /home/meloam/lstore/src/lio/segment/jerasure.c:2062:16 (liblio.so.0+0x000000154378)
    #6 segment_jerasure_load /home/meloam/lstore/src/lio/segment/jerasure.c:2153:9 (liblio.so.0+0x000000154782)
    #7 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #8 segcache_deserialize_text /home/meloam/lstore/src/lio/segment/cache.c:3367:20 (liblio.so.0+0x000000136e13)
    #9 segcache_deserialize /home/meloam/lstore/src/lio/segment/cache.c:3460:16 (liblio.so.0+0x000000138908)
    #10 segment_cache_load /home/meloam/lstore/src/lio/segment/cache.c:3641:9 (liblio.so.0+0x000000139c92)
    #11 load_segment /home/meloam/lstore/src/lio/segment.c:88:12 (liblio.so.0+0x000000107ebe)
    #12 lio_exnode_deserialize_text /home/meloam/lstore/src/lio/ex3.c:456:19 (liblio.so.0+0x000000033c37)
    #13 lio_exnode_deserialize /home/meloam/lstore/src/lio/ex3.c:495:16 (liblio.so.0+0x000000033f98)
    #14 lio_myopen_fn /home/meloam/lstore/src/lio/lio_core_io.c:482:9 (liblio.so.0+0x000000044a5b)
    #15 thread_pool_exec_fn /home/meloam/lstore/src/gop/thread_pool_op.c:232:14 (libgop.so.0+0x00000002a7b1)
    #16 gop_sync_exec /home/meloam/lstore/src/gop/gop.c:607:13 (libgop.so.0+0x0000000139e4)
    #17 plugin_xfer_init /home/meloam/lstore/binding/gridftp/src/xfer.c:53:18 (libglobus_gridftp_server_lstore.so+0x000000009cad)
    #18 user_recv_init /home/meloam/lstore/binding/gridftp/src/thunk.c:221:18 (libglobus_gridftp_server_lstore.so+0x0000000079ea)
    #19 globus_l_gfs_lstore_recv /home/meloam/lstore/binding/gridftp/src/lstore_dsi.c:316:18 (libglobus_gridftp_server_lstore.so+0x0000000033e5)
    #20 globus_l_gfs_blocking_dispatch_kickout <null> (libglobus_gridftp_server.so.6+0x000000047020)
    #21 globus_l_gfs_authorize_cb <null> (libglobus_gridftp_server.so.6+0x0000000340c8)
    #22 globus_l_gfs_acl_kickout <null> (libglobus_gridftp_server.so.6+0x00000002a911)
    #23 globus_l_callback_thread_poll <null> (libglobus_common.so.0+0x00000002517e)
    #24 globus_l_thread_pool_thread_start <null> (libglobus_common.so.0+0x000000063084)
    #25 thread_starter <null> (libglobus_thread_pthread.so+0x000000003b30)

  Thread T15 (tid=34935, running) created by main thread at:
    #0 pthread_create /home/meloam/llvm/llvm-3.9.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:902 (globus-gridftp-server+0x000000425266)
    #1 apr_thread_pool_create /home/meloam/lstore/vendor/apr-util-accre/misc/apr_thread_pool.c:380:14 (libgop.so.0+0x00000005bae4)
    #2 lio_create_nl /home/meloam/lstore/src/lio/lio_config.c:920:30 (liblio.so.0+0x000000039595)
    #3 lio_create /home/meloam/lstore/src/lio/lio_config.c:1101:10 (liblio.so.0+0x00000003e8b6)
    #4 lio_init /home/meloam/lstore/src/lio/lio_config.c:1397:14 (liblio.so.0+0x00000004125b)
    #5 activate /home/meloam/lstore/binding/gridftp/src/thunk.c:38:5 (libglobus_gridftp_server_lstore.so+0x000000006810)
    #6 globus_l_gfs_lstore_activate /home/meloam/lstore/binding/gridftp/src/lstore_dsi.c:452:18 (libglobus_gridftp_server_lstore.so+0x000000003961)
    #7 globus_module_activate_proxy <null> (libglobus_common.so.0+0x000000047d96)
    #8 globus_extension_activate <null> (libglobus_common.so.0+0x0000000737ce)
    #9 globus_i_gfs_data_new_dsi <null> (libglobus_gridftp_server.so.6+0x0000000317cb)
    #10 globus_i_gfs_data_init <null> (libglobus_gridftp_server.so.6+0x000000031155)
    #11 main <null> (globus-gridftp-server+0x0000004acbc2)

  Thread T14 (tid=34934, running) created by main thread at:
    #0 pthread_create /home/meloam/llvm/llvm-3.9.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:902 (globus-gridftp-server+0x000000425266)
    #1 apr_thread_pool_create /home/meloam/lstore/vendor/apr-util-accre/misc/apr_thread_pool.c:380:14 (libgop.so.0+0x00000005bae4)
    #2 lio_create_nl /home/meloam/lstore/src/lio/lio_config.c:920:30 (liblio.so.0+0x000000039595)
    #3 lio_create /home/meloam/lstore/src/lio/lio_config.c:1101:10 (liblio.so.0+0x00000003e8b6)
    #4 lio_init /home/meloam/lstore/src/lio/lio_config.c:1397:14 (liblio.so.0+0x00000004125b)
    #5 activate /home/meloam/lstore/binding/gridftp/src/thunk.c:38:5 (libglobus_gridftp_server_lstore.so+0x000000006810)
    #6 globus_l_gfs_lstore_activate /home/meloam/lstore/binding/gridftp/src/lstore_dsi.c:452:18 (libglobus_gridftp_server_lstore.so+0x000000003961)
    #7 globus_module_activate_proxy <null> (libglobus_common.so.0+0x000000047d96)
    #8 globus_extension_activate <null> (libglobus_common.so.0+0x0000000737ce)
    #9 globus_i_gfs_data_new_dsi <null> (libglobus_gridftp_server.so.6+0x0000000317cb)
    #10 globus_i_gfs_data_init <null> (libglobus_gridftp_server.so.6+0x000000031155)
    #11 main <null> (globus-gridftp-server+0x0000004acbc2)

  Thread T34 (tid=34955, running) created by thread T2 at:
    #0 pthread_create /home/meloam/llvm/llvm-3.9.0.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:902 (globus-gridftp-server+0x000000425266)
    #1 globus_l_pthread_thread_create <null> (libglobus_thread_pthread.so+0x0000000032df)
    #2 globus_thread_create <null> (libglobus_common.so.0+0x000000060f71)
    #3 globus_i_thread_start <null> (libglobus_common.so.0+0x0000000633c9)
    #4 globus_l_callback_blocked_cb <null> (libglobus_common.so.0+0x000000026398)
    #5 globus_thread_blocking_space_will_block <null> (libglobus_common.so.0+0x00000005eaa3)
    #6 globus_l_gfs_blocking_dispatch_kickout <null> (libglobus_gridftp_server.so.6+0x000000046843)
    #7 globus_l_gfs_authorize_cb <null> (libglobus_gridftp_server.so.6+0x0000000340c8)
    #8 globus_l_gfs_acl_kickout <null> (libglobus_gridftp_server.so.6+0x00000002a911)
    #9 globus_l_callback_thread_poll <null> (libglobus_common.so.0+0x00000002517e)
    #10 globus_l_thread_pool_thread_start <null> (libglobus_common.so.0+0x000000062cf4)
    #11 thread_starter <null> (libglobus_thread_pthread.so+0x000000003b30)

SUMMARY: ThreadSanitizer: data race /home/meloam/lstore/src/lio/segment/lun.c:924:23 in _seglun_grow
==================
@PerilousApricot PerilousApricot changed the title Race in seglun Race in _seglun_grow Oct 13, 2016
@tacketar
Copy link
Contributor

Shuffled comment around to avoid the race condition. Look at patch 02192af5092cde58dbc4ae2686d1ebdca4633631 for a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants