MB-19204: Address data race in ep_test_apis/testsuite 08/62908/3
authorDave Rigby <daver@couchbase.com>
Thu, 14 Apr 2016 13:08:17 +0000 (14:08 +0100)
committerChiyoung Seo <chiyoung@couchbase.com>
Sat, 23 Apr 2016 00:46:11 +0000 (00:46 +0000)
commite1b87bcc307d179a580d0356c0f332be591ac307
treee4eeb7d86db364a7524f26a119c982eb7c205121
parenteb1e92537f03135cbb4cff7e0b47b9bfb898064f
MB-19204: Address data race in ep_test_apis/testsuite

WARNING: ThreadSanitizer: data race (pid=18824)

  Write of size 4 at 0x7fcc31350244 by thread T12 (mutexes: write M44413):
    #0 add_response ep-engine/tests/ep_test_apis.cc:75 (ep_testsuite.so+0x0000000acbcc)
    #1 sendResponse(bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*), void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*) ep-engine/src/ep_engine.cc:92 (ep.so+0x0000000d004c)
    #2 processUnknownCommand(EventuallyPersistentEngine*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) ep-engine/src/ep_engine.cc:1266 (ep.so+0x0000000d603c)
    #3 EvpUnknownCommand(engine_interface*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) ep-engine/src/ep_engine.cc:1387 (ep.so+0x0000000b3f58)
    #4 mock_unknown_command(engine_interface*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) memcached/programs/engine_testapp/engine_testapp.cc:380 (engine_testapp+0x0000000bab29)
    #5 del_with_meta(engine_interface*, engine_interface_v1*, char const*, unsigned long, unsigned int, ItemMetaData*, unsigned long, bool, bool, long, unsigned char, void const*) ep-engine/tests/ep_test_apis.cc:360 (ep_testsuite.so+0x0000000ae69f)
    #6 multi_del_with_meta(void*) ep-engine/tests/ep_testsuite.cc:13299 (ep_testsuite.so+0x00000009572e)
    #7 platform_thread_wrap platform/src/cb_pthreads.c:23 (libplatform.so.0.1.0+0x000000003d31)

  Previous write of size 4 at 0x7fcc31350244 by thread T11 (mutexes: write M1638603450185076640):
    #0 add_response ep-engine/tests/ep_test_apis.cc:75 (ep_testsuite.so+0x0000000acbcc)
    #1 sendResponse(bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*), void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*) ep-engine/src/ep_engine.cc:92 (ep.so+0x0000000ced72)
    #2 processUnknownCommand(EventuallyPersistentEngine*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) ep-engine/src/ep_engine.cc:1258 (ep.so+0x0000000d5718)
    #3 EvpUnknownCommand(engine_interface*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) ep-engine/src/ep_engine.cc:1387 (ep.so+0x0000000b3f58)
    #4 mock_unknown_command(engine_interface*, void const*, protocol_binary_request_header*, bool (*)(void const*, unsigned short, void const*, unsigned char, void const*, unsigned int, unsigned char, unsigned short, unsigned long, void const*)) memcached/programs/engine_testapp/engine_testapp.cc:380 (engine_testapp+0x0000000bab29)
    #5 set_with_meta(engine_interface*, engine_interface_v1*, char const*, unsigned long, char const*, unsigned long, unsigned int, ItemMetaData*, unsigned long, bool, unsigned char, bool, long, unsigned char, void const*) ep-engine/tests/ep_test_apis.cc:702 (ep_testsuite.so+0x0000000b24db)
    #6 multi_set_with_meta(void*) ep-engine/tests/ep_testsuite.cc:13279 (ep_testsuite.so+0x000000094e33)
    #7 platform_thread_wrap platform/src/cb_pthreads.c:23 (libplatform.so.0.1.0+0x000000003d31)

Change-Id: Ic53d401fb674dbe161aa73381e2c08c5995f262a
Reviewed-on: http://review.couchbase.org/62908
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>
tests/ep_test_apis.cc
tests/ep_test_apis.h