Go to file
Jason Rhinelander ef028b0e33
Fix python binding segfault
This fixes a segfault in the reply handling code, where the destructor
of a `py::function` wasn't necessarily happening with the GIL held,
which could make Python segfault.

The solution that was here to address this didn't work because it was
relying on std::optionals, but it is possible (and apparently sometimes
happens) that the std::function this lambda gets stuffed into gets moved
(or maybe copied?), which then results in *two* lambda destructions: we
were correctly dealing with the one that eventually gets called by
clearing things properly when it gets called, but the temporary
destructor also fires, and that is the one that broke.

This changes it to instead leak bare pointers into the lambda and then
recapture them inside when we get called; since we are guaranteed to be
called exactly once, this recaptures them without losing them but
doesn't incur destruction of a py::function deep in oxenmq (outside of
GIL scope).
2023-09-27 20:17:41 -03:00
contrib Add drone build & tests 2021-10-22 19:12:57 -03:00
debian 1.0.4 2023-03-28 09:36:41 +11:00
examples loki -> oxen refactor 2021-02-01 10:48:27 -05:00
lokinet loki -> oxen refactor 2021-02-01 10:48:27 -05:00
src Fix python binding segfault 2023-09-27 20:17:41 -03:00
tests Add simple pytest tests 2021-10-22 17:03:06 -03:00
.drone.jsonnet use prebuilt builder ci; reformat 2021-10-27 12:20:04 -03:00
.gitignore update readme and ignore 2020-10-03 12:33:49 -04:00
MANIFEST.in pyoxenmq overhaul 2021-10-21 22:23:02 -03:00
pyproject.toml Remove cmake build system and submodules 2021-10-22 16:09:36 -03:00
pytest.ini Add simple pytest tests 2021-10-22 17:03:06 -03:00
README.md Update readme for new code 2021-10-22 20:22:54 -03:00
setup.py Fix python binding segfault 2023-09-27 20:17:41 -03:00

pyoxenmq

Python interface to OxenMQ

building

dependencies

  • python3-pip
  • python3-dev
  • pybind11-dev
  • liboxenmq-dev

Check the source out with

$ git clone https://github.com/oxen-io/oxen-pyoxenmq
$ cd oxen-pyoxenmq

Install using:

$ pip3 install .