Fix race in ext_strobelight async signal processing
commit2e3f9e017f357fb009dd49255eabf8983c2dced5
authorPaul Bissonnette <paulbiss@fb.com>
Thu, 8 Oct 2020 06:13:21 +0000 (7 23:13 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 8 Oct 2020 06:15:38 +0000 (7 23:15 -0700)
tree94859e7e878e79a88a74c67fbff2ad0b44857bfc
parent9b9b2c40b88896b40d3378e435c9807de5c20bfa
Fix race in ext_strobelight async signal processing

Summary:
It's possible for the signal handler to fire during `rds::threadInit` while we make a syscall to bind to a numa node through `numa_bind_to` (or during a context switch) causing us to run `onStrobelightSignal()` in a state where `rds::header()` is initialized but `rds::local::init()` has not occurred making `RDSLocal` thread locals invalid.

Add an atomic flag that can be checked to see if all initialization for RDS is complete and use it in ext_strobelight.

Reviewed By: binliu19, oulgen, jano

Differential Revision: D24167935

fbshipit-source-id: 6b7b4726593035a2c33b94e525ec37d68fc7205d
hphp/hhvm/thread_locals.txt
hphp/runtime/base/rds.cpp
hphp/runtime/base/rds.h
hphp/runtime/ext/strobelight/ext_strobelight.cpp