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

Plugins segfault when built with mjUSESINGLE #2115

Closed
2 tasks done
PeterOGB opened this issue Oct 3, 2024 · 4 comments
Closed
2 tasks done

Plugins segfault when built with mjUSESINGLE #2115

PeterOGB opened this issue Oct 3, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@PeterOGB
Copy link

PeterOGB commented Oct 3, 2024

Intro

New mujoco user here, I'm a retired software engineer with 40 years C/unix/linux experience.

I'm trying to integrate mujoco into an existing application that runs on a Raspberry Pi5 and uses openGLES for rendering and gclm for maths.

My setup

Raspberry Pi 5 running wayland on top of 64 bit PiOS (Debian 12).
cmake version 3.25.1
gcc (Debian 12.2.0-14) 12.2.0
MujoCo built from github with mjUSESINGLE defined and CCD built for single precision.

What's happening? What did you expect?

Running simulate on model/plugin/elasticity/cable.xml produces a segfaut

Thread 3 "simulate" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe9562800 (LWP 47911)]
memcpy_generic () at ../sysdeps/aarch64/multiarch/../memcpy.S:173
173 ../sysdeps/aarch64/multiarch/../memcpy.S: No such file or directory.
(gdb) bt
#0 memcpy_generic () at ../sysdeps/aarch64/multiarch/../memcpy.S:173
#1 0x00007ffff74d3ef4 in mujoco::plugin::elasticity::Cable::RegisterPlugin()::{lambda(mjModel
const*, mjData
, int)#2}::FUN(mjModel const, mjData
*, int) () from /usr/local/bin/mujoco_plugin/libelasticity.so
#2 0x00007ffff7d1ee24 in mj_initPlugin () from /usr/local/bin/../lib/libmujoco.so.3.2.3
#3 0x00007ffff7d25634 in mj_makeData () from /usr/local/bin/../lib/libmujoco.so.3.2.3
#4 0x00007ffff7db1ea8 in mjCModel::TryCompile(mjModel
&, mjData_&, mjVFS_ const*) ()
from /usr/local/bin/../lib/libmujoco.so.3.2.3
#5 0x00007ffff7daead8 in mjCModel::Compile(mjVFS_ const*, mjModel_**) ()
from /usr/local/bin/../lib/libmujoco.so.3.2.3
#6 0x00007ffff7df54b4 in mj_loadXML () from /usr/local/bin/../lib/libmujoco.so.3.2.3
#7 0x000055555555c798 in (anonymous namespace)::LoadModel(char const*, mujoco::Simulate&) ()
#8 0x0000555555561fc0 in PhysicsThread(mujoco::Simulate*, char const*) ()
#9 0x00007ffff792e9dc in ?? () from /lib/aarch64-linux-gnu/libstdc++.so.6
#10 0x00007ffff76dee58 in start_thread (arg=0x7fffffffecb7) at ./nptl/pthread_create.c:442
#11 0x00007ffff7747f9c in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:79

Steps for reproduction

Any demo with a plugin segfaults.

Minimal model for reproduction

No response

Code required for reproduction

No response

Confirmations

@PeterOGB PeterOGB added the bug Something isn't working label Oct 3, 2024
@PeterOGB PeterOGB changed the title Plugings segfault when built with mjUSESINGLE Plugins segfault when built with mjUSESINGLE Oct 3, 2024
@yuvaltassa
Copy link
Collaborator

I think none of the plugins were written with float32 in mind. Do you actually need them or just want to have a fully working build?

@PeterOGB
Copy link
Author

PeterOGB commented Oct 3, 2024

I would like to use mujoco.elasticity.cable to model a strip of paper tape as it is read by a vintage paper tape reader. So yes I have a good reason for at least that one to work.

@PeterOGB
Copy link
Author

PeterOGB commented Oct 3, 2024

This is actually caused by the install process not updating the plugins in the installation directory. In fact it doesn't seem to install them at all ! At some point the "double" versions were put into /usr/local/bin/mujoco_plugins and they were not being replaced by the "float" versions I was actually building correctly.
Again I've ended up wasting several hours due to the mujoco build system not doing what you might reasonably expect it to do:-(

@PeterOGB PeterOGB closed this as completed Oct 3, 2024
@traversaro
Copy link
Contributor

This is actually caused by the install process not updating the plugins in the installation directory. In fact it doesn't seem to install them at all ! At some point the "double" versions were put into /usr/local/bin/mujoco_plugins and they were not being replaced by the "float" versions I was actually building correctly.
Again I've ended up wasting several hours due to the mujoco build system not doing what you might reasonably expect it to do:-(

Related PR: #1515 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants