google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.26k stars 827 forks source link

Print error instead of failing silently when loading plugins #2180

Closed pschmutz closed 4 weeks ago

pschmutz commented 1 month ago

Previously the return value of dlopen was ignored, meaning a failed load of a shared library would stay unnoticed

Can be tested by compiling this piece of code into a shared library and then trying to load it

#include <iostream>
#include <mujoco/mujoco.h>

void test();

mjPLUGIN_LIB_INIT
{
  test();
  std::cout << "Registering Test Plugin" << std::endl;
}
google-cla[bot] commented 1 month ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.