Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pybind11_mkdoc to make Python docstrings from C++ comments #7

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

aloisklink
Copy link
Contributor

Currently, our docstrings for Python are explicitly defined as C++ std::strings, e.g. with something like:

m.doc() = R"(Optris PI and XI imager IR camera controller
We use the IRImagerDirect SDK
(see http://documentation.evocortex.com/libirimager2/html/index.html)
to control these cameras.)";

However, this is pretty inconvenient as:

  1. The docstrings have to be defined in the pybind11 binding code, not where the functions are defined. This is currently not too bad as everything is in one file, but we'd generally rather have a separate file for the IRImager C++ class, and then a separate file that deals with binding the C++ class to a Python class/module.
  2. C++ normally expects documentation in Doxygen comments, e.g. like:
    /**
    * Start video grabbing
    *
    * Prefer using `with irimager: ...` to automatically start/stop streaming
    * on errors.
    *
    * @throws RuntimeError if streaming cannot be started, e.g. if the camera
    * is not connected.
    */
    void start_streaming() {

    Using Doxygen comments is a lot more familiar, especially since most code editors will have some sort of intellisense/code-previews that automatically shows the comments for a function. However, there's no way to access comments in C++, since they're part of the pre-processor.

pybind11_mkdoc is a tool that uses Clang to parse our C++ code, automatically extract the comments, and create a docstrings.h header file that contains the comments of every single function, but as a string that can be imported into C++ code.

I've followed the approach listed in pybind/pybind11_mkdoc#23 (comment) to run pybind11_mkdoc in CMake. This is required because:

  • pybind11_mkdoc needs to know where to include all of the C/C++ header files, and only CMake knows where all of these library ares (e.g., if you install via pdm/poetry, pybind11 is generally saved into a temporary folder, but not if you're installing via pip3).
  • pybind11_mkdoc needs to be run before C++ is run, since the files are required for compilation.

[pybind11_mkdoc][1] is a tool that can automatically load the comments
from C/C++ headers so that they can be used as docstrings in pybind11
code.

I've set it up so that `pybind11_mkdoc` runs automatically by CMake.
I've also put it into the `build-system.requires` so that it is
automatically installed.

[1]: https://github.com/pybind/pybind11_mkdoc
Limit the `pybind11_mkdoc` dependency to exactly commit
corna/pybind11_mkdoc@e71d15f,
instead of any commmit on the `master` branch.
Copy link
Contributor

@AshleySetter AshleySetter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@aloisklink aloisklink merged commit 82db5ed into main Jul 25, 2023
4 checks passed
@aloisklink aloisklink deleted the refactor/use-pybind11-mkdoc branch July 25, 2023 12:47
aloisklink added a commit that referenced this pull request Aug 25, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 4, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 11, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 15, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 15, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 18, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 18, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Sep 29, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Oct 16, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
aloisklink added a commit that referenced this pull request Oct 27, 2023
Potential issues, maybe calling `->stop()` on the loop after a file has
been opened, but before the `->read()` has completed, isn't defined????

Current error:

  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  (gdb) bt
  #0  0x00007ffff71403cf in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #1  0x00007ffff712e7f7 in uv_run () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #2  0x00007ffff7116d59 in ?? () from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #3  0x00007ffff7117ecb in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #4  0x00007ffff7111b3d in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #5  0x00007ffff7ce2f68 in __pthread_once_slow (once_control=0x555555cf5ff8, init_routine=0x7ffff6f6fd50 <__once_proxy>) at ./nptl/pthread_once.c:116
  #6  0x00007ffff7115dd2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<IRLoggerToSpd::impl::start_thread(std::filesystem::__cxx11::path const&)::{lambda()#1}> >, void>::_M_run() ()
     from /home/alois/Documents/nqminds/nqm-irimager/.venv/lib/python3.10/site-packages/nqm/irimager.cpython-310-x86_64-linux-gnu.so
  #7  0x00007ffff6f71253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
  #8  0x00007ffff7cddb43 in start_thread (arg=<optimised out>) at ./nptl/pthread_create.c:442
  #9  0x00007ffff7d6fa00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants