-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Intro
We are working on the mujoco-usd-converter.
My setup
MuJoCo 3.5.0, Python, Windows and Linux
What's happening? What did you expect?
Segfault when accessing tendons through the python bindings on a model that is included using body/attach.
Accessing the MjsWrap objects from MjsTendonPath in the Python bindings causes a segfault when the model was loaded via <attach>.
I found this when trying to iterate over the tendon path in the softfoot model from within scene.xml from https://github.com/google-deepmind/mujoco_menagerie/tree/main/iit_softfoot
Steps for reproduction
I've attached a shell script and python program that will segfault:
mujoco_tendon_repro.zip
setup_and_run.sh -- the entry point:
- Creates a
.venvvirtual environment usinguv venv - Installs
mujoco>=3.5.0viauv pip install - Downloads only the
iit_softfootdirectory frommujoco_menagerieusing a sparse git checkout (avoids cloning the full repo) - Runs the Python repro script
repro_tendon_bug.py -- the reproduction:
- Loads
softfoot.xmldirectly viaMjSpec.from_file(), compiles it, and iterates over all tendons/path waypoints -- proving the model itself is valid - Loads
scene.xml(which includes the softfoot via<attach/>), then does the same iteration - For each waypoint, attempts to access
wp.target.name-- this is where the crash should occur due to the Python bindings bug
To run it:
cd /home/lrohan/dev/mujoco_tendon_repro
./setup_and_run.shMinimal model for reproduction
The repro zip/script will download the softfoot scene from the MuJoCo Menagerie.
Code required for reproduction
The repro zip/script contains the Python code.
Confirmations
- I searched the latest documentation thoroughly before posting.
- I searched previous Issues and Discussions, I am certain this has not been raised before.