-
Notifications
You must be signed in to change notification settings - Fork 184
Call instruction transfers control to incorrect address #539
Comments
It does not jump to instruction 834, but rather from that instruction. The target IP/PC is in the next line.
Text section vaddr: 0x100000120 Looks fine to me. You might be wondering why we still offset addresses before we display them. That is completely outdated (see https://github.com/solana-labs/rbpf/blame/main/src/ebpf.rs#L42) and we can probably remove it. |
For this .so file I have the following disassembly
call 0x9bf6 should jump to instruction 270817 which is
How does it end up on 834? |
The offsets are wrong, your disassembler and the one of RBPF are not aligned. They are shifted by |
i believe llvm-objdump offsets are correct and less concerned about offset shift. With coretests::main being the entrypoint I don’t see where and how rbpf takes the sequence of insns that it executes |
Attached a sample program that is executed incorrectly by the VM. The third instruction from the entrypoint is a call which should transfer control to instruction 270817. Instead the VM jumps to instruction 834 according to instruction trace.
sample.zip
The text was updated successfully, but these errors were encountered: