-
Notifications
You must be signed in to change notification settings - Fork 165
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
Exception: (null): .debug_loc+0x19e829: unknown DWARF expression opcode 0xf3 #233
Comments
Just chiming in to say that I wouldn't expect the If this is presently preventing you from using |
Thanks! I had gotten to that part of the code, and since I know pretty much nothing about DWARF I figured I'd pause and wait for a second opinion. I originally encountered this with Oracle's UEK7 kernel (5.15 based) -- maybe we can update the compiler flags but I'd imagine that would be a hard sell. On the other hand, this isn't currently blocking anything much. I encountered it during normal continuous integration tests and for now, I've marked the tests as xfail. If I find free time I might try to learn more about what's going on here and see if I can help with adding support. I'll have to see what that entails though :) |
Yeah, when I wrote the DWARF unwinder, I left those unimplemented so I could see if I ran into them in practice. I have, and now you have, too, sorry! This wasn't a big deal for me since I knew how to interpret it, but for what I see in your work-in-progress, it'd definitely be better to gracefully handle this rather than blow up.
Unfortunately, we don't (and can't) do that. So for us, I think we just have to treat these as optimized out. Something like: diff --git a/libdrgn/dwarf_info.c b/libdrgn/dwarf_info.c
index 2350c1b1..58beb7eb 100644
--- a/libdrgn/dwarf_info.c
+++ b/libdrgn/dwarf_info.c
@@ -4436,6 +4436,9 @@ branch:
/* Special operations. */
case DW_OP_nop:
break;
+ case DW_OP_entry_value:
+ case DW_OP_GNU_entry_value:
+ return &drgn_not_found;
/* Location description operations. */
case DW_OP_reg0 ... DW_OP_reg31:
case DW_OP_regx:
@@ -4451,7 +4454,6 @@ branch:
*
* - DW_OP_push_object_address
* - DW_OP_form_tls_address
- * - DW_OP_entry_value
* DW_OP_implicit_pointer
* - Procedure calls: DW_OP_call2, DW_OP_call4, DW_OP_call_ref.
* - Typed operations: DW_OP_const_type, DW_OP_regval_type, |
The |
Oh wow, that explanation was worth a few dozen pages of DWARF5 spec at least! Thanks. I'll try out the patch tomorrow and see how it works. |
As a follow up, I compiled a test program with The function in question is https://github.com/osandov/osandov-linux/blob/801ae515d22d689265a6940d8ef4aa9d99b81bf7/scripts/debuginfod_client.c#L14-L28, which compiles to
But with
So I'm more confident now that my patch is the correct thing to do (at least its intention, since I haven't tested that it does what it claims to do 😉) |
After a bit of confusion with the vmtest, I did go ahead and test this patch on my branch and see that it works great. For my part I'll probably catch this exception and regex match it, since the next version won't be around for a while, it's no big deal. Let me know if you need more testing help or anything else on this. I consider it resolved, but I suppose you'll want to keep it open until there's a proper fix for these opcodes. |
Strangely enough, I just encountered "unknown DWARF expression opcode 0xa3" corresponding to the non-GNU |
DW_OP_entry_value
/DW_OP_GNU_entry_value
DW_OP_entry_value
/DW_OP_GNU_entry_value
I forgot to follow up on this, but it turns out that there are cases where we can recover something from |
We're getting (null) file paths in error messages (e.g., #233) because libdwfl doesn't always return the debug file path. Fall back to the loaded file path, which is better than nothing until we get rid of libdwfl. Signed-off-by: Omar Sandoval <[email protected]>
When retrieving variable values from some kernel stack frames, drgn fails
unknown DWARF expression opcode 0xf3
. I created a reproducer test (which includes my stack trace helper, heh) to run within the vmtest, and it reliably reproduces on kernels 5.10+, probably due to a change to the DWARF generation / compiler version in that release? In my exploration this happens despite drgn using the libdw packaged in the wheel, which is version 188, the latest. So I'm not certain what the issue is.Edit: looks like
DW_OP_GNU_entry_value
is the opcode for value 0xf3.Edit 2: here's the github actions run for this error: https://github.com/brenns10/drgn/actions/runs/3878425687/jobs/6614578560
The text was updated successfully, but these errors were encountered: