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

Debug Symbols in VECs #74

Open
insertinterestingnamehere opened this issue May 11, 2021 · 5 comments
Open

Debug Symbols in VECs #74

insertinterestingnamehere opened this issue May 11, 2021 · 5 comments
Labels
enhancement New feature or request VECs Related to Virtual Execution Contexts

Comments

@insertinterestingnamehere
Copy link
Member

This is somewhat aspirational, but currently there aren't any debug symbols available in VECs. No backtrace library gives meaningful results and gdb doesn't work. This makes debugging a nastier business than it already would be for something so unorthodox as VECs. We need to find some way to actually be able to have and use debug symbols in VECs. This will likely require a decent bit of hacking on the underlying libraries/tools, but it also seems like the kind of thing that people would really appreciate upstream. We're definitely not the first people to run into dlmopen's linker namespaces not working with gdb.

@insertinterestingnamehere insertinterestingnamehere added enhancement New feature or request VECs Related to Virtual Execution Contexts labels May 11, 2021
@insertinterestingnamehere
Copy link
Member Author

The best we've been able to do as of this writing is attempt to print out the stack with libunwind. See

void show_backtrace_with_unwind(void) {
. When exactly it works is inconsistent, and symbols may be left out if libunwind can't find the debug info. Even getting our libunwind solution to work reliably would already be a win in this case. Full GDB support may be a time-consuming undertaking. I don't know.

@insertinterestingnamehere
Copy link
Member Author

Specifically worth noting: I think the libunwind trace printing has succeeded in finding symbols for some functions within a VEC. For example, the segfaults in #68 include what appear to be mostly full traces. On the other hand we've seen the libunwind stack tracing outright skip printing function names or only print out a small portion of the stack. I'm not clear on why this happens. Perhaps the debug symbols are available somewhere, but we need a more reliable way of accessing them? glibc's own backtrace functions choke on linker namespaces though.

@arthurp
Copy link
Member

arthurp commented May 11, 2021

On the other hand we've seen the libunwind stack tracing outright skip printing function names or only print out a small portion of the stack.

I remember similar behavior when gdb (attached to the running process). So I don't think this is just a libunwind thing. I wonder if there is a debug table that is shared between namespaces so in some cases the table contains the right things for a given VEC, but not in other cases. And the table search may assume that the entry is present in the table, so that it fails in unpredictable ways when the entry isn't present (because it was overwritten by another VEC maybe).

@insertinterestingnamehere
Copy link
Member Author

I think the breaks in the traces usually correspond to places where a function in one VEC calls a function in another. Maybe the issue is jumping between tables?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VECs Related to Virtual Execution Contexts
Projects
None yet
Development

No branches or pull requests

2 participants