-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DWARF] Incorrect location descriptor #9900
Comments
This is an interesting one. Here's how to reproduce the failure:
Here's the expression for
Here's annotated disassembly: 0x262b49d1520 <+0>: push rbp
0x262b49d1521 <+1>: mov rbp, rsp
0x262b49d1524 <+4>: mov r10, qword ptr [rdi + 0x8]
0x262b49d1528 <+8>: mov r10, qword ptr [r10 + 0x10]
0x262b49d152c <+12>: add r10, 0x30
0x262b49d1530 <+16>: cmp r10, rsp
0x262b49d1533 <+19>: ja 0x262b49d15ae ; <+142> at generic.cpp:27:5
0x262b49d1539 <+25>: sub rsp, 0x20
0x262b49d153d <+29>: mov qword ptr [rsp], rbx
0x262b49d1541 <+33>: mov qword ptr [rsp + 0x8], r12
0x262b49d1546 <+38>: mov qword ptr [rsp + 0x10], r13
0x262b49d154b <+43>: mov qword ptr [rsp + 0x18], r15
0x262b49d1550 <+48>: mov r15d, dword ptr [rdi + 0xa0] ; r15 = __vmctx->__stack_pointer
0x262b49d1557 <+55>: mov rsi, r15 ; rsi = r15 (__stack_pointer)
0x262b49d155a <+58>: sub esi, 0x10 ; rsi -= 16
0x262b49d155d <+61>: mov dword ptr [rdi + 0xa0], esi ; __vmctx->__stack_pointer = rsi
0x262b49d1563 <+67>: mov r12, qword ptr [rdi + 0x60]
0x262b49d1567 <+71>: mov dword ptr [r12 + rsi + 0xc], edx
0x262b49d156c <+76>: mov rbx, rdi
0x262b49d156f <+79>: mov r13, rdx
0x262b49d1572 <+82>: mov rsi, rbx ; rsi = __vmctx
-> 0x262b49d1575 <+85>: call 0x262b49d1180 ; debug_break at generic.h:9:28
0x262b49d157a <+90>: mov rdx, r13
0x262b49d157d <+93>: mov edx, edx
0x262b49d157f <+95>: mov ecx, dword ptr [r12 + rdx]
0x262b49d1583 <+99>: mov rdx, qword ptr [r12 + rdx + 0x8]
0x262b49d1588 <+104>: mov dword ptr [rbx + 0xa0], r15d ; __vmctx->__stack_pointer = r15
0x262b49d158f <+111>: lea eax, [rcx + rdx]
0x262b49d1592 <+114>: mov rbx, qword ptr [rsp]
0x262b49d1596 <+118>: mov r12, qword ptr [rsp + 0x8]
0x262b49d159b <+123>: mov r13, qword ptr [rsp + 0x10]
0x262b49d15a0 <+128>: mov r15, qword ptr [rsp + 0x18]
0x262b49d15a5 <+133>: add rsp, 0x20
0x262b49d15a9 <+137>: mov rsp, rbp
0x262b49d15ac <+140>: pop rbp
0x262b49d15ad <+141>: ret
0x262b49d15ae <+142>: ud2 So the culprit here is the fact BTW, here we can also see why the WASM frame base is so prone to being "optimized out" even as it is always used at the end of the method. Local zero gets split into two distinct values: one referenced in code and not referenced in DI ( |
Upgrading the logging for location descriptor building, here's what we see: Building ranges for values:
L#0 : %rdx@[49..86) %r13@[86..94)
L#1 : %r15@[49..105)
L#3 : %rsi@[59..72)
L#4 : %rdx@[94..100)
L#5 : %rcx@[96..112)
L#6 : %rcx@[96..112)
L#8 : %rdx@[100..112)
VMCTX: %rdi@[49..86) %rbx@[86..115)
0x262b49d155d <+61>: mov dword ptr [rdi + 0xa0], esi ; __vmctx->__stack_pointer = rsi
0x262b49d1563 <+67>: mov r12, qword ptr [rdi + 0x60]
0x262b49d1567 <+71>: mov dword ptr [r12 + rsi + 0xc], edx This implies a bug in range intersection. |
Reproduction steps:
__this
parameter #9898.-Oopt-level=0
to wasmtime.Expected result: the test passes or fails with 'expression unavailable'.
Actual result:
It means the location descriptor for
__this
is incorrect.The text was updated successfully, but these errors were encountered: