yurydelendik opened Issue #1372:
Based on https://github.com/bytecodealliance/wasmtime/issues/841
The following wasm function has multiple exits:
(func $test_conditional_panic (result i64) block i32.const 1 br_if 0 i64.const 0 return end unreachable )It generates machine code for x86_64:
0: 40 55 push rbp 2: 48 89 e5 mov rbp, rsp 5: 40 b8 01 00 00 00 mov eax, 1 b: 40 85 c0 test eax, eax e: 75 09 jne 0x19 10: 40 b8 00 00 00 00 mov eax, 0 16: 40 5d pop rbp 18: c3 ret 19: 0f 0b ud2The generated FDE looks like:
- at 0x02:
- define cfa base as
RSP + 0x10
- RBP is at
CFA - 0x10
- at 0x05:
- define cfa base as
RBP + 0x10
- at 0x18:
- define cfa base as
RSP + 0x8
The issue we are having is with stack traces below first function exit, due to FDE restructuring frame info for
ret
, though not restoring it back forud2
.
yurydelendik labeled Issue #1372:
Based on https://github.com/bytecodealliance/wasmtime/issues/841
The following wasm function has multiple exits:
(func $test_conditional_panic (result i64) block i32.const 1 br_if 0 i64.const 0 return end unreachable )It generates machine code for x86_64:
0: 40 55 push rbp 2: 48 89 e5 mov rbp, rsp 5: 40 b8 01 00 00 00 mov eax, 1 b: 40 85 c0 test eax, eax e: 75 09 jne 0x19 10: 40 b8 00 00 00 00 mov eax, 0 16: 40 5d pop rbp 18: c3 ret 19: 0f 0b ud2The generated FDE looks like:
- at 0x02:
- define cfa base as
RSP + 0x10
- RBP is at
CFA - 0x10
- at 0x05:
- define cfa base as
RBP + 0x10
- at 0x18:
- define cfa base as
RSP + 0x8
The issue we are having is with stack traces below first function exit, due to FDE restructuring frame info for
ret
, though not restoring it back forud2
.
yurydelendik edited Issue #1372:
Based on https://github.com/bytecodealliance/wasmtime/issues/841
The following wasm function has multiple exits:
(func $test_conditional_panic (result i64) block i32.const 1 br_if 0 i64.const 0 return end unreachable )It generates machine code for x86_64:
0: 40 55 push rbp 2: 48 89 e5 mov rbp, rsp 5: 40 b8 01 00 00 00 mov eax, 1 b: 40 85 c0 test eax, eax e: 75 09 jne 0x19 10: 40 b8 00 00 00 00 mov eax, 0 16: 40 5d pop rbp 18: c3 ret 19: 0f 0b ud2The generated FDE looks like:
- at 0x02:
- define cfa base as
RSP + 0x10
- RBP is at
CFA - 0x10
- at 0x05:
- define cfa base as
RBP + 0x10
- at 0x18:
- define cfa base as
RSP + 0x8
The issue we are having is with stack traces below first function exit -- the FDE does not restore initial state after the
ret
for other block/branch (in our caseud2
).
iximeow closed Issue #1372:
Based on https://github.com/bytecodealliance/wasmtime/issues/841
The following wasm function has multiple exits:
(func $test_conditional_panic (result i64) block i32.const 1 br_if 0 i64.const 0 return end unreachable )It generates machine code for x86_64:
0: 40 55 push rbp 2: 48 89 e5 mov rbp, rsp 5: 40 b8 01 00 00 00 mov eax, 1 b: 40 85 c0 test eax, eax e: 75 09 jne 0x19 10: 40 b8 00 00 00 00 mov eax, 0 16: 40 5d pop rbp 18: c3 ret 19: 0f 0b ud2The generated FDE looks like:
- at 0x02:
- define cfa base as
RSP + 0x10
- RBP is at
CFA - 0x10
- at 0x05:
- define cfa base as
RBP + 0x10
- at 0x18:
- define cfa base as
RSP + 0x8
The issue we are having is with stack traces below first function exit -- the FDE does not restore initial state after the
ret
for other block/branch (in our caseud2
).
Last updated: Nov 22 2024 at 16:03 UTC