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

Segment Fault When Run Drake_CMake_Installed simple_bindings example #302

Open
hanlanqian opened this issue Sep 15, 2024 · 0 comments
Open

Comments

@hanlanqian
Copy link

hanlanqian commented Sep 15, 2024

Hey, I'm new to using Drake and Pybind11. I just followed the README file and tried to test the simple_bindings example. However, I encountered a segmentation fault when running the command adder = builder.AddSystem(SimpleAdder(100.)). It seems like there's an issue when calling the C++ Drake function in Python with Pybind11 and I can't figure out the reason.
Following is the cmake output:

[main] Configuring project: drake_cmake_installed 
[proc] Executing command: /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/g++ --no-warn-unused-cli -S/home/${username}/projects/drake-external-examples/drake_cmake_installed -B/home/${username}/projects/drake-external-examples/drake_cmake_installed/build -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Found pybind11: /usr/include (found version "2.9.1")
[cmake] -- Configuring done
[cmake] You have changed variables that require your cache to be deleted.
[cmake] Configure will be re-run and you may have to reset some variables.
[cmake] The following variables have changed:
[cmake] CMAKE_C_COMPILER= /usr/bin/gcc
[cmake] CMAKE_CXX_COMPILER= /usr/bin/g++
[cmake] 
[cmake] -- The C compiler identification is GNU 11.4.0
[cmake] -- The CXX compiler identification is GNU 11.4.0
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: /usr/bin/gcc - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: /usr/bin/g++ - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Looking for pthread.h
[cmake] -- Looking for pthread.h - found
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
[cmake] -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
[cmake] -- Found Threads: TRUE  
[cmake] -- Found Python3: /home/${username}/miniconda3/envs/drake/bin/python (found version "3.10.14") found components: Interpreter Development Development.Module Development.Embed 
[cmake] -- Performing Test HAS_FLTO
[cmake] -- Performing Test HAS_FLTO - Success
[cmake] -- Found pybind11: /usr/include (found version "2.9.1")
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] -- Build files have been written to: /home/${username}/projects/drake-external-examples/drake_cmake_installed/build
[cpptools] The build configurations generated do not contain the active build configuration. Using "" for CMAKE_BUILD_TYPE instead of "Debug" to ensure that IntelliSense configurations can be found

Failed Test Logfile:

5/6 Testing: simple_bindings_test
5/6 Test: simple_bindings_test
Command: "/home/${username}/miniconda3/envs/drake/bin/python" "/home/${username}/projects/drake-external-examples/drake_cmake_installed/src/simple_bindings/simple_bindings_test.py"
Directory: /home/${username}/projects/drake-external-examples/drake_cmake_installed/build/src/simple_bindings
"simple_bindings_test" start time: Sep 15 10:42 CST
Output:
----------------------------------------------------------
<end of output>
Test time =   0.12 sec
----------------------------------------------------------
Test Failed.
"simple_bindings_test" end time: Sep 15 10:42 CST
"simple_bindings_test" time elapsed: 00:00:00
----------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant