[Bug 260979] libproc can fail to find debug symbols for jailed processes

2022-01-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260979

Bug ID: 260979
   Summary: libproc can fail to find debug symbols for jailed
processes
   Product: Base System
   Version: CURRENT
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: bin
  Assignee: b...@freebsd.org
  Reporter: ma...@freebsd.org

libproc knows about the .gnu_debuglink extension and will use it to find
external debug files so that it can use them to do symbol resolution.  When
debugging a problem with lwhsu, we found that this doesn't quite work if the
process is jailed but the debugger is running in the jail host.

What libproc does is look up the path of a mapped file, check it for
.gnu_debuglink, and then try to read /usr/lib/debug/.debug.  On
the jail host, this path should really be /usr/lib/debug/.  In particular, libproc will fail to find the
debug info.  gdb has the same problem it seems.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 260979] libproc can fail to find debug symbols for jailed processes

2022-01-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260979

Ed Maste  changed:

   What|Removed |Added

 CC||ema...@freebsd.org

--- Comment #1 from Ed Maste  ---
When looking for debug data where debuglink specifies ls.debug and the build-id
is abcdef1234 gdb attempts to access, in order:

/usr/lib/debug/.build-id/ab/cdef1234.debug
/usr/bin/ls.debug
/usr/bin/.debug/ls.debug
/usr/lib/debug/usr/bin/ls.debug

(from https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html)

gdb supports "set debug-file-directory directories"

I don't see an obvious way this could be handled automatically.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 260979] libproc can fail to find debug symbols for jailed processes

2022-01-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260979

--- Comment #2 from Ed Maste  ---
(by "this" I mean looking up standalone debug data in a jail-specific
/usr/lib/debug directory)

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 260979] libproc can fail to find debug symbols for jailed processes

2022-01-06 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260979

Mark Johnston  changed:

   What|Removed |Added

 Status|New |Open

--- Comment #3 from Mark Johnston  ---
(In reply to Ed Maste from comment #2)
I'm not sure how best to deal with it either.  We could look up the root path
for the target process, and 1) prefix /usr/lib/debug, 2) strip that prefix from
paths of mapped files, but none of this would be 100% reliable.  It would
perhaps be sufficient to have a way to explicitly specify the debug file prefix
as a dtrace(1) option.

-- 
You are receiving this mail because:
You are the assignee for the bug.