Python segfault with action graph in scene

I’m trying to load my own USD file using the “USD Load Sample” python script. I’ve noticed when I try to load and play a USD file with an action graph in it, Python throw a seg fault.

Fatal Python error: Segmentation fault

If I delete my action graph (which is blank, by the way), the USD runs fine.

I’m wondering if there’s some extension I need to enable to get the action graph to run properly?

I’m currently importing these two:

enable_extension("omni.graph.core")
enable_extension("omni.graph.action")

(The Action Graph will eventually publish a ROS2 clock, but I don’t think that’s the issue).

I’ve gotten a little more into the issue here. It seems to be a problem with the ROS2 bridge extension.

I opened Isaac sim and saved a completely blank USD file (saved as “blank.usd”). If I load that scene with the following script (based on the example), it will fail if the # enable_extension("omni.isaac.ros2_bridge") line is uncommented:

import sys

from isaacsim import SimulationApp

kit = SimulationApp({"headless": True})

from omni.isaac.core.utils.extensions import enable_extension
# enable_extension("omni.isaac.ros2_bridge")


import carb
import omni

usd_path = "/isaac-sim/workspaces/blank.usd"
omni.usd.get_context().open_stage(usd_path)

# Wait two frames so that stage starts loading
kit.update()
kit.update()

print("Loading stage...")
from omni.isaac.core.utils.stage import is_stage_loading

while is_stage_loading():
    kit.update()
print("Loading Complete")
omni.timeline.get_timeline_interface().play()
while kit.is_running():
    # Run in realtime mode, we don't specify the step size
    kit.update()

omni.timeline.get_timeline_interface().stop()
kit.close()

Here’s the output:

# code object from '/isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/__pycache__/TestOgnROS2ServiceServerRequest.cpython-310.pyc'
import 'omni.isaac.ros2_bridge.ogn.tests.TestOgnROS2ServiceServerRequest' # <_frozen_importlib_external.SourceFileLoader object at 0x7f71e79cff40>
# /isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/__pycache__/TestOgnROS2PublishImage.cpython-310.pyc matches /isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/TestOgnROS2PublishImage.py
# code object from '/isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/__pycache__/TestOgnROS2PublishImage.cpython-310.pyc'
import 'omni.isaac.ros2_bridge.ogn.tests.TestOgnROS2PublishImage' # <_frozen_importlib_external.SourceFileLoader object at 0x7f71e79cf700>
# /isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/__pycache__/TestOgnROS2SubscribeTransformTree.cpython-310.pyc matches /isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/TestOgnROS2SubscribeTransformTree.py
# code object from '/isaac-sim/exts/omni.isaac.ros2_bridge/omni/isaac/ros2_bridge/ogn/tests/__pycache__/TestOgnROS2SubscribeTransformTree.cpython-310.pyc'
import 'omni.isaac.ros2_bridge.ogn.tests.TestOgnROS2SubscribeTransformTree' # <_frozen_importlib_external.SourceFileLoader object at 0x7f71e79cdd50>
Fatal Python error: Segmentation fault

Thread 0x00007f62db7ff640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f710d9fe640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f70d7fff640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f711d5fe640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f711fdf8640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f72fe9bdb80 (most recent call first):
  File "/isaac-sim/exts/omni.isaac.kit/omni/isaac/kit/simulation_app.py", line 504 in update
  File "/isaac-sim/./workspaces/load_stage.py", line 27 in <module>
./python.sh: line 41: 20336 Segmentation fault      (core dumped) $python_exe "$@" $args
There was an error running python

I’ve verified that ROS2 is sourced when running by using this shell script:

#!/bin/bash

# Source ROS2 setup script
source /opt/ros/humble/setup.bash
source /isaac-sim/workspaces/ros_ws/install/setup.bash

# Check if ROS2 was sourced successfully
if [ "$ROS_DISTRO" != "humble" ]; then
  echo "Failed to source ROS2 Humble. Exiting."
  exit 1
fi

# Change directory to /isaac-sim
cd /isaac-sim

# Run the python script
./python.sh -v ./workspaces/load_stage.py

Do I need to import some other extension first? Or what could be the issue?

More context, it happens after the first kit.update() call. Here’s my REPL session:

>>> from isaacsim import SimulationApp
>>> kit = SimulationApp({"headless": True})
...
>>> from omni.isaac.core.utils.extensions import enable_extension
>>> enable_extension("omni.isaac.ros2_bridge")
...
>>> import omni
>>> usd_path = "/isaac-sim/workspaces/blank.usd"
>>> omni.usd.get_context().open_stage(usd_path)
True
>>> kit.update()
Fatal Python error: Segmentation fault

Thread 0x00007f21417fc640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f2f3effd640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f2f5dfff640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f2f5d7fe640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f2f5fff8640 (most recent call first):
  File "/isaac-sim/kit/python/lib/python3.10/concurrent/futures/thread.py", line 81 in _worker
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 953 in run
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 1016 in _bootstrap_inner
  File "/isaac-sim/kit/python/lib/python3.10/threading.py", line 973 in _bootstrap

Thread 0x00007f313f0f1b80 (most recent call first):
  File "/isaac-sim/exts/omni.isaac.kit/omni/isaac/kit/simulation_app.py", line 504 in update
  File "<stdin>", line 1 in <module>

Extension modules: psutil._psutil_linux, psutil._psutil_posix, omni.mdl.pymdlsdk._pymdlsdk, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, PIL._imaging, PIL._imagingft, scipy._lib._ccallback_c, scipy.ndimage._nd_image, scipy.special._ufuncs_cxx, scipy.special._ufuncs, scipy.special._specfun, scipy.special._comb, scipy.linalg._fblas, scipy.linalg._flapack, scipy.linalg._cythonized_array_utils, scipy.linalg._flinalg, scipy.linalg._solve_toeplitz, scipy.linalg._matfuncs_sqrtm_triu, scipy.linalg.cython_lapack, scipy.linalg.cython_blas, scipy.linalg._matfuncs_expm, scipy.linalg._decomp_update, scipy.sparse._sparsetools, _csparsetools, scipy.sparse._csparsetools, scipy.sparse.linalg._isolve._iterative, scipy.sparse.linalg._dsolve._superlu, scipy.sparse.linalg._eigen.arpack._arpack, scipy.sparse.csgraph._tools, scipy.sparse.csgraph._shortest_path, scipy.sparse.csgraph._traversal, scipy.sparse.csgraph._min_spanning_tree, scipy.sparse.csgraph._flow, scipy.sparse.csgraph._matching, scipy.sparse.csgraph._reordering, scipy.special._ellip_harm_2, _ni_label, scipy.ndimage._ni_label, torch._C, torch._C._fft, torch._C._linalg, torch._C._nested, torch._C._nn, torch._C._sparse, torch._C._special, scipy.spatial._ckdtree, scipy._lib.messagestream, scipy.spatial._qhull, scipy.spatial._voronoi, scipy.spatial._distance_wrap, scipy.spatial._hausdorff, scipy.spatial.transform._rotation, osqp._osqp, multidict._multidict, yarl._quoting_c, aiohttp._helpers, aiohttp._http_writer, aiohttp._http_parser, aiohttp._websocket, _cffi_backend, frozenlist._frozenlist, scipy.io.matlab._mio_utils, scipy.io.matlab._streams, scipy.io.matlab._mio5_utils, yaml._yaml, cv2 (total: 78)
./python.sh: line 41: 24398 Segmentation fault      (core dumped) $python_exe "$@" $args
There was an error running python

If I take away enabling the ros2 bridge extension, it works just fine.

And I’m running the python.sh file from a terminal that has sourced ROS2.

Found the solution after looking at some of the examples. Needed to run an update step before loading the USD file. So it would look like this

# ...
from omni.isaac.core.utils.extensions import enable_extension
enable_extension("omni.isaac.ros2_bridge")

# add the below
kit.update()

import omni
usd_path = "/isaac-sim/workspaces/blank.usd"
omni.usd.get_context().open_stage(usd_path)
# ...
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.