RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.25k stars 1.25k forks source link

rust dependencies spoil debug symbol loading in gdb #21836

Open rpoyner-tri opened 3 weeks ago

rpoyner-tri commented 3 weeks ago

What happened?

Version

master circa 1.32.0

What operating system are you using?

Ubuntu 22.04

What installation option are you using?

compiled from source code using Bazel

Relevant log output

rico@PUGET-255560:~/checkout/drake$ bazel test -c dbg //geometry/proximity/...
INFO: Analyzed 730 targets (0 packages loaded, 0 targets configured).
INFO: Found 235 targets and 495 test targets...
INFO: Elapsed time: 0.216s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

Executed 0 out of 495 tests: 495 tests pass.
rico@PUGET-255560:~/checkout/drake$ gdb --args ./bazel-bin//geometry/proximity/inflate_mesh_test
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bazel-bin//geometry/proximity/inflate_mesh_test...
warning: Missing auto-load script at offset 0 in section .debug_gdb_scripts
of file /home/rico/.cache/bazel/_bazel_rico/7f8997f28c9253517a55d673c67a6c74/execroot/drake/bazel-out/k8-dbg/bin/geometry/proximity/inflate_mesh_test.
Use `info auto-load python-scripts [REGEXP]' to list them.
(gdb) b inflate_mesh_test.cc:91
No source file named inflate_mesh_test.cc.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) quit
rpoyner-tri commented 3 weeks ago

More detail: using a non-clarabel-infected program still works. Also, hacking out the clarabel dependency also works to restore full debug symbols.

RussTedrake commented 3 weeks ago

Nice! I had noticed this, too, but had not investigated the root cause.

rpoyner-tri commented 3 weeks ago

I suspect some cure can be found by reading up about rust debugging. I've seen evidence of rust users having some version of this problem.

rpoyner-tri commented 2 weeks ago

Well, here are some completely unsatisfying partial answers.

rpoyner-tri commented 2 weeks ago

It appears that noble (binutils 2.42) has at least some of the same problems. Forcing bazel to use mold (via apt-get on noble) results in an executable with all line numbers.

jwnimmer-tri commented 2 weeks ago

FYI workaround: add --define=NO_CLARABEL=ON to your bazel command line to opt-out of Clarabel.