Extend libproc's dbgsym search to include the guest zone; Fix bug where libproc generated dbgsym path with spaces rather than zeros#535
Open
smokris wants to merge 3 commits intoTritonDataCenter:masterfrom
Conversation
Author
|
I just rebased this on top of the latest |
danmcd
reviewed
Apr 1, 2026
danmcd
left a comment
There was a problem hiding this comment.
Sorry for delay on this. I see where you're going here.
Must-ask-question: Any AI/LLM assistance on this? RFD 187 demands transparency.
Also, do you think this might have use outside LX? IF SO perhaps it's worth upstreaming? (I also wonder if OS-4573 might also belong to upstream?)
| free(path); | ||
|
|
||
| if (r == B_FALSE) { | ||
| if (Pzoneroot(P, zroot, sizeof (zroot))) { |
There was a problem hiding this comment.
This feels too-indenty, but I'm not sure if I can suggest anything better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When various SmartOS GZ tools read a coredump from a process in an LX zone, they use
libprocto try to find debug symbol files (dbgsyms).libproc'sPbuild_file_symtabfunction reads the ELF header's.note.gnu.build-idvalue and tries to construct a pathname from it. However:…and thus can't find the dbgsym.
Steps to reproduce
On the GZ, create an LX zone from the latest Debian dataset:
Inside the guest zone, install dbgsym and generate a coredump that refers to it:
Back on the GZ, examine the coredump:
It fails to find the dbgsym:
…and is thus unable to symbolicate stack frames involving that library:
Analysis
Looking at this line in the above output:
There's a space in the middle of the hex string! However, the actual dbgsym path has a zero in that position instead of a space:
The hex string is generated by this line: https://github.com/illumos/illumos-gate/blob/a2e4f154b5ad0aae3da0ea3c730b6e993b11ba23/usr/src/lib/libproc/common/Psymtab.c#L2155
If I understand correctly, that format should instead be
%02x, so that byte values less than 16 have a leading zero rather than a leading space. I changed that in eacd134.After making that change, the path no longer contains any spaces:
…and it exactly matches the guest zone path provided by package
libuv1-dbgsym.However,
libprocstill can't find it, since it checks for the dbgsym in the GZ but not the guest zone. In 808e147 I added a clause that checks for it in the guest zone. Now it finds the dbgsym:…and it's able to successfully symbolicate stack frames involving that library: