{"action":"created","issue":{"url":"https://api.github.com/repos/nanomsg/nng/issues/592","repository_url":"https://api.github.com/repos/nanomsg/nng","labels_url":"https://api.github.com/repos/nanomsg/nng/issues/592/labels{/name}","comments_url":"https://api.github.com/repos/nanomsg/nng/issues/592/comments","events_url":"https://api.github.com/repos/nanomsg/nng/issues/592/events","html_url":"https://github.com/nanomsg/nng/issues/592","id":341105672,"node_id":"MDU6SXNzdWUzNDExMDU2NzI=","number":592,"title":"reqctx test has a race","user":{"login":"gdamore","id":1295229,"node_id":"MDQ6VXNlcjEyOTUyMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/1295229?v=4","gravatar_id":"","url":"https://api.github.com/users/gdamore","html_url":"https://github.com/gdamore","followers_url":"https://api.github.com/users/gdamore/followers","following_url":"https://api.github.com/users/gdamore/following{/other_user}","gists_url":"https://api.github.com/users/gdamore/gists{/gist_id}","starred_url":"https://api.github.com/users/gdamore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdamore/subscriptions","organizations_url":"https://api.github.com/users/gdamore/orgs","repos_url":"https://api.github.com/users/gdamore/repos","events_url":"https://api.github.com/users/gdamore/events{/privacy}","received_events_url":"https://api.github.com/users/gdamore/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-13T17:50:16Z","updated_at":"2018-07-16T18:06:43Z","closed_at":"2018-07-16T18:06:43Z","author_association":"CONTRIBUTOR","body":"Running the test suite, the test program reqctx itself has a race\r\n\r\n```\r\nWARNING: ThreadSanitizer: data race (pid=79171)\r\n  Write of size 4 at 0x0001014baa90 by thread T10:\r\n    #0 rep_cb reqctx.c:60 (reqctx:x86_64+0x1000026e0)\r\n    #1 nni_taskq_thread taskq.c:61 (reqctx:x86_64+0x10002ace3)\r\n    #2 nni_thr_wrap thread.c:94 (reqctx:x86_64+0x10002bfb7)\r\n    #3 nni_plat_thr_main posix_thread.c:212 (reqctx:x86_64+0x10003b06a)\r\n\r\n  Previous write of size 4 at 0x0001014baa90 by thread T8:\r\n    #0 rep_cb reqctx.c:60 (reqctx:x86_64+0x1000026e0)\r\n    #1 nni_task_exec taskq.c:161 (reqctx:x86_64+0x10002b14a)\r\n    #2 nni_aio_finish_impl aio.c:432 (reqctx:x86_64+0x10000fb3a)\r\n    #3 nni_aio_finish_synch aio.c:447 (reqctx:x86_64+0x10000fbce)\r\n    #4 rep0_pipe_send_cb rep.c:447 (reqctx:x86_64+0x10006232b)\r\n    #5 nni_taskq_thread taskq.c:61 (reqctx:x86_64+0x10002ace3)\r\n    #6 nni_thr_wrap thread.c:94 (reqctx:x86_64+0x10002bfb7)\r\n    #7 nni_plat_thr_main posix_thread.c:212 (reqctx:x86_64+0x10003b06a)\r\n\r\n  Location is global 'rep_state' at 0x0001014baa78 (reqctx+0x00010007da90)\r\n\r\n  Thread T10 (tid=16835785, running) created by main thread at:\r\n    #0 pthread_create <null>:5892896 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x283ed)\r\n    #1 nni_plat_thr_init posix_thread.c:225 (reqctx:x86_64+0x10003af57)\r\n    #2 nni_thr_init thread.c:121 (reqctx:x86_64+0x10002bda0)\r\n    #3 nni_taskq_init taskq.c:111 (reqctx:x86_64+0x10002aa6c)\r\n    #4 nni_taskq_sys_init taskq.c:274 (reqctx:x86_64+0x10002b88b)\r\n    #5 nni_init_helper init.c:30 (reqctx:x86_64+0x1000150d7)\r\n    #6 nni_plat_init posix_thread.c:317 (reqctx:x86_64+0x10003b3d3)\r\n    #7 nni_init init.c:50 (reqctx:x86_64+0x10001507c)\r\n    #8 nng_aio_alloc nng.c:1470 (reqctx:x86_64+0x1000093ac)\r\n    #9 conveyMainImpl reqctx.c:86 (reqctx:x86_64+0x10000287e)\r\n    #10 conveyMain convey.c:1039 (reqctx:x86_64+0x1000083dd)\r\n    #11 main reqctx.c:86 (reqctx:x86_64+0x10000437b)\r\n\r\n  Thread T8 (tid=16835783, running) created by main thread at:\r\n    #0 pthread_create <null>:5892896 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x283ed)\r\n    #1 nni_plat_thr_init posix_thread.c:225 (reqctx:x86_64+0x10003af57)\r\n    #2 nni_thr_init thread.c:121 (reqctx:x86_64+0x10002bda0)\r\n    #3 nni_taskq_init taskq.c:111 (reqctx:x86_64+0x10002aa6c)\r\n    #4 nni_taskq_sys_init taskq.c:274 (reqctx:x86_64+0x10002b88b)\r\n    #5 nni_init_helper init.c:30 (reqctx:x86_64+0x1000150d7)\r\n    #6 nni_plat_init posix_thread.c:317 (reqctx:x86_64+0x10003b3d3)\r\n    #7 nni_init init.c:50 (reqctx:x86_64+0x10001507c)\r\n    #8 nng_aio_alloc nng.c:1470 (reqctx:x86_64+0x1000093ac)\r\n    #9 conveyMainImpl reqctx.c:86 (reqctx:x86_64+0x10000287e)\r\n    #10 conveyMain convey.c:1039 (reqctx:x86_64+0x1000083dd)\r\n    #11 main reqctx.c:86 (reqctx:x86_64+0x10000437b)\r\n\r\nSUMMARY: ThreadSanitizer: data race reqctx.c:60 in rep_cb\r\n```\r\n\r\nBasically we need a lock inside the state."},"comment":{"url":"https://api.github.com/repos/nanomsg/nng/issues/comments/405330853","html_url":"https://github.com/nanomsg/nng/issues/592#issuecomment-405330853","issue_url":"https://api.github.com/repos/nanomsg/nng/issues/592","id":405330853,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTMzMDg1Mw==","user":{"login":"gdamore","id":1295229,"node_id":"MDQ6VXNlcjEyOTUyMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/1295229?v=4","gravatar_id":"","url":"https://api.github.com/users/gdamore","html_url":"https://github.com/gdamore","followers_url":"https://api.github.com/users/gdamore/followers","following_url":"https://api.github.com/users/gdamore/following{/other_user}","gists_url":"https://api.github.com/users/gdamore/gists{/gist_id}","starred_url":"https://api.github.com/users/gdamore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gdamore/subscriptions","organizations_url":"https://api.github.com/users/gdamore/orgs","repos_url":"https://api.github.com/users/gdamore/repos","events_url":"https://api.github.com/users/gdamore/events{/privacy}","received_events_url":"https://api.github.com/users/gdamore/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T18:06:43Z","updated_at":"2018-07-16T18:06:43Z","author_association":"CONTRIBUTOR","body":"Fixed in 3f40a08eab60df77dc61ae0350e59f36e8d0ed16"}}
{"actor":{"display_login":"gdamore"}}