Skip to content

Commit

Permalink
fixed segfault caused by GIL not acquired when default-initializing b…
Browse files Browse the repository at this point in the history
…ytes object
  • Loading branch information
mdorier committed Nov 28, 2022
1 parent 22f2396 commit 625e062
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymargo/src/pymargo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static hg_return_t pymargo_generic_rpc_callback(hg_handle_t handle)
hg_return_t ret = HG_SUCCESS;
margo_instance_id mid = MARGO_INSTANCE_NULL;
const struct hg_info* info = NULL;
py11::gil_scoped_acquire acquire;
py11::bytes input;

mid = margo_hg_handle_get_instance(handle);
Expand Down Expand Up @@ -207,7 +208,6 @@ static hg_return_t pymargo_generic_rpc_callback(hg_handle_t handle)

if(!disabled_flag) {
std::string out;
py11::gil_scoped_acquire acquire;
try {
pymargo_hg_handle pyhandle(handle);
margo_ref_incr(handle);
Expand Down

0 comments on commit 625e062

Please sign in to comment.