mujoco icon indicating copy to clipboard operation
mujoco copied to clipboard

Mujoco v2.2.1 Unity Plugin crashing on any import in method Mujoco.MujocoLib:mj_loadXML on Mac M1 (Unity rosetta)

Open arghyasur1991 opened this issue 3 years ago • 2 comments

Obtained 256 stack frames.
#0  0x00000168c2c9e6 in mono_unity_backtrace_from_context
#1  0x0000010130d199 in PrintStackTraceOSX(void*)
#2  0x000001011cab41 in HandleSignal(int, __siginfo*, void*)
#3  0x00000168c85c3c in mono_chain_signal
#4  0x00000168ba91a0 in mono_sigsegv_signal_handler_debug
#5  0x007ff8111badfd in _sigtramp
#6  0x00000000000000 in (Unknown)
#7  0x007ff8111badfd in _sigtramp
.......... <repeat>
#2430x007ff8111badfd in _sigtramp
#2440x00000000000000 in (Unknown)
#2450x007ff8111badfd in _sigtramp
#2460x00000000000000 in (Unknown)
#2470x00000000000000 in (Unknown)
#2480x000001011cab41 in HandleSignal(int, __siginfo*, void*)
#2490x00000168c85c3c in mono_chain_signal
#2500x00000168ba8e97 in mono_crashing_signal_handler
#2510x007ff8111badfd in _sigtramp
#2520x00000000000000 in (Unknown)
#2530x000002250326d3 in mjParseXML(char const*, mjVFS_ const*, char*, int)
#2540x0000022503162b in mj_loadXML
#2550x000002067dac94 in  (wrapper managed-to-native) Mujoco.MujocoLib:mj_loadXML (string,void*,System.Text.StringBuilder,int) [{0x7f9f72650c78} + 0x164]  (0x2067dab30 0x2067dadff) [0x168742a80 - Unity Child Domain]

  • Include the following context:
    • Mac M1 (Rosetta)
    • MuJoCo version 2.2.1 and 2.2.0 both crashing
    • Unity v2022.2.0b1 and 2021.3.6f1 LTS both crashing

Repro steps -

  1. Use unity package manager to locate and install mujoco from its package.json
  2. Import a model (humanoid.xml/cloth.xml etc. in models folder)

Result: Crash (or indefinite hang)

  1. Instead of import, try adding a component in a gameobject in scene (Tried mj geom on a plane)
  2. Hit play

Result: crash (or indefinite hang)

arghyasur1991 avatar Aug 12 '22 14:08 arghyasur1991

Using native silicon version of Unity 2021.3.8f1 is working. But I need the rosetta version for my other plugin dependencies in project which are intel only

arghyasur1991 avatar Aug 12 '22 14:08 arghyasur1991

This issue is almost definitely due to AVX. Now that MuJoCo is open source, you can try building the library yourself without AVX, and that should hopefully work.

saran-t avatar Aug 12 '22 15:08 saran-t