-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Mac M1: libc++abi: terminating with uncaught exception of type pybind11::stop_iteration: #4809
Comments
I can confirm this issue on M1 mac. Thanks for the detailed info. |
Same issue on M1 pro. I had installed pybind11 for another project. |
I also faced this issue on M1 mac. My steps:
|
I confirm that it also happens on my M1 and importing open3d first helps. |
I have a similar issue but it seems it's not related to multiple Mac OS Monterey 12.5.1 / M1 Pro / Open3D 0.15.1 When I run this minimal code snippet, it works normally import open3d as o3d
o3d.core.Tensor([1.0, 2.0], dtype=o3d.core.Dtype.Float32) But when encounter line 2 in a debugger (e.g. Pycharm), I get: |
I wouldn't be surprised that when you are running Pycharm debugger it adds
(via regular import/load_module routines) some native modules that then
interferes with the open3d code when stop_iteration exception tries to be
propagated. Though it's a hypothesis (more like guessing).
…On Fri, Sep 2, 2022 at 2:34 PM Mate Mijolović ***@***.***> wrote:
I have a similar issue but it seems it's not related to multiple pybind
modules.
Mac OS Monterey 12.5.1 / M1 Pro / Open3D 0.15.1
When I run this minimal code snippet, it works normally
import open3d as o3do3d.core.Tensor([1.0, 2.0], dtype=o3d.core.Dtype.Float32)
But when encounter line 2 in a debugger (e.g. Pycharm), I get:
libc++abi: terminating with uncaught exception of type
pybind11::stop_iteration:
—
Reply to this email directly, view it on GitHub
<#4809 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGOKV2BXGVKBLPJSKFDNLV4JXETANCNFSM5PLWHCLA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
Pavlo Bashmakov, Software Engineer, 3D Mapping @ Ouster
https://capsulesbot.com/
|
It's almost a year since the bug is reported and it's still there. We just hit it just now again when
|
Any workaround? Even with open3d imported first, I experience this issue now. |
@w3ichen s workaround works for me. |
Thanks to @w3ichen
If I replace |
This is fixed in PR #6008 and available in v0.17.0. If building from source use |
Hi @ssheorey, I was getting the same error when trying to run the pose_graph_optim.py file in the python examples:
I tracked it down to Specifically, I had to change these lines:
to ` for i in range(len(nodes)):
Should I create a new issue or just leave it here? It's basically the same problem. I'm using a M1 Pro and open3d (0.17.0 installed via pip) in a python environment. Thanks |
Checklist
master
branch).Describe the issue
Open3d pybind11 module installed exception translator crashes when others pybind11 modules
loaded together with
open3d
and other's module exception arrives to the open3d exceptiontranslator first.
Ughh, it's complicated, let's see on an example below.
Consider the simple example with two pybind11 modules loaded (
open3d
andgtsam
) that leads to a crash on Mac M1 system:Crashes with an error:
To fix the thing, one need to load
open3d
first and thengtsam
, i.e.:What's going on here!?
I've spent some time in
lldb
with my other custom pybind11 module that I've had debug symbols for and it lead me to the chains of exception translators that pybind11 establishes when new module is loaded.https://github.com/pybind/pybind11/blob/master/include/pybind11/detail/internals.h#L460
Then when pybind11 exception is fired in any other native module it goes to the chain and tries exception translators in a reverse order of their loading.
https://github.com/pybind/pybind11/blob/master/include/pybind11/pybind11.h#L1000
So in an above crash situation
open3d
exception translators appears to be first and instead of silently passing through and re-throw exception to give a chance for other translators to handle it the process crashes with an above error.I don't have a deep knowledge of C++ runtimes but seems that some weird translation of original exception happened so it passed through the catch clause of
py::detail::apply_exception_translators()
function and popped unhandled to a further runtime.With pybind11 2.8.0+ one can install
local_exception_translators
that are handled always first for a local module, and with it we've been able to hack around theopen3d
translator crash on Mac M1, but it will not work for other modules that already built and can't be used with open3d if open3d modules loaded the last one.UPDATE: Btw, it's not happening in Linux, Win, Mac x64 based systems, the only case where it's that weird behavior is Mac M1 system. Thanks!
Steps to reproduce the bug
Error message
libc++abi: terminating with uncaught exception of type pybind11::stop_iteration:
Expected behavior
no crash
Open3D, Python and System information
Additional information
the same situation is not hapening when we switch
open3d
to some other pybind11 based module (for examplepip install ouster-sdk
and thenimport ouster.client as client
is playing nicely withgtsam
and all exception translators are passing through/re-throwing exceptions without abi crashes)The text was updated successfully, but these errors were encountered: